Lean  $LEAN_TAG$
QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage Class Reference

An Autoregressive Intergrated Moving Average (ARIMA) is a time series model which can be used to describe a set of data. In particular,with Xₜ representing the series, the model assumes the data are of form (after differencing _diffOrder times): More...

Inheritance diagram for QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage:
[legend]

Public Member Functions

 AutoRegressiveIntegratedMovingAverage (string name, int arOrder, int diffOrder, int maOrder, int period, bool intercept=true)
 Fits an ARIMA(arOrder,diffOrder,maOrder) model of form (after differencing it _diffOrder times): More...
 
 AutoRegressiveIntegratedMovingAverage (int arOrder, int diffOrder, int maOrder, int period, bool intercept)
 Fits an ARIMA(arOrder,diffOrder,maOrder) model of form (after differencing it _diffOrder times): More...
 
override void Reset ()
 Resets this indicator to its initial state More...
 

Public Attributes

double[] ArParameters
 Fitted AR parameters (φ terms). More...
 
double[] MaParameters
 Fitted MA parameters (θ terms). More...
 
double Intercept
 Fitted intercept (c term). More...
 
override bool IsReady => _rollingData.IsReady
 Gets a flag indicating when this indicator is ready and fully initialized More...
 

Protected Member Functions

override decimal ComputeNextValue (IndicatorDataPoint input)
 Forecasts the series of the fitted model one point ahead. More...
 
- Protected Member Functions inherited from QuantConnect.Indicators.TimeSeriesIndicator
 TimeSeriesIndicator (string name)
 A constructor for a basic Time Series indicator. More...
 

Properties

override int WarmUpPeriod [get]
 Required period, in data points, for the indicator to be ready and fully initialized. More...
 
double ArResidualError [get]
 The variance of the residuals (Var(ε)) from the first step of TwoStepFit. More...
 
double MaResidualError [get]
 The variance of the residuals (Var(ε)) from the second step of TwoStepFit. More...
 
- Properties inherited from QuantConnect.Indicators.TimeSeriesIndicator
abstract int WarmUpPeriod [get]
 Required period, in data points, for the indicator to be ready and fully initialized. More...
 
- Properties inherited from QuantConnect.Indicators.IIndicatorWarmUpPeriodProvider
int WarmUpPeriod [get]
 Required period, in data points, for the indicator to be ready and fully initialized. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from QuantConnect.Indicators.TimeSeriesIndicator
static double[] DifferenceSeries (int d, double[] series, out double[] diffHeads)
 Differences a time series d times. More...
 
static double[] InverseDifferencedSeries (double[] series, double[] diffHeads)
 Undoes the differencing of a time series which has been differenced using DifferenceSeries. https://github.com/statsmodels/statsmodels/blob/04f00006a7aeb1c93d6894caa420698400da6c33/statsmodels/tsa/tsatools.py#L758 More...
 
static double[][] LaggedSeries (int p, double[] series, bool includeT=false)
 Returns an array of lagged series for each of {1,...,p} lags. More...
 
static List< double > CumulativeSum (List< double > series, bool reverse=false)
 Returns a series where each spot is taken by the cumulative sum of all points up to and including the value at that spot in the original series. More...
 
- Protected Attributes inherited from QuantConnect.Indicators.TimeSeriesIndicator
double[] _diffHeads
 "Integration" constants More...
 

Detailed Description

An Autoregressive Intergrated Moving Average (ARIMA) is a time series model which can be used to describe a set of data. In particular,with Xₜ representing the series, the model assumes the data are of form (after differencing _diffOrder times):

Xₜ = c + εₜ + ΣᵢφᵢXₜ₋ᵢ + Σᵢθᵢεₜ₋ᵢ

where the first sum has an upper limit of _arOrder and the second _maOrder.

Definition at line 34 of file AutoRegressiveIntegratedMovingAverage.cs.

Constructor & Destructor Documentation

◆ AutoRegressiveIntegratedMovingAverage() [1/2]

QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.AutoRegressiveIntegratedMovingAverage ( string  name,
int  arOrder,
int  diffOrder,
int  maOrder,
int  period,
bool  intercept = true 
)

Fits an ARIMA(arOrder,diffOrder,maOrder) model of form (after differencing it _diffOrder times):

Xₜ = c + εₜ + ΣᵢφᵢXₜ₋ᵢ + Σᵢθᵢεₜ₋ᵢ

where the first sum has an upper limit of _arOrder and the second _maOrder. This particular constructor fits the model by means of TwoStepFit for a specified name.

Parameters
nameThe name of the indicator
arOrderAR order (p) – defines the number of past values to consider in the AR component of the model.
diffOrderDifference order (d) – defines how many times to difference the model before fitting parameters.
maOrderMA order – defines the number of past values to consider in the MA component of the model.
periodSize of the rolling series to fit onto
interceptWhether ot not to include the intercept term

Definition at line 105 of file AutoRegressiveIntegratedMovingAverage.cs.

◆ AutoRegressiveIntegratedMovingAverage() [2/2]

QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.AutoRegressiveIntegratedMovingAverage ( int  arOrder,
int  diffOrder,
int  maOrder,
int  period,
bool  intercept 
)

Fits an ARIMA(arOrder,diffOrder,maOrder) model of form (after differencing it _diffOrder times):

Xₜ = c + εₜ + ΣᵢφᵢXₜ₋ᵢ + Σᵢθᵢεₜ₋ᵢ

where the first sum has an upper limit of _arOrder and the second _maOrder. This particular constructor fits the model by means of TwoStepFit using ordinary least squares.

Parameters
arOrderAR order (p) – defines the number of past values to consider in the AR component of the model.
diffOrderDifference order (d) – defines how many times to difference the model before fitting parameters.
maOrderMA order (q) – defines the number of past values to consider in the MA component of the model.
periodSize of the rolling series to fit onto
interceptWhether to include an intercept term (c)

Definition at line 152 of file AutoRegressiveIntegratedMovingAverage.cs.

Member Function Documentation

◆ Reset()

override void QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.Reset ( )

Resets this indicator to its initial state

Definition at line 167 of file AutoRegressiveIntegratedMovingAverage.cs.

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.ComputeNextValue ( IndicatorDataPoint  input)
protected

Forecasts the series of the fitted model one point ahead.

Parameters
inputThe input given to the indicator
Returns
A new value for this indicator

Definition at line 178 of file AutoRegressiveIntegratedMovingAverage.cs.

Here is the call graph for this function:

Member Data Documentation

◆ ArParameters

double [] QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.ArParameters

Fitted AR parameters (φ terms).

Definition at line 59 of file AutoRegressiveIntegratedMovingAverage.cs.

◆ MaParameters

double [] QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.MaParameters

Fitted MA parameters (θ terms).

Definition at line 64 of file AutoRegressiveIntegratedMovingAverage.cs.

◆ Intercept

double QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.Intercept

Fitted intercept (c term).

Definition at line 69 of file AutoRegressiveIntegratedMovingAverage.cs.

◆ IsReady

override bool QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.IsReady => _rollingData.IsReady

Gets a flag indicating when this indicator is ready and fully initialized

Definition at line 74 of file AutoRegressiveIntegratedMovingAverage.cs.

Property Documentation

◆ WarmUpPeriod

override int QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.WarmUpPeriod
get

Required period, in data points, for the indicator to be ready and fully initialized.

Definition at line 79 of file AutoRegressiveIntegratedMovingAverage.cs.

◆ ArResidualError

double QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.ArResidualError
get

The variance of the residuals (Var(ε)) from the first step of TwoStepFit.

Definition at line 84 of file AutoRegressiveIntegratedMovingAverage.cs.

◆ MaResidualError

double QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.MaResidualError
get

The variance of the residuals (Var(ε)) from the second step of TwoStepFit.

Definition at line 89 of file AutoRegressiveIntegratedMovingAverage.cs.


The documentation for this class was generated from the following file: