OU#

class pypillometry.signal.gaussmarkov.OU(sigma=1.0, tau=100.0)[source]#

Bases: Component

Ornstein-Uhlenbeck process, k(r) = sigma^2 exp(-r / tau) (the Matérn process with nu = 1/2).

Parameters:
  • sigma (float) – standard deviation (signal units)

  • tau (float) – time constant (ms)

Examples

>>> ou = OU(sigma=1., tau=200.)
>>> A, Q = ou.discretise(1.)
>>> bool(np.isclose(A[0, 0], np.exp(-1 / 200.)))
True

Methods

cov

Autocovariance k(tau) of the output at lags tau (ms).

discretise

Exact discretisation for a time step dt (ms).

get_params

dict of the parameters

psd

One-sided power spectral density of the output at frequencies freq (Hz), in signal units squared per Hz; its integral over all frequencies is the variance.

ss

Continuous-time state space (ContinuousSS).

variogram

Semivariogram gamma(tau) = k(0) - k(tau) of the output (ms).

with_params

copy with some parameters (or structural fields) changed

Details

cov(tau)[source]#

Autocovariance k(tau) of the output at lags tau (ms).

Return type:

ndarray

discretise(dt)#

Exact discretisation for a time step dt (ms).

Return type:

tuple[ndarray, ndarray]

Returns:

A, Q (np.ndarray) – transition matrix and process-noise covariance, x[t+dt] = A x[t] + w, w ~ N(0, Q)

get_params()#

dict of the parameters

Return type:

dict[str, float]

psd(freq)#

One-sided power spectral density of the output at frequencies freq (Hz), in signal units squared per Hz; its integral over all frequencies is the variance.

\[S(f) = \frac{2}{1000} H (i\omega - F)^{-1} Q_n (-i\omega - F^\top)^{-1} H^\top, \qquad \omega = 2\pi f / 1000\]
Return type:

ndarray

ss()[source]#

Continuous-time state space (ContinuousSS).

Return type:

ContinuousSS

variogram(tau)#

Semivariogram gamma(tau) = k(0) - k(tau) of the output (ms).

Return type:

ndarray

with_params(**kw)#

copy with some parameters (or structural fields) changed

Return type:

Self

property dim: int#

dimension of the state