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

◆ gaussian_dlm_obs_lpdf() [1/2]

template<bool propto, typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 , require_all_eigen_matrix_dynamic_t< T_y, T_F, T_G, T_V, T_W, T_C0 > * = nullptr, require_eigen_col_vector_t< T_m0 > * = nullptr>
return_type_t< T_y, T_F, T_G, T_V, T_W, T_m0, T_C0 > stan::math::gaussian_dlm_obs_lpdf ( const T_y &  y,
const T_F &  F,
const T_G &  G,
const T_V &  V,
const T_W &  W,
const T_m0 &  m0,
const T_C0 &  C0 
)
inline

The log of a Gaussian dynamic linear model (GDLM).

The log of a Gaussian dynamic linear model (GDLM) with uncorrelated observation disturbances.

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*}

If V is a vector, then the Kalman filter is applied sequentially.

Template Parameters
T_ytype of scalar
T_Ftype of design matrix
T_Gtype of transition matrix
T_Vtype of observation covariance matrix
T_Wtype of state covariance matrix
T_m0type of initial state mean vector
T_C0type of initial state covariance matrix
Parameters
yA r x T matrix of observations. Rows are variables, columns are observations.
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.
Returns
The log of the joint density of the GDLM.
Exceptions
std::domain_errorif a matrix in the Kalman filter is not positive semi-definite.

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

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

If V is a vector, then the Kalman filter is applied sequentially.

Parameters
yA r x T matrix of observations. Rows are variables, columns are observations.
FA n x r matrix. The design matrix.
GA n x n matrix. The transition matrix.
VA size r vector. The diagonal of 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.
Returns
The log of the joint density of the GDLM.
Exceptions
std::domain_errorif a matrix in the Kalman filter is not semi-positive definite.
Template Parameters
T_yType of scalar.
T_FType of design matrix.
T_GType of transition matrix.
T_VType of observation variances
T_WType of state covariance matrix.
T_m0Type of initial state mean vector.
T_C0Type of initial state covariance matrix.

Definition at line 70 of file gaussian_dlm_obs_lpdf.hpp.