Class Elliott2005DLM
- java.lang.Object
-
- dev.nm.stat.dlm.univariate.DLM
-
- tech.nmfin.meanreversion.elliott2005.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 Summary
Constructors Constructor Description Elliott2005DLM(double x0, double A, double B, double C, double D)Constructs an Elliott's Kalman filter model.Elliott2005DLM(double x0, double A, double B, double C, double D, RandomStandardNormalGenerator rnorm)Constructs an Elliott's Kalman filter model.Elliott2005DLM(Elliott2005DLM that)Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleA()GetsAas in eq.doubleB()GetsBas in eq.doubleC()GetsCas in eq.doubleD()GetsDas in eq.doubleholdingTime(double c)Gets a suggested holding time based on an OU process.doubleholdingTimeByThreshold(double threshold)Gets a suggested holding time based on an OU process.doublemu()Gets the long term mean.double[]simObs(int T)Simulates a sequence of observations per the model specification.double[]simStates(int T)Simulates a sequence of states per the model specification.doublethreshold(double c)Gets a suggested trading threshold based on an OU process.-
Methods inherited from class dev.nm.stat.dlm.univariate.DLM
C0, getObsDimension, getObservationModel, getStateDimension, getStateModel, m0
-
-
-
-
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 stateA-Aas in eq. 18, A >= 0B-Bas in eq. 18, 0 < B < 1C-Cas in eq. 18, C > 0D-Das in eq. 19, D > 0rnorm- 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 stateA-Aas in eq. 18B-Bas in eq. 18C-Cas in eq. 18D-Das in eq. 19
-
Elliott2005DLM
public Elliott2005DLM(Elliott2005DLM that)
Copy constructor.- Parameters:
that- another Elliott's Kalman filter model
-
-
Method Detail
-
A
public double A()
GetsAas in eq. 18.- Returns:
A
-
B
public double B()
GetsBas in eq. 18.- Returns:
B
-
C
public double C()
GetsCas in eq. 18.- Returns:
C
-
D
public double D()
GetsDas 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-cas 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-cas 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
-
-