Package dev.nm.stat.dlm.multivariate
Class MultivariateStateEquation
- java.lang.Object
-
- dev.nm.stat.dlm.multivariate.MultivariateStateEquation
-
public class MultivariateStateEquation extends Object
This is the state equation in a controlled dynamic linear model.xt = Gt * xt-1 + Ht * ut + wt,
-
-
Constructor Summary
Constructors Constructor Description MultivariateStateEquation(Matrix G, Matrix W)
Constructs a time-invariant state equation without control variables.MultivariateStateEquation(Matrix G, Matrix H, Matrix W, NormalRVG rmvnorm)
Constructs a time-invariant state equation.MultivariateStateEquation(R1toMatrix G, R1toMatrix W)
Constructs a state equation without control variables.MultivariateStateEquation(R1toMatrix G, R1toMatrix H, R1toMatrix W)
Constructs a state equation.MultivariateStateEquation(R1toMatrix G, R1toMatrix H, R1toMatrix W, NormalRVG rmvnorm)
Constructs a state equation.MultivariateStateEquation(MultivariateStateEquation that)
Copy constructor.MultivariateStateEquation(StateEquation states)
Constructs a multivariate state equation from a univariate state equation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
dimension()
Gets the dimension of state xt.Matrix
G(int t)
Gets G(t), the coefficient matrix of xt - 1.Matrix
H(int t)
Gets H(t), the covariance matrix of ut.Matrix
W(int t)
Gets W(t), the covariance matrix of wt.ImmutableVector
xt(int t, Vector xt_1)
Evaluates the state equation without the control variable.ImmutableVector
xt(int t, Vector xt_1, Vector ut)
Evaluates the state equation.Vector
xt_mean(int t, Vector xt_1)
Predicts the next state without control variable.Vector
xt_mean(int t, Vector xt_1, Vector ut)
Predicts the next state.ImmutableMatrix
xt_var(int t, Matrix var_tlag_tlag)
Gets the variance of the apriori prediction for the next state.
-
-
-
Constructor Detail
-
MultivariateStateEquation
public MultivariateStateEquation(R1toMatrix G, R1toMatrix H, R1toMatrix W, NormalRVG rmvnorm)
Constructs a state equation.- Parameters:
G
- the coefficient matrix function of xt - 1H
- the coefficient matrix function of control variables ut; usenull
if there isn't anyW
- the covariance matrix function of wtrmvnorm
- a p-dimensional standard multivariate Gaussian random vector generator (for seeding); p = the dimension of W or xt
-
MultivariateStateEquation
public MultivariateStateEquation(R1toMatrix G, R1toMatrix H, R1toMatrix W)
Constructs a state equation.- Parameters:
G
- the coefficient matrix function of xt - 1H
- the coefficient matrix function of control variables ut; usenull
if there isn't anyW
- the covariance matrix function of wt
-
MultivariateStateEquation
public MultivariateStateEquation(R1toMatrix G, R1toMatrix W)
Constructs a state equation without control variables.- Parameters:
G
- the coefficient matrix function of xt - 1W
- the covariance matrix function of wt
-
MultivariateStateEquation
public MultivariateStateEquation(Matrix G, Matrix H, Matrix W, NormalRVG rmvnorm)
Constructs a time-invariant state equation.- Parameters:
G
- the coefficient matrix function of xt - 1H
- the coefficient matrix function of control variables ut; usenull
if there isn't anyW
- the covariance matrix function of wtrmvnorm
- a p-dimensional standard multivariate Gaussian random vector generator; p = the dimension of W or xt
-
MultivariateStateEquation
public MultivariateStateEquation(Matrix G, Matrix W)
Constructs a time-invariant state equation without control variables.- Parameters:
G
- the coefficient matrix function of xt - 1W
- the covariance matrix function of wt
-
MultivariateStateEquation
public MultivariateStateEquation(StateEquation states)
Constructs a multivariate state equation from a univariate state equation.- Parameters:
states
- a univariate state equation
-
MultivariateStateEquation
public MultivariateStateEquation(MultivariateStateEquation that)
Copy constructor.- Parameters:
that
- aStateEquation
-
-
Method Detail
-
dimension
public int dimension()
Gets the dimension of state xt.- Returns:
- the dimension of states
-
G
public Matrix G(int t)
Gets G(t), the coefficient matrix of xt - 1.- Parameters:
t
- time- Returns:
- G(t)
-
H
public Matrix H(int t)
Gets H(t), the covariance matrix of ut.- Parameters:
t
- time- Returns:
- H(t)
-
W
public Matrix W(int t)
Gets W(t), the covariance matrix of wt.- Parameters:
t
- time- Returns:
- W(t)
-
xt_mean
public Vector xt_mean(int t, Vector xt_1, Vector ut)
Predicts the next state.E(x_t) = G_t * x_{t - 1} + H_t * u_t
- Parameters:
t
- timext_1
- x lag xt - 1ut
- the control variable ut- Returns:
- xt
-
xt_mean
public Vector xt_mean(int t, Vector xt_1)
Predicts the next state without control variable.E(x_t) = G_t * x_{t - 1} + H_t * u_t
- Parameters:
t
- timext_1
- x lag xt - 1- Returns:
- xt
-
xt_var
public ImmutableMatrix xt_var(int t, Matrix var_tlag_tlag)
Gets the variance of the apriori prediction for the next state.Var(x_{t | t - 1}) = G_t * Var(x_{t - 1| t - 1}) * G_t' + W_t
- Parameters:
t
- timevar_tlag_tlag
- Var(x_{t - 1 | t - 1}), the covariance of the posterior update- Returns:
- Var(x_{t | t - 1})
-
xt
public ImmutableVector xt(int t, Vector xt_1, Vector ut)
Evaluates the state equation.x_t = G_t * x_{t - 1} + H_t * u_t + w_t
- Parameters:
t
- timext_1
- x lag xt - 1ut
- the control variable ut- Returns:
- xt
-
xt
public ImmutableVector xt(int t, Vector xt_1)
Evaluates the state equation without the control variable.x_t = G_t * x_{t - 1} + H_t * u_t + w_t
- Parameters:
t
- timext_1
- x lag xt - 1- Returns:
- xt
-
-