Package dev.nm.stat.dlm.univariate
Class StateEquation
- java.lang.Object
-
- dev.nm.stat.dlm.univariate.StateEquation
-
public class StateEquation 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 StateEquation(double G, double W)
Construct a time-invariant state equation without control variables.StateEquation(double G, double H, double W, RandomStandardNormalGenerator rnorm)
Construct a time-invariant state equation.StateEquation(UnivariateRealFunction G, UnivariateRealFunction W)
Construct a state equation without control variables.StateEquation(UnivariateRealFunction G, UnivariateRealFunction H, UnivariateRealFunction W)
Construct a state equation.StateEquation(UnivariateRealFunction G, UnivariateRealFunction H, UnivariateRealFunction W, RandomStandardNormalGenerator rnorm)
Construct a state equation.StateEquation(StateEquation that)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
dimension()
Get the dimension of state xt.double
G(int t)
Get G(t), the coefficient of xt - 1.double
H(int t)
Get H(t), the variance of ut.double
W(int t)
Get W(t), the variance of wt.double
xt(int t, double xt_1)
Evaluate the state equation without the control variable.double
xt(int t, double xt_1, double ut)
Evaluate the state equation.double
xt_mean(int t, double xt_1)
Predict the next state without control variable.double
xt_mean(int t, double xt_1, double ut)
Predict the next state.double
xt_var(int t, double var_tlag_tlag)
Get the variance of the apriori prediction for the next state.
-
-
-
Constructor Detail
-
StateEquation
public StateEquation(UnivariateRealFunction G, UnivariateRealFunction H, UnivariateRealFunction W, RandomStandardNormalGenerator rnorm)
Construct a state equation.- Parameters:
G
- the coefficient function of xt - 1H
- the coefficient function of control variables utW
- the variance function of wtrnorm
- a standard Gaussian random number generator (for seeding)
-
StateEquation
public StateEquation(UnivariateRealFunction G, UnivariateRealFunction H, UnivariateRealFunction W)
Construct a state equation.- Parameters:
G
- the coefficient function of xt - 1H
- the coefficient function of control variables utW
- the variance function of wt
-
StateEquation
public StateEquation(UnivariateRealFunction G, UnivariateRealFunction W)
Construct a state equation without control variables.- Parameters:
G
- the coefficient function of xt - 1W
- the variance function of wt
-
StateEquation
public StateEquation(double G, double H, double W, RandomStandardNormalGenerator rnorm)
Construct a time-invariant state equation.- Parameters:
G
- the coefficient of xt - 1H
- the coefficient of control variables utW
- the variance of wtrnorm
- a standard Gaussian random number generator
-
StateEquation
public StateEquation(double G, double W)
Construct a time-invariant state equation without control variables.- Parameters:
G
- the coefficient of xt - 1W
- the variance of wt
-
StateEquation
public StateEquation(StateEquation that)
Copy constructor.- Parameters:
that
- aStateEquation
-
-
Method Detail
-
dimension
public int dimension()
Get the dimension of state xt.- Returns:
- the dimension of states
-
G
public double G(int t)
Get G(t), the coefficient of xt - 1.- Parameters:
t
- time- Returns:
- G(t)
-
H
public double H(int t)
Get H(t), the variance of ut.- Parameters:
t
- time- Returns:
- H(t)
-
W
public double W(int t)
Get W(t), the variance of wt.- Parameters:
t
- time- Returns:
- W(t)
-
xt_mean
public double xt_mean(int t, double xt_1, double ut)
Predict 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 double xt_mean(int t, double xt_1)
Predict 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 double xt_var(int t, double var_tlag_tlag)
Get 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 variance of the posterior update- Returns:
- Var(x_{t | t - 1})
-
xt
public double xt(int t, double xt_1, double ut)
Evaluate 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 double xt(int t, double xt_1)
Evaluate 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
-
-