- (This page is not constructed yet, however if you are interested in something send me an e-mail: gswelter at gmail dot com )
Table of Contents
|
Introduction
We make available some tools for statistical analysis of time series written in Python using the numpy and matplotlib libraries for scientific computing.
Consider $X$ to be a time series of $n$ data points. For Simplicity we assume $n$ to be a power of 2 in order to apply Fast Fourier Transform algorithm.
Signals
White Noise: whitenoise(n)
$\xi(t)$ is a i.i.d with uncorrelated Gaussian distribution
$\langle\xi(t) \rangle = 0$, $\langle\xi(t)\xi(s) \rangle = \sigma_\xi^2 \delta(t-s)$
Usage:
import pylab n = 2**12 x = whitenoise(n) plot(x)
Wiener Process: wiener(n)
(1)Ornstein-Uhlembeck Process: ou(n,mu,sigma,lamb)
Fractional Brownian Motion: fbm(n,H)
Wavelet (Multifractal) Random Cascade: wrc(n,W="ln",mu,sigma2)
Log-normal Cascade
Log-Poisson Cascade
Truncated Lévy Process: tlp(n,a,c)
Cantor: cantor(n,p1)
Binomial Multifractal: bm(n,a)
Mandelbrot Compound Cascade mcc(n,a)
Classical Analysis
Powerspectrum: powerspectrum(x)
import numpy def powerspectrum(x): s = numpy.fft(x) return numpy.real(s*numpy.conjugate(s))
Cospectrum: cospectum(x,y)
Quadrature Spectrum: quadspectrum(x,y)
Autocorrelation Function: autocor(x)
$R(\tau) = \langle x(t)x(t+\tau)\rangle_t / \sigma_x^2$
Using the Wiener-Kintchine theorem we can obtain the autocorrelation via FFT
import numpy def autocor(x): s = numpy.fft.fft(x) return numpy.real(numpy.fft.ifft(s*numpy.conjugate(s)))/numpy.var(x) R = autocor(x)
Crosscorrelation Function: crosscor(x,y)
Integral Scale: integralscale(x)
$T = \int_0^{\infty} R(\tau) d \tau$
Fourier Filter
Let
(2)and
(3)be the pair of Fourier Transform of $x$.
High Pass: fourier_hp(x, fc)
A high-pass filter is defined as
(4)where $\omega_c$ is angular-frequency cut.
Low Pass: fourier_lp(x, fc)
A low-pass filter is defined as
(5)smooth…
Convolution Product via FFT: convolve(x,y)
Plynomial Detrend: detrend(x,p)
Probability Density Estimation (via Kernel Density Estimation): pdf(x ,kernel = "g")
Cumulative Density Estimation (via Kernel Density Estimation): cdf(x, kernel = "g")v
Structure Function: sf(x,q)
(6)Cumulant Expansion: cumulant(x,nc = 4)
Wavelet Transform
Continuous Wavelet transform
(7)Discrete Wavelet Transform
(8)Multiresolution Analysis
Multifractal Analysis
Multifractal Detrended Fluctuation Analysis
Wavelet Leader
Surrogates
- Random Fourier Phases surr_rfp(x)
- Iterative Amplitute Adjusted Fourier-Transform surr_iaaft(x)
- Multifractal surr_mf(x)