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 double
A()
GetsA
as in eq.double
B()
GetsB
as in eq.double
C()
GetsC
as in eq.double
D()
GetsD
as in eq.double
holdingTime(double c)
Gets a suggested holding time based on an OU process.double
holdingTimeByThreshold(double threshold)
Gets a suggested holding time based on an OU process.double
mu()
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.double
threshold(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
-A
as in eq. 18, A >= 0B
-B
as in eq. 18, 0 < B < 1C
-C
as in eq. 18, C > 0D
-D
as 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
-A
as in eq. 18B
-B
as in eq. 18C
-C
as in eq. 18D
-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()
GetsA
as in eq. 18.- Returns:
A
-
B
public double B()
GetsB
as in eq. 18.- Returns:
B
-
C
public double C()
GetsC
as in eq. 18.- Returns:
C
-
D
public double D()
GetsD
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
-
-