bundles / scipy latest / scipy / stats / _levy_stable / pdf_from_cf_with_fft
function
scipy.stats._levy_stable:pdf_from_cf_with_fft
Signature
def pdf_from_cf_with_fft ( cf , h = 0.01 , q = 9 , level = 3 ) Summary
Calculates pdf from characteristic function.
Extended Summary
Uses fast Fourier transform with Newton-Cotes integration following [WZ]. Defaults to using Simpson's method (3-point Newton-Cotes integration).
Parameters
cf: callableSingle argument function from float -> complex expressing a characteristic function for some distribution.
h: Optional[float]Step size for Newton-Cotes integration. Default: 0.01
q: Optional[int]Use 2**q steps when performing Newton-Cotes integration. The infinite integral in the inverse Fourier transform will then be restricted to the interval [-2**q * h / 2, 2**q * h / 2]. Setting the number of steps equal to a power of 2 allows the fft to be calculated in O(n*log(n)) time rather than O(n**2). Default: 9
level: Optional[int]Calculate integral using n-point Newton-Cotes integration for n = level. The 3-point Newton-Cotes formula corresponds to Simpson's rule. Default: 3
Returns
x_l: ndarrayArray of points x at which pdf is estimated. 2**q equally spaced points from -pi/h up to but not including pi/h.
density: ndarrayEstimated values of pdf corresponding to cf at points in x_l.
Aliases
-
scipy.stats._levy_stable.pdf_from_cf_with_fft