Calculate the auto correlation function.
autocorrelation_fft(series,remove_mean=False,**kwargs) –> acf
The time series is correlated with itself across its whole length. Only the [0,len(series)[ interval is returned.
By default, the mean of the series is subtracted and the correlation of the fluctuations around the mean are investigated.
For the default setting remove_mean=True, acf[0] equals the variance of the series, acf[0] = Var(series) = <(series - <series>)**2>.
Optional:
Note that the series for mode=’same’|’full’ is inaccurate for long times and should probably be truncated at 1/2*len(series)
Arguments: |
|
---|
Calculate the correlation time and an estimate of the error of <y>.
The autocorrelation function f(t) is calculated via FFT on every nstep of the fluctuations of the data around the mean (y-<y>). The normalized ACF f(t)/f(0) is assumed to decay exponentially, f(t)/f(0) = exp(-t/tc) and the decay constant tc is estimated as the integral of the ACF from the start up to its first root.
See Frenkel and Smit, Academic Press, San Diego 2002, p526.
Note
nstep should be set sufficiently large so that there are less than ~50,000 entries in the input.
Arguments: |
|
---|---|
Returns: | dictionary with entries tc (decay constant in units of x), t0 (value of the first root along x (y(t0) = 0)), sigma (error estimate for the mean of y, <y>, corrected for correlations in the data). |