Convert Parameters from the Linear Stochastic Differential Equation Model to State Space Model Parameterization
Source:R/RcppExports.R
LinSDE2SSM.Rd
This function converts parameters from the linear stochastic differential equation model to state space model parameterization.
Arguments
- iota
Numeric vector. An unobserved term that is constant over time (\(\boldsymbol{\iota}\)).
- phi
Numeric matrix. The drift matrix which represents the rate of change of the solution in the absence of any random fluctuations (\(\boldsymbol{\Phi}\)).
- sigma_l
Numeric matrix. Cholesky factorization (
t(chol(sigma))
) of the covariance matrix of volatility or randomness in the process (\(\boldsymbol{\Sigma}\)).- delta_t
Numeric. Time interval (\(\Delta_t\)).
Value
Returns a list of state space parameters:
alpha
: Numeric vector. Vector of constant values for the dynamic model (\(\boldsymbol{\alpha}\)).beta
: Numeric matrix. Transition matrix relating the values of the latent variables from the previous time point to the current time point. (\(\boldsymbol{\beta}\)).psi_l
: Numeric matrix. Cholesky factorization (t(chol(psi))
) of the process noise covariance matrix \(\boldsymbol{\Psi}\).
Details
Let the linear stochastic equation model be given by $$ \mathrm{d} \boldsymbol{\eta}_{i, t} = \left( \boldsymbol{\iota} + \boldsymbol{\Phi} \boldsymbol{\eta}_{i, t} \right) \mathrm{d} t + \boldsymbol{\Sigma}^{\frac{1}{2}} \mathrm{d} \mathbf{W}_{i, t} $$ for individual \(i\) and time \(t\). The discrete-time state space model given below represents the discrete-time solution for the linear stochastic differential equation. $$ \boldsymbol{\eta}_{i, t_{{l_{i}}}} = \boldsymbol{\alpha}_{\Delta t_{{l_{i}}}} + \boldsymbol{\beta}_{\Delta t_{{l_{i}}}} \boldsymbol{\eta}_{i, t_{l_{i} - 1}} + \boldsymbol{\zeta}_{i, t_{{l_{i}}}}, \quad \mathrm{with} \quad \boldsymbol{\zeta}_{i, t_{{l_{i}}}} \sim \mathcal{N} \left( \mathbf{0}, \boldsymbol{\Psi}_{\Delta t_{{l_{i}}}} \right) $$ with $$ \boldsymbol{\beta}_{\Delta t_{{l_{i}}}} = \exp{ \left( \Delta t \boldsymbol{\Phi} \right) }, $$
$$ \boldsymbol{\alpha}_{\Delta t_{{l_{i}}}} = \boldsymbol{\Phi}^{-1} \left( \boldsymbol{\beta} - \mathbf{I}_{p} \right) \boldsymbol{\iota}, \quad \mathrm{and} $$
$$ \mathrm{vec} \left( \boldsymbol{\Psi}_{\Delta t_{{l_{i}}}} \right) = \left[ \left( \boldsymbol{\Phi} \otimes \mathbf{I}_{p} \right) + \left( \mathbf{I}_{p} \otimes \boldsymbol{\Phi} \right) \right] \left[ \exp \left( \left[ \left( \boldsymbol{\Phi} \otimes \mathbf{I}_{p} \right) + \left( \mathbf{I}_{p} \otimes \boldsymbol{\Phi} \right) \right] \Delta t \right) - \mathbf{I}_{p \times p} \right] \mathrm{vec} \left( \boldsymbol{\Sigma} \right) $$ where \(t\) denotes continuous-time processes that can be defined by any arbitrary time point, \(t_{l_{i}}\) the \(l^\mathrm{th}\) observed measurement occassion for individual \(i\), \(p\) the number of latent variables and \(\Delta t\) the time interval.
References
Harvey, A. C. (1990). Forecasting, structural time series models and the Kalman filter. Cambridge University Press. doi:10.1017/cbo9781107049994
See also
Other Simulation of State Space Models Data Functions:
SimBetaN()
,
SimPhiN()
,
SimSSMFixed()
,
SimSSMIVary()
,
SimSSMLinGrowth()
,
SimSSMLinGrowthIVary()
,
SimSSMLinSDEFixed()
,
SimSSMLinSDEIVary()
,
SimSSMOUFixed()
,
SimSSMOUIVary()
,
SimSSMVARFixed()
,
SimSSMVARIVary()
,
TestPhi()
,
TestStability()
,
TestStationarity()
Examples
p <- 2
iota <- c(0.317, 0.230)
phi <- matrix(
data = c(
-0.10,
0.05,
0.05,
-0.10
),
nrow = p
)
sigma <- matrix(
data = c(
2.79,
0.06,
0.06,
3.27
),
nrow = p
)
sigma_l <- t(chol(sigma))
delta_t <- 0.10
LinSDE2SSM(
iota = iota,
phi = phi,
sigma_l = sigma_l,
delta_t = delta_t
)
#> $alpha
#> [,1]
#> [1,] 0.03159928
#> [2,] 0.02296420
#>
#> $beta
#> [,1] [,2]
#> [1,] 0.99006221 0.00495027
#> [2,] 0.00495027 0.99006221
#>
#> $psi_l
#> [,1] [,2]
#> [1,] 0.52560735 0.0000000
#> [2,] 0.01414641 0.5688463
#>