Class 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 Detail

      • StateEquation

        public StateEquation​(UnivariateRealFunction G,
                             UnivariateRealFunction W)
        Construct a state equation without control variables.
        Parameters:
        G - the coefficient function of xt - 1
        W - 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 - 1
        H - the coefficient of control variables ut
        W - the variance of wt
        rnorm - 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 - 1
        W - the variance of wt
      • StateEquation

        public StateEquation​(StateEquation that)
        Copy constructor.
        Parameters:
        that - a StateEquation
    • 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 - time
        xt_1 - x lag xt - 1
        ut - 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 - time
        xt_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 - time
        var_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 - time
        xt_1 - x lag xt - 1
        ut - 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 - time
        xt_1 - x lag xt - 1
        Returns:
        xt