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

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

bool HandleExceptions = true [get, set]
 Whether or not to handle potential exceptions, returning a zero value. I.e, the values provided as input are not valid by the Normal Equations direct regression method More...
 
double[] ArParameters [get]
 Fitted AR parameters (φ terms). More...
 
double[] MaParameters [get]
 Fitted MA parameters (θ terms). More...
 
double Intercept [get]
 Fitted intercept (c term). More...
 
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
double[] _diffHeads [get, set]
 "Integration" constants More...
 
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...
 

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 or not to include the intercept term

Definition at line 113 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 160 of file AutoRegressiveIntegratedMovingAverage.cs.

Member Function Documentation

◆ Reset()

override void QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.Reset ( )

Resets this indicator to its initial state

Definition at line 175 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 186 of file AutoRegressiveIntegratedMovingAverage.cs.

Here is the call graph for this function:

Member Data Documentation

◆ IsReady

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

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

Definition at line 82 of file AutoRegressiveIntegratedMovingAverage.cs.

Property Documentation

◆ HandleExceptions

bool QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.HandleExceptions = true
getset

Whether or not to handle potential exceptions, returning a zero value. I.e, the values provided as input are not valid by the Normal Equations direct regression method

Definition at line 62 of file AutoRegressiveIntegratedMovingAverage.cs.

◆ ArParameters

double [] QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.ArParameters
get

Fitted AR parameters (φ terms).

Definition at line 67 of file AutoRegressiveIntegratedMovingAverage.cs.

◆ MaParameters

double [] QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.MaParameters
get

Fitted MA parameters (θ terms).

Definition at line 72 of file AutoRegressiveIntegratedMovingAverage.cs.

◆ Intercept

double QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.Intercept
get

Fitted intercept (c term).

Definition at line 77 of file AutoRegressiveIntegratedMovingAverage.cs.

◆ 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 87 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 92 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 97 of file AutoRegressiveIntegratedMovingAverage.cs.


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