Timeseries

AR1(k, tau_e, *args, **kwargs) Autoregressive process with 1 lag.
AR(rho[, sd, tau, constant, init]) Autoregressive process with p lags.
GaussianRandomWalk([tau, init, sd, mu]) Random Walk with Normal innovations
GARCH11(omega, alpha_1, beta_1, initial_vol, …) GARCH(1,1) with Normal innovations.
EulerMaruyama(dt, sde_fn, sde_pars, *args, …) Stochastic differential equation discretized with the Euler-Maruyama method.
MvGaussianRandomWalk([mu, cov, tau, chol, …]) Multivariate Random Walk with Normal innovations
MvStudentTRandomWalk(nu[, mu, cov, tau, …]) Multivariate Random Walk with StudentT innovations
class pymc3.distributions.timeseries.AR1(k, tau_e, *args, **kwargs)

Autoregressive process with 1 lag.

Parameters:
  • k (tensor) – effect of lagged value on current value
  • tau_e (tensor) – precision for innovations
class pymc3.distributions.timeseries.AR(rho, sd=None, tau=None, constant=False, init=<pymc3.distributions.continuous.Flat object>, *args, **kwargs)

Autoregressive process with p lags.

\[x_t = \rho_0 + \rho_1 x_{t-1} + \ldots + \rho_p x_{t-p} + \epsilon_t, \epsilon_t \sim N(0,\sigma^2)\]

The innovation can be parameterized either in terms of precision or standard deviation. The link between the two parametrizations is given by

\[\tau = \dfrac{1}{\sigma^2}\]
Parameters:
  • rho (tensor) – Vector of autoregressive coefficients.
  • sd (float) – Standard deviation of innovation (sd > 0).
  • tau (float) – Precision of innovation (tau > 0).
  • constant (bool (optional, default = False)) – Whether to include a constant.
  • init (distribution) – distribution for initial values (Defaults to Flat())
class pymc3.distributions.timeseries.GaussianRandomWalk(tau=None, init=<pymc3.distributions.continuous.Flat object>, sd=None, mu=0.0, *args, **kwargs)

Random Walk with Normal innovations

Parameters:
  • tau (tensor) – tau > 0, innovation precision
  • sd (tensor) – sd > 0, innovation standard deviation (alternative to specifying tau)
  • mu (tensor) – innovation drift, defaults to 0.0
  • init (distribution) – distribution for initial value (Defaults to Flat())
class pymc3.distributions.timeseries.GARCH11(omega, alpha_1, beta_1, initial_vol, *args, **kwargs)

GARCH(1,1) with Normal innovations. The model is specified by

\[y_t = \sigma_t * z_t \sigma_t^2 = \omega + \alpha_1 * y_{t-1}^2 + \beta_1 * \sigma_{t-1}^2\]

with z_t iid and Normal with mean zero and unit standard deviation.

Parameters:
  • omega (distribution) – omega > 0, distribution for mean variance
  • alpha_1 (distribution) – alpha_1 >= 0, distribution for autoregressive term
  • beta_1 (distribution) – beta_1 >= 0, alpha_1 + beta_1 < 1, distribution for moving average term
  • initial_vol (distribution) – initial_vol >= 0, distribution for initial volatility, sigma_0
class pymc3.distributions.timeseries.EulerMaruyama(dt, sde_fn, sde_pars, *args, **kwds)

Stochastic differential equation discretized with the Euler-Maruyama method.

Parameters:
  • dt (float) – time step of discretization
  • sde_fn (callable) – function returning the drift and diffusion coefficients of SDE
  • sde_pars (tuple) – parameters of the SDE, passed as *args to sde_fn
class pymc3.distributions.timeseries.MvGaussianRandomWalk(mu=0.0, cov=None, tau=None, chol=None, lower=True, init=<pymc3.distributions.continuous.Flat object>, *args, **kwargs)

Multivariate Random Walk with Normal innovations

Parameters:
  • mu (tensor) – innovation drift, defaults to 0.0
  • cov (tensor) – pos def matrix, innovation covariance matrix
  • tau (tensor) – pos def matrix, inverse covariance matrix
  • chol (tensor) – Cholesky decomposition of covariance matrix
  • init (distribution) – distribution for initial value (Defaults to Flat())

Notes

Only one of cov, tau or chol is required.

class pymc3.distributions.timeseries.MvStudentTRandomWalk(nu, mu=0.0, cov=None, tau=None, chol=None, lower=True, init=<pymc3.distributions.continuous.Flat object>, *args, **kwargs)

Multivariate Random Walk with StudentT innovations

Parameters:
  • nu (degrees of freedom) –
  • mu (tensor) – innovation drift, defaults to 0.0
  • cov (tensor) – pos def matrix, innovation covariance matrix
  • tau (tensor) – pos def matrix, inverse covariance matrix
  • chol (tensor) – Cholesky decomposition of covariance matrix
  • init (distribution) – distribution for initial value (Defaults to Flat())