Class Elliott2005DLM

  • Direct Known Subclasses:
    ElliottOnlineFilter

    public class Elliott2005DLM
    extends DLM
    This class implements the Kalman filter model as in Elliott's paper. It is a simplified version of the general univariate Kalman model. Specifically, the controls in the state equation are 1's; the state coefficient in the observation equation is 1.
    • Constructor Detail

      • Elliott2005DLM

        public Elliott2005DLM​(double x0,
                              double A,
                              double B,
                              double C,
                              double D,
                              RandomStandardNormalGenerator rnorm)
        Constructs an Elliott's Kalman filter model.
        Parameters:
        x0 - mean for the initial state
        A - A as in eq. 18, A >= 0
        B - B as in eq. 18, 0 < B < 1
        C - C as in eq. 18, C > 0
        D - D as in eq. 19, D > 0
        rnorm - a standard Gaussian random number generator
      • Elliott2005DLM

        public Elliott2005DLM​(double x0,
                              double A,
                              double B,
                              double C,
                              double D)
        Constructs an Elliott's Kalman filter model.
        Parameters:
        x0 - mean for the initial state
        A - A as in eq. 18
        B - B as in eq. 18
        C - C as in eq. 18
        D - D as in eq. 19
      • Elliott2005DLM

        public Elliott2005DLM​(Elliott2005DLM that)
        Copy constructor.
        Parameters:
        that - another Elliott's Kalman filter model
    • Method Detail

      • A

        public double A()
        Gets A as in eq. 18.
        Returns:
        A
      • B

        public double B()
        Gets B as in eq. 18.
        Returns:
        B
      • C

        public double C()
        Gets C as in eq. 18.
        Returns:
        C
      • D

        public double D()
        Gets D as in eq. 19, the variance.
        Returns:
        D
      • simStates

        public double[] simStates​(int T)
        Simulates a sequence of states per the model specification.
        Parameters:
        T - the length of the sequence
        Returns:
        a sequence of simulated states
      • simObs

        public double[] simObs​(int T)
        Simulates a sequence of observations per the model specification.
        Parameters:
        T - the length of the sequence
        Returns:
        a sequence of simulated observations
      • mu

        public double mu()
        Gets the long term mean.
        Returns:
        the long term mean
      • threshold

        public double threshold​(double c)
        Gets a suggested trading threshold based on an OU process.
        Parameters:
        c - c as in eq. 16
        Returns:
        the trading threshold
      • holdingTime

        public double holdingTime​(double c)
        Gets a suggested holding time based on an OU process.
        Parameters:
        c - c as in eq. 16
        Returns:
        the holding time
      • holdingTimeByThreshold

        public double holdingTimeByThreshold​(double threshold)
        Gets a suggested holding time based on an OU process.
        Parameters:
        threshold - a trading threshold
        Returns:
        the holding time