TimeSeriesModelFit

TimeSeriesModelFit[data]
constructs a time series model for data from an automatically selected model family.

TimeSeriesModelFit[data,mspec]
constructs a time series model for data from a model family specified by mspec.

Details and OptionsDetails and Options

  • TimeSeriesModelFit is used in time series analysis. It automates the selection of a time series model from a large class of possible models.
  • TimeSeriesModelFit returns a symbolic TimeSeriesModel object to represent the time series model it constructs. The properties and diagnostics of the model can be obtained from model[property].
  • A list of available model properties can be obtained using model["Properties"].
  • The data can be a list of numeric values , a list of time-value pairs , a TimeSeries, or TemporalData.
  • The value of the model at time t can be obtained by giving . If t is in the range of the input data then the data at time t is returned; otherwise a forecasted value is given.
  • Forecast prediction limits at a time t can be obtained using .
  • The model specification mspec can take the following forms:
  • Automaticautomatically select the model to use
    "family"select a model from a given family
    {"family",params}select a model from a subset within a given family
  • The following families and parameterizations can be used:
  • "AR"{p}autoregressive model family
    "MA"{q}moving-average model family
    "ARMA"{p,q}autoregressive moving-average model family
    "ARIMA"{p,d,q}integrated ARMA model family
    "SARMA"{{p,q},{sp,sq},s}seasonal ARMA model family
    "SARIMA"{{p,d,q},{sp,sd,sq},s}seasonal ARIMA model family
    "ARCH"{q}ARCH model family
    "GARCH"{q,p}GARCH model family
  • Autoregressive and moving-average orders p and q and their seasonal counterparts sp and sq can be given as Automatic, a non-negative integer, a list of non-negative integers, or a Span indicating such a list.
  • The non-seasonal and seasonal integration orders d and sd can be given as Automatic, a non-negative integer, a list of non-negative integers, or a Span indicating such a list.
  • For seasonal models, the seasonality parameter s can be Automatic or a positive integer.
  • Additional model family parameterizations are given in the examples.
  • The following model properties can be obtained using model["property"]:
  • "BestFit"the fitted model
    "BestFitParameters"coefficient estimates
    "ErrorVariance"model error variance
    "FitResiduals"residuals for the fitted model
    "StandardizedResiduals"standardized model residuals
    "TemporalData"input data as TemporalData
  • Properties pertaining to model selection include:
  • "CandidateModels"a set of candidate models sorted by selection criterion
    "CandidateModelSelectionValues"selection criterion values for each candidate model
    "CandidateSelectionTable"a table containing models and selection criterion values
    "CandidateSelectionTableEntries"entries from the candidate selection table
    "ModelFamily"the selected model family
    "SelectionCriterion"criterion used for selecting the best model
  • Properties that measure goodness of fit include:
  • "AIC"Akaike information criterion
    "AICc"finite sample corrected AIC
    "BIC"Bayesian information criterion
    "SBC"SchwartzBayes information criterion
  • The following properties can be used to assess the whiteness of the model residuals:
  • "ACFPlot"plot of residual autocorrelations
    "ACFValues"values from the
    "PACFPlot"plot of residual partial autocorrelations
    "PACFValues"values from the
    "LjungBoxPlot"plot of LjungBox residual autocorrelation test -values
    "LjungBoxValues"values from the
  • The maximum number of lags to include for a residual whiteness property can be controlled by giving , where max is a positive integer.
  • Properties and diagnostics for coefficient estimates include:
  • "CovarianceMatrix"covariance estimate for model coefficients
    "InformationMatrix"information matrix for model coefficients
    "ParameterConfidenceIntervals"confidence intervals about the coefficient estimates
    "ParameterStandardErrors"standard errors of model coefficients
    "ParameterTable"table of fitted coefficient information
    "ParameterTableEntries"entries in the parameter table
  • TimeSeriesModelFit takes the following options:
  • ConfidenceLevel95/100confidence level to choose
    IncludeConstantBasisAutomaticwhether to include a constant in the model
    MethodAutomaticthe method to use for model selection
    WorkingPrecisionAutomaticprecision used in internal computations
  • The default setting IncludeConstantBasis->Automatic will include a constant in the model if both the non-seasonal and seasonal integration orders are zero; otherwise no constant will be included.
  • The method m in Method->m can be either or . For stepwise selection, Automatic parameter orders are incrementally changed until a model with an optimal selection criterion is found. Using a grid search exhaustively tries all models over a specified grid.
  • The best model is selected according to a selection criterion crit, which can be set in Method->{m,"SelectionCriterion"->crit}. Some examples of valid selection criteria include (default), , , and .

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Fit a time series model to some data:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

The fitted time series model:

In[3]:=
Click for copyable input
Out[3]=

Obtain a point forecast and 95% prediction limits at time 35:

In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=

Visualize the data with a 10-step-ahead forecast:

In[6]:=
Click for copyable input
Out[6]=
Introduced in 2014
(10.0)