Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ gaussian_dlm_obs_rng() [1/2]

template<class RNG >
Eigen::MatrixXd stan::math::gaussian_dlm_obs_rng ( const Eigen::MatrixXd &  F,
const Eigen::MatrixXd &  G,
const Eigen::MatrixXd &  V,
const Eigen::MatrixXd &  W,
const Eigen::VectorXd &  m0,
const Eigen::MatrixXd &  C0,
const int  T,
RNG &  rng 
)
inline

Simulate random draw from Gaussian dynamic linear model (GDLM).

This distribution is equivalent to, for \(t = 1:T\),

\begin{eqnarray*} y_t & \sim N(F' \theta_t, V) \\ \theta_t & \sim N(G \theta_{t-1}, W) \\ \theta_0 & \sim N(m_0, C_0) \end{eqnarray*}

Template Parameters
RNGType of pseudo-random number generator.
Parameters
FA n x r matrix. The design matrix.
GA n x n matrix. The transition matrix.
VA r x r matrix. The observation covariance matrix.
WA n x n matrix. The state covariance matrix.
m0A n x 1 matrix. The mean vector of the distribution of the initial state.
C0A n x n matrix. The covariance matrix of the distribution of the initial state.
Ta positive integer, how many timesteps to simulate.
rngPseudo-random number generator.
Returns
A r x T matrix of simulated observations. Rows are variables, columns are observations. First column is the state after the first transition. Last column is the state after the last transition. Initial state not returned.
Exceptions
std::domain_errorif a matrix is not symmetric or not positive semi-definite. Or throw std::invalid_argument if a size is wrong or any input is NaN or non-finite, or if T is not positive. Require C0 in particular to be strictly positive definite. V and W can be semidefinite.

Definition at line 88 of file gaussian_dlm_obs_rng.hpp.