TMB Documentation
v1.9.11
|
Stationary AR1 process. More...
#include <density.hpp>
Public Member Functions | |
scalartype | operator() (vectortype x) |
Evaluate the negative log density. | |
void | simulate (vectortype &x) |
Draw a simulation from the process. | |
Stationary AR1 process.
Class to evaluate the negative log density of a (multivariate) AR1 process with parameter phi and given marginal distribution.
phi | Scalar -1<phi<1 |
MARGINAL | The desired (multivariate) marginal distribution. |
Let \(f(x)\) denote a multivariate Gaussian mean-zero negative log density represented by its covariance matrix \(\Sigma\). Define recursively the vectors
\[x_0\sim N(0,\Sigma)\]
\[x_1 = \phi x_0 + \sigma\varepsilon_1\:,\:\:\: \varepsilon_1 \sim N(0,\Sigma)\]
\[x_i = \phi x_{i-1} + \sigma\varepsilon_i\:,\:\:\: \varepsilon_i \sim N(0,\Sigma)\]
where \(\sigma=\sqrt{1-\phi^2}\). Then \(E(x_i)=0\), \(V(x_i)=\Sigma\) and the covariance is \(E(x_ix_j')=\phi^{|i-j|}\Sigma\). We refer to this process as a stationary 1st order autoregressive process with multivariate increments with parameter phi and marginal distribution f. Compactly denoted AR1(phi,f).
Note that the construction can be carried out recursively, as "AR1(phi,f)" is itself a distribution that can be used as input to AR1(). See example below:
Now use f1 as marginal in a new AR1 process with parameter phi2:
Definition at line 375 of file density.hpp.