# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.model.elliott2005

## 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.
"Elliott, van der Hoek, and Malcolm, "Pairs trading," Quantitative Finance, 2005."
• ### Constructor Summary

Constructors
Constructor and 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
Modifier and Type Method and Description
double A()
Gets A as in eq.
double B()
Gets B as in eq.
double C()
Gets C as in eq.
double D()
Gets D 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 com.numericalmethod.suanshu.stats.dlm.univariate.DLM

C0, getObsDimension, getObservationModel, getStateDimension, getStateModel, m0
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### 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:
• #### 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