({{, (RefLink[SARIMAProcess, paclet:ref/SARIMAProcess])[{(Subscript[a, 1]),…,(Subscript[a, p])},d,{(Subscript[b, 1]),…,(Subscript[b, q])},{s,{(Subscript[α, 1]),…,(Subscript[α, m])},δ,{(Subscript[β, 1]),…,(Subscript[β, r])}},v]
represents a seasonal integrated autoregressive moving-average process with ARIMA coefficients (Subscript[a, i]), d, and (Subscript[b, j]); seasonal order s; seasonal ARIMA coefficients (Subscript[α, i]), δ, and (Subscript[β, j]); seasonal integration order δ; and normal white noise with variance v.}, {, (RefLink[SARIMAProcess, paclet:ref/SARIMAProcess])[{(Subscript[a, 1]),…,(Subscript[a, p])},d,{(Subscript[b, 1]),…,(Subscript[b, q])},{s,{(Subscript[α, 1]),…,(Subscript[α, m])},δ,{(Subscript[β, 1]),…,(Subscript[β, r])}},Σ]
represents a vector SARIMA process with coefficient matrices (Subscript[a, i]), (Subscript[b, j]), (Subscript[α, i]), and (Subscript[β, j]) and covariance matrix Σ. }, {, (RefLink[SARIMAProcess, paclet:ref/SARIMAProcess])[{(Subscript[a, 1]),…},{(Subscript[d, 1]),…},{(Subscript[b, 1]),…},{{(Subscript[s, 1]),…},{(Subscript[α, 1]),…},{(Subscript[δ, 1]),…},{(Subscript[β, 1]),…}},Σ]
represents a vector SARIMA process with multiple integration orders (Subscript[d, i]), seasonal orders (Subscript[s, j]), and seasonal integration orders (Subscript[δ, k]). }, {, (RefLink[SARIMAProcess, paclet:ref/SARIMAProcess])[{(Subscript[a, 1]),…,(Subscript[a, p])},d,{(Subscript[b, 1]),…,(Subscript[b, q])},{s,{(Subscript[α, 1]),…,(Subscript[α, m])},δ,{(Subscript[β, 1]),…,(Subscript[β, r])}},v,init]
represents a SARIMA process with initial data init. }, {, (RefLink[SARIMAProcess, paclet:ref/SARIMAProcess])[c,…]
represents a SARIMA process with constant c.}})

OpenersNotesSection(Spacer1)Details

(RefLink[SARIMAProcess, paclet:ref/SARIMAProcess]) is a discrete-time and continuous-state random process.

The SARIMA process is effectively the composition of an ARIMA process and a seasonal version of an ARIMA process.

The SARIMA process is described by the difference equation (1-(Subscript[a, 1]) (Subscript[\[DiscreteShift], {t,-1}])-⋯-(Subscript[a, p]) (Subscript[\[DiscreteShift], {t,-p}]))(1-(Subscript[α, 1]) (Subscript[\[DiscreteShift], {t,-s}])-⋯-(Subscript[α, m]) (Subscript[\[DiscreteShift], {t,-m s}]))(((1-(Subscript[\[DiscreteShift], {t,-1}])))^d) (((1-(Subscript[\[DiscreteShift], {t,-s}])))^δ)y(t)==c+z(t) , with z(t)==(1+(Subscript[b, 1]) (Subscript[\[DiscreteShift], {t,-1}])+⋯+(Subscript[b, q]) (Subscript[\[DiscreteShift], {t,-q}]))(1+(Subscript[β, 1]) (Subscript[\[DiscreteShift], {t,-s}])+⋯+(Subscript[β, r]) (Subscript[\[DiscreteShift], {t,-r s}]))e(t) , where y(t) is the state output, e(t) is white noise input, \[DiscreteShift] is the shift operator, and the constant c is taken to be zero if not specified.

The initial data init can be given as a list {…,y[-2],y[-1]} or a single-path (RefLink[TemporalData, paclet:ref/TemporalData]) object with time stamps understood as {…,-2,-1}.

A scalar SARIMA process should have real coefficients (Subscript[a, i]), (Subscript[b, j]), (Subscript[α, i]), (Subscript[β, j]), and c, positive integer seasonality order s, non-negative integer integration orders d and δ, and a positive variance v.

An n-dimensional vector SARIMA process should have real coefficient matrices (Subscript[a, i]), (Subscript[b, j]), (Subscript[α, i]), and (Subscript[β, j]) of dimensions n×n; vector c of length n; positive integer seasonality orders (Subscript[s, i]) or s; non-negative integer integration orders (Subscript[d, i]) or d, as well as (Subscript[δ, i]) or δ; and symmetric positive definite covariance matrix Σ of dimension n×n.

The SARIMA process with zero constant has transfer function ((i((z^(-1))))^(-1)).α((((z^(-s))))^(-1)).((a((z^(-1))))^(-1)).b((z^(-1))).β((z^(-s))), where a(z)==(Subscript[𝟙, n])-(Subscript[a, 1]) z-⋯-(Subscript[a, p]) (z^p), b(z)==(Subscript[𝟙, n])+(Subscript[b, 1]) z+⋯+(Subscript[b, q]) (z^q), α(z)==(Subscript[𝟙, n])-(Subscript[α, 1]) z-⋯-(Subscript[α, m]) (z^m), β(z)==(Subscript[𝟙, n])+(Subscript[β, 1]) z+⋯+(Subscript[β, r]) (z^r), i(z)=((((Subscript[𝟙, n])-z))^d)((((Subscript[𝟙, n])-(z^s)))^δ), and (Subscript[𝟙, n]) is an n-dimensional unit.

(RefLink[SARIMAProcess, paclet:ref/SARIMAProcess])[p,d,q,{s,sp,sd,sq}] represents a SARIMA process with autoregressive and moving-average orders p and q and integration order d, their seasonal counterparts sp, sq, and sd, and seasonality s for use in (RefLink[EstimatedProcess, paclet:ref/EstimatedProcess]) and related functions.

(RefLink[SARIMAProcess, paclet:ref/SARIMAProcess]) can be used with such functions as (RefLink[CovarianceFunction, paclet:ref/CovarianceFunction]), (RefLink[RandomFunction, paclet:ref/RandomFunction]), and (RefLink[TimeSeriesForecast, paclet:ref/TimeSeriesForecast]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (47)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Simulate a SARIMA process:

sample=RandomFunction[SARIMAProcess[.3,{.3},1,{.2},{12,{.4},3,{.2}},1],{1,10^2}]

ListPlot[sample,Filling->Axis]

Simulate SARIMA with seasonal trend:

sample=RandomFunction[SARIMAProcess[.4,{.3},0,{.2},{12,{.4},2,{.2}},1],{1,10^2}]

ListPlot[sample,Filling->Axis]

Simulate SARIMA with linear trend:

sample=RandomFunction[SARIMAProcess[.1,{.3},1,{.2},{12,{.4},0,{.2}},1],{1,10^2}]

ListPlot[sample,Filling->Axis]

OpenersExampleSection1(Spacer1)Scope  (28)

OpenersExampleSubsection0(Spacer1)Basic Uses  (9)

Simulate an ensemble of paths:

data=RandomFunction[SARIMAProcess[1,{.5},0,{.3},{12,{.5},1,{.1}},1],{50},4]

ListLinePlot[data,Filling->Axis]

Simulate with given precision:

RandomFunction[SARIMAProcess[1,{2/10,1/10},1,{2/7},{12,{2/10},2,{2}},1/10],{1,4},WorkingPrecision->20]["Path"]

Simulate a scalar process with different seasonalities:

sample[s_]:=(SeedRandom[3];RandomFunction[SARIMAProcess[{},1,{},{s,{},1,{}},.1],{1,10^2}]);

Sample paths for positive and negative values of the parameter:

ListPlot[sample[#],Filling->Axis,PlotLabel->StringJoin["seasonality = ", ToString[#]]]&/@{4,12}

Simulate a process with given initial values:

sproc[x_]:=SARIMAProcess[0,{.4},0,{.3},{4,{.6},1,{-.2}},1,{x}];

pts={-4,0,4,8};

samples=Table[SeedRandom[4];RandomFunction[sproc[x],{50}],{x,pts}];

ListLinePlot[samples,DataRange->{0,12},PlotLegends->(StringJoin["x = " ,ToString[#]]&/@pts)]

A process with both linear and seasonal trend:

tproc[x_]:=SARIMAProcess[.3,{.9},1,{.3},{4,{1.1},1,{-.2}},1,{x}];

tsamples=Table[SeedRandom[4];RandomFunction[tproc[x],{30}],{x,pts}];

ListLinePlot[tsamples,DataRange->{0,12},PlotLegends->(StringJoin["x = " ,ToString[#]]&/@pts)]

Simulate a two-dimensional process:

α={{.2,.1},{-.3,.2}};
β={{.2,.5},{-.2,.9}};
Σ={{1,0},{0,.3}};
SeedRandom[4];sample=RandomFunction[SARIMAProcess[{},1,{β},{12,{α},1,{}},Σ],{1,10^2}];

Create a 2D sample path function from the data:

s=TimeSeries[sample,ResamplingMethod->Automatic];
f=s["PathFunction"];
g[t_?NumericQ]:=f[t]

The color of the path is the function of time:

ParametricPlot[g[t],{t,1,100},ColorFunction->Function[{x,y,t},(ColorData["BlueGreenYellow"][t])],PlotStyle->Thick,AspectRatio->1,AxesLabel->{x,y}]

Create a 3D sample path function with time:

gg[t_?NumericQ]:=Join[{t},f[t]]

The color of the path is the function of time:

ParametricPlot3D[gg[t],{t,1,100},ColorFunction->Function[{t,x,y},(ColorData["BlueGreenYellow"][t])],PlotStyle->Thick,BoxRatios->1,AxesLabel->{t,x,y}]

Simulate a three-dimensional process:

α={{.2,.1,.1},{-.3,.2,.1},{-.3,.2,-.1}};
β={{.2,.5,.1},{-.2,.9,.5},{.3,.1,-.4}};
Σ={{1,0,0},{0,.3,0},{0,0,.1}};
SeedRandom[4];sample=RandomFunction[SARIMAProcess[{},1,{β},{12,{α},1,{}},Σ],{1,10^2}];

Create a sample path function from the data:

s=TimeSeries[sample,ResamplingMethod->Automatic];
f=s["PathFunction"];
g[t_?NumericQ]:=f[t]

The color of the path is the function of time:

ParametricPlot3D[g[t],{t,1,100},ColorFunction->Function[{x,y,z,t},(ColorData["BlueGreenYellow"][t])],PlotStyle->Thick,BoxRatios->1,AxesLabel->{x,y,z}]

Estimate process parameters:

sample=RandomFunction[SARIMAProcess[.3,{.1},0,{.2},{4,{.3},1,{.4}},.1],{1,100}];

Find model parameters:

eproc=EstimatedProcess[sample,SARIMAProcess[1,1,{4,1,1}]]

Use (RefLink[TimeSeriesModel, paclet:ref/TimeSeriesModel]) to automatically find orders:

tsm=TimeSeriesModelFit[sample,"SARIMA"]

tsm["BestFit"]

Forecast future values:

proc=SARIMAProcess[.3,{.1,.4},0,{-.3},{4,{.2},2,{2}},.1];
sample=RandomFunction[proc,{1,50}];

Find the forecast for the next 20 steps:

forecast=TimeSeriesForecast[proc,sample,{20}]

Show the forecast path of the forecast:

forecast["Path"]

Plot the data and the forecasted values:

ListLinePlot[{sample,forecast},InterpolationOrder->0,Filling->Axis]

Find a forecast for a vector-valued time series process:

proc=SARIMAProcess[{1,2},{{{.2,.1},{.5,.3}}},0,{{{.9,.3},{-.3,.5}}},{6,{{{-.7,.2},{.3,.4}}},{1,0},{{{.8,.1},{.3,-.2}}}},{{1,.3},{.3,.5}}];
data=RandomFunction[proc,{0,30}];

Find the forecast for the next 15 steps:

forecast=TimeSeriesForecast[proc,data,{15}]

Plot the data and the forecast for each component:

Row@Table[ListLinePlot[#["PathComponent",j]&/@{data,forecast},PlotLabel->(Subscript[x, j]),PlotLegends->{"data","forecast"}],{j,1,2}]

OpenersExampleSubsection1(Spacer1)Stationarity and Invertibility  (4)

Check if a time series is weakly stationary:

WeakStationarity[SARIMAProcess[.4,{1,2},1,{3},{12,{},0,{.3}},1,{}]]

For a vector process:

WeakStationarity[SARIMAProcess[{{{.3,.2},{-.4,.1}}},1,{{{-.5,.2},{0,.4}}},{12,{{{.4,.2},{-.6,.2}}},1,{{{.3,.6},{.9,.8}}}},{{1,.4},{.4,.8}}]]

Find conditions for a process to be weakly stationary:

WeakStationarity[SARIMAProcess[c,{(Subscript[a, 1]),(Subscript[a, 2])},d,{(Subscript[b, 1])},{s,{(Subscript[g, 1]),(Subscript[g, 2])},sd,{(Subscript[h, 1])}},(σ^2)]]

Check if a time series is invertible:

proc=SARIMAProcess[.2,{1/3},1,{1,2},{12,{.3},1,{.1}},1];

TimeSeriesInvertibility[proc]

Find its invertible representation:

ToInvertibleTimeSeries[proc]

For a vector process:

TimeSeriesInvertibility[SARIMAProcess[{{{.3,.2},{-.4,.1}}},1,{{{-.5,.2},{0,.4}}},{12,{{{.4,.2},{-.6,.2}}},1,{{{.3,.6},{.2,.8}}}},{{1,.4},{.4,.8}}]]

Find invertibility conditions:

TimeSeriesInvertibility[SARIMAProcess[c,{(Subscript[a, 1])},d,{(Subscript[b, 1]),(Subscript[b, 2])},{s,{(Subscript[g, 1])},sd,{(Subscript[h, 1])}},(σ^2)]]

OpenersExampleSubsection2(Spacer1)Estimation Methods  (5)

The available methods for estimating a (RefLink[SARIMAProcess, paclet:ref/SARIMAProcess]):

methods={Automatic,"MethodOfMoments","MaximumConditionalLikelihood","MaximumLikelihood","SpectralEstimator"};

SeedRandom[11];
data=RandomFunction[SARIMAProcess[{.4},1,{.3},{3,{.2},1,{}},1],{100}];

Grid[res=Table[{m,Quiet@EstimatedProcess[data,SARIMAProcess[1,1,{3,1,0}],ProcessEstimator->m]},{m,methods}],Frame->All,Spacings->{1,2},Alignment->{Left,Center}]

Method of moments admits the following solvers:

solvers={Automatic,"FindRoot"};

SeedRandom[1341];
data=RandomFunction[SARIMAProcess[.2,{.1},1,{.1},{4,{.2},1,{}},1],{300}];

Grid[Table[{m,Quiet@EstimatedProcess[data,SARIMAProcess[1,1,{4,1,0}],ProcessEstimator->{"MethodOfMoments",Method->m}]},{m,solvers}],Frame->All,Spacings->{1,2},Alignment->{Left,Center}]

This method allows for fixed parameters:

EstimatedProcess[data,SARIMAProcess[c,{.4,b},d,{.1},{3,{.2},1,{w}},v],ProcessEstimator->"MethodOfMoments"]

Some relations between parameters are also permitted:

EstimatedProcess[data,SARIMAProcess[c,{a+b,b},d,{a},{3,{b},q,{b}},v],ProcessEstimator->"MethodOfMoments"]

Maximum conditional likelihood method allows the following solvers:

solvers={Automatic,"FindMaximum","NMaximize"};

SeedRandom[14];
data=RandomFunction[SARIMAProcess[2,{.4},1,{.3},{3,{.2},1,{.1}},1],{100}];

Grid[Table[{m,Quiet@EstimatedProcess[data,SARIMAProcess[1,1,{3,1,1}],ProcessEstimator->{"MaximumConditionalLikelihood",Method->m}]},{m,solvers}],Frame->All,Spacings->{1,2},Alignment->{Left,Center}]

This method allows for fixed parameters:

EstimatedProcess[data,SARIMAProcess[c,{.1},d,{m},{3,{.2},q,{r}},v],ProcessEstimator->"MaximumConditionalLikelihood"]

Some relations between parameters are also permitted:

EstimatedProcess[data,SARIMAProcess[c,{b,b},d,{m},{3,{b},q,{w}},v],ProcessEstimator->"MaximumConditionalLikelihood"]

Maximum likelihood method allows the following solvers:

solvers={Automatic,"FindMaximum","NMaximize"};

SeedRandom[114];
data=RandomFunction[SARIMAProcess[2,{.4},1,{.3},{3,{.2},1,{}},1],{100}];

Grid[Table[{m,Quiet@EstimatedProcess[data,SARIMAProcess[1,1,{3,1,0}],ProcessEstimator->{"MaximumLikelihood",Method->m}]},{m,solvers}],Frame->All,Spacings->{1,2},Alignment->{Left,Center}]

This method allows for fixed parameters:

EstimatedProcess[data,SARIMAProcess[c,{b},d,{.3},{3,{.2},q,{w}},v],ProcessEstimator->"MaximumLikelihood"]

Some relations between parameters are also permitted:

EstimatedProcess[data,SARIMAProcess[c,{b,b},d,{m},{3,{b},q,{w}},v],ProcessEstimator->"MaximumLikelihood"]

Spectral estimator allows you to specify windows used for (RefLink[PowerSpectralDensity, paclet:ref/PowerSpectralDensity]) calculation:

SeedRandom[214];
data=RandomFunction[SARIMAProcess[2,{},1,{.3},{3,{.2},1,{}},1],{100}];

Grid[Table[{m,EstimatedProcess[data,SARIMAProcess[0,1,{3,1,0}],ProcessEstimator->{"SpectralEstimator", "Window"->m}]},{m,{10,BartlettWindow,{3,HannWindow}}}],Frame->All,Spacings->{1,2},Alignment->{Left,Center}]

Spectral estimator allows the following solvers:

solvers={Automatic,"FindMinimum","NMinimize"};

Grid[Table[{m,EstimatedProcess[data,SARIMAProcess[0,1,{3,1,0}],ProcessEstimator->{"SpectralEstimator",Method->m}]},{m,solvers}],Frame->All,Spacings->{1,2},Alignment->{Left,Center}]

This method allows for fixed parameters:

EstimatedProcess[data,SARIMAProcess[c,{.1,b},d,{m},{3,{.2},q,{w}},v],ProcessEstimator->"SpectralEstimator"]

Some relations between parameters are also permitted:

EstimatedProcess[data,SARIMAProcess[c,{b,b},d,{m},{3,{b},q,{}},v],ProcessEstimator->"SpectralEstimator"]

OpenersExampleSubsection3(Spacer1)Process Slice Properties  (5)

Single time (RefLink[SliceDistribution, paclet:ref/SliceDistribution]):

Mean@SARIMAProcess[1,{.2},1,{.3},{4,{},1,{.1}},1][2]

Multiple time slice distributions:

Mean@SARIMAProcess[1,{.2},1,{.3},{4,{},1,{.1}},1,{}][{1,3}]

Slice distribution of a vector-valued time series:

α={{.1,.2},{0.,-.3}};
β={{.3,0.},{.9,-.2}};
γ={{.2,.1},{0.,-.1}};
δ={{0.,.1},{-.1,.2}};
Σ={{1,0},{0,1}};
Mean@SARIMAProcess[{α},{1,2},{β},{3,{γ},{0,1},{δ}},Σ][t]

First-order stationary probability density function:

pdf:=PDF[SARIMAProcess[1,{.4},1,{.3},{4,{.6},1,{.1}},1,{}][t],x]

times=Table[i,{i,1,4}];

Plot[Evaluate@Table[pdf,{t,times}],{x,-3,33},Filling->Axis,PlotLegends->(StringJoin["t = ",ToString@#]&/@times)]

Compute the expectation of an expression:

Expectation[x[4]^2,x\[Distributed]SARIMAProcess[{.2},1,{.3},{4,{},1,{.1}},1]]

Calculate a probability:

Probability[x[7]<6,x\[Distributed]SARIMAProcess[1,{.2},1,{.3},{4,{},1,{.1}},1]]

Skewness and kurtosis:

Skewness[SARIMAProcess[{.2},1,{.3},{4,{},1,{.1}},1][t]]

Kurtosis[SARIMAProcess[{.2},1,{.3},{4,{},1,{.1}},1][t]]

Moment of order r:

Moment[SARIMAProcess[{.2},1,{.3},{4,{},1,{.1}},1][3],r]

Generating functions:

CharacteristicFunction[SARIMAProcess[{.2},1,{.3},{4,{},1,{.1}},1][3],w]

MomentGeneratingFunction[SARIMAProcess[{.2},1,{.3},{4,{},1,{.1}},1][3],w]

(RefLink[CentralMoment, paclet:ref/CentralMoment]) and its generating function:

CentralMoment[SARIMAProcess[{.2},1,{.3},{4,{},1,{.1}},1][3],r]

CentralMomentGeneratingFunction[SARIMAProcess[{.2},1,{.3},{4,{},1,{.1}},1][3],w]

(RefLink[FactorialMoment, paclet:ref/FactorialMoment]) and its generating function:

Table[FactorialMoment[SARIMAProcess[{.2},1,{.3},{4,{},1,{.1}},1][3],r],{r,0,4}]

FactorialMomentGeneratingFunction[SARIMAProcess[{.2},1,{.3},{4,{},1,{.1}},1][3],w]

(RefLink[Cumulant, paclet:ref/Cumulant]) and its generating function:

Cumulant[SARIMAProcess[{.2},1,{.3},{4,{},1,{.1}},1][3],r]

CumulantGeneratingFunction[SARIMAProcess[{.2},1,{.3},{4,{},1,{.1}},1][3],w]

OpenersExampleSubsection4(Spacer1)Representations  (5)

Approximate with an (RefLink[ARProcess, paclet:ref/ARProcess]):

proc=SARIMAProcess[.1,{.2,-.3},1,{.6,.2},{12,{.3},1,{}},1,{}];
aproc=ARProcess[proc,30]

Compare random paths:

SeedRandom[13];sample=RandomFunction[proc,{100}];
SeedRandom[13];asample=RandomFunction[aproc,{100}];
ListLinePlot[{sample,asample},PlotLegends->{"SARIMA","AR"}]

For a vector process:

proc=SARIMAProcess[{1,2},{{{.2,.1},{.5,.3}}},{2,0},{{{.9,.3},{-.3,.5}}},{4,{{{-.7,.2},{.3,.4}}},1,{{{.8,.1},{.3,-.2}}}},{{1,.3},{.3,.5}}];

ARProcess[proc,3]

Approximate with an (RefLink[MAProcess, paclet:ref/MAProcess]):

proc=SARIMAProcess[{.2,-.3,-.1},1,{.6,.2},{12,{.3},1,{}},1,{}];
aproc=MAProcess[proc,40]

Compare random paths:

SeedRandom[13];sample=RandomFunction[proc,{100}];
SeedRandom[13];asample=RandomFunction[aproc,{100}];
ListLinePlot[{sample,asample},PlotLegends->{"SARIMA","MA"}]

For a vector process:

proc=SARIMAProcess[{1,2},{{{.2,.1},{.5,.3}}},{2,0},{{{.9,.3},{-.3,.5}}},{4,{{{-.7,.2},{.3,.4}}},1,{{{.8,.1},{.3,-.2}}}},{{1,.3},{.3,.5}}];

MAProcess[proc,3]

Represent as equivalent (RefLink[ARMAProcess, paclet:ref/ARMAProcess]):

proc=SARIMAProcess[1,{1/3,1/4},1,{1/2,1/3},{12,{1/3},1,{}},1];
aproc=ARMAProcess[proc]

(RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel]) representation:

TransferFunctionModel[SARIMAProcess[{a},1,{b},{12,{},1,{h}},(σ^2)],z]

For a vector-valued process:

α={{.2,.3},{0,.1}};
β={{-.3,0},{.5,-.4}};
Σ={{1,0},{0,1}};
TransferFunctionModel[SARIMAProcess[{},0,{α},{4,{β},1,{}},Σ],z]

(RefLink[StateSpaceModel, paclet:ref/StateSpaceModel]) representation:

StateSpaceModel[SARIMAProcess[{a},1,{b},{4,{g},1,{h}},1]]

For a vector-valued process:

α={{.2,.3},{0,.1}};
β={{-.3,.1},{.5,-.4}};
Σ={{1,0},{0,1}};
StateSpaceModel[SARIMAProcess[{},1,{α},{3,{β},1,{}},Σ]]

OpenersExampleSection3(Spacer1)Applications  (4)

OpenersExampleSubsubsection0(Spacer1)Weather Data  (1)

Average temperature on the first day of a month in Chicago, IL:

temp=TimeSeries[];

temp["Source"]

DateListPlot[temp,Joined->True]

Fit a SARIMA process:

eproc=EstimatedProcess[temp, SARIMAProcess[1,0,0,{12,2,1,1}]]

Forecast the average temperatures on the first day of a month for the next three years:

forecast=TimeSeriesForecast[eproc,temp,{3*12}];

DateListPlot[{temp,forecast},Joined->True]

OpenersExampleSubsubsection1(Spacer1)Airline Passengers  (2)

The following data contains the monthly total number of US international airline passengers (in thousands) from January, 1949 to December, 1960:

passengers=ExampleData[{"Statistics","InternationalAirlinePassengers"},"TimeSeries"]

DateListPlot[passengers,Joined->True]

Find a time series model:

tsm=TimeSeriesModelFit[passengers,{"SARIMA",12}]

tsm["Process"]

Forecast for the next five years:

k=5;
start="December 1st, 1960";

forecastDates=DateRange[start,DatePlus[start,{k,"Year"}],"Month"];

forecast=tsm/@forecastDates;

Calculate prediction bands:

bands=tsm["PredictionLimits"][#]&/@forecastDates;

Plot a forecast within a 95% confidence interval:

pforecast=DateListPlot[{bands[[All,1]],forecast,bands[[All,2]]},{start,Automatic,"Month"},Joined->True,Filling->{1->{3}},PlotStyle->{Directive[{Dashed,Gray}],Automatic,Directive[{Dashed,Gray}]}]

Use a simulation to forecast the number of passengers:

passengers=ExampleData[{"Statistics","InternationalAirlinePassengers"},"TimeSeries"]

The fitted model:

tsm=TimeSeriesModelFit[passengers,{"SARIMA",12}]

Simulate the next five years:

k=5;
sim=RandomFunction[tsm,{0,12*k},100];

psim=DateListPlot[sim,PlotStyle->Directive[Opacity[.25]],Joined->True,PlotRange->All]

Find the mean function of the simulated paths:

smean=TimeSeriesThread[Mean,sim]

Show[psim,DateListPlot[smean,PlotStyle->Black,Joined->True]]

OpenersExampleSubsubsection2(Spacer1)Retail Sales  (1)

Use (RefLink[SARIMAProcess, paclet:ref/SARIMAProcess]) to model seasonal data of monthly retail sales in the United States:

raw=WolframAlpha["usa retail sales",{{"History:RetailSales:EconomicData",1},"TimeSeriesData"}];

raw[[1]]

Create (RefLink[TimeSeries, paclet:ref/TimeSeries]) from the selection:

data=TimeSeries[{QuantityMagnitude[raw[[-12*15;;,2]]]},{Automatic,raw[[-1,1]],"Month"}]

Plot the sales with grid lines at December peaks:

grids=Table[{1992,12 i},{i,data["PathLength"]}];
DateListPlot[data,GridLines->{grids,None},AspectRatio->1/3]

Fit a seasonal model:

model=TimeSeriesModelFit[data,{"SARIMA",12}]

The process parameters:

proc=model["BestFit"]

Find forecast for the next seven years:

forecast=TimeSeriesForecast[model,{0,7*12}]

Calculate 95% confidence bands for the forecast:

α=.95;
q=Quantile[NormalDistribution[],1-(1-α)/2];
err=forecast["MeanSquaredErrors"];
bands=TimeSeriesThread[{{1,-q}.#,{1,q}.#}&,{forecast,Sqrt[err]}]

There is an upper and a lower band:

bands["ValueDimensions"]

Plot the forecast within the 95% confidence region:

grids=Table[{1992,12 i},{i,data["PathLength"]+forecast["PathLength"]}];

DateListPlot[{data,forecast,bands["PathComponent",1],bands["PathComponent",2]},Filling->{3->{4}},AspectRatio->1/3,PlotStyle->{Automatic,Automatic,Gray,Gray},GridLines->{grids,None}]

OpenersExampleSection4(Spacer1)Properties & Relations  (6)

(RefLink[SARIMAProcess, paclet:ref/SARIMAProcess]) is a generalization of an (RefLink[ARIMAProcess, paclet:ref/ARIMAProcess]):

TransferFunctionModel[SARIMAProcess[{1/2},2,{3},{1,{1/3},3,{2}},1],z]

TransferFunctionModel[ARIMAProcess[{5/6,-1/6},5,{5,6},1],z]

FullSimplify[%-%%]

(RefLink[SARIMAProcess, paclet:ref/SARIMAProcess]) is a generalization of a (RefLink[SARMAProcess, paclet:ref/SARMAProcess]):

TransferFunctionModel[SARIMAProcess[{a},0,{b},{12,{g},0,{h}},(σ^2)],z]

TransferFunctionModel[SARMAProcess[{a},{b},{12,{g},{h}},(σ^2)],z]

FullSimplify[%-%%]

(RefLink[SARIMAProcess, paclet:ref/SARIMAProcess]) is a generalization of an (RefLink[ARMAProcess, paclet:ref/ARMAProcess]):

TransferFunctionModel[SARIMAProcess[{a},0,{b},{1,{h},0,{h}},(σ^2)],z]

TransferFunctionModel[ARMAProcess[{a+h,-a h},{b+h,b h},(σ^2)],z]//Simplify

Simplify[%-%%]

(RefLink[SARIMAProcess, paclet:ref/SARIMAProcess]) is a generalization of an (RefLink[ARProcess, paclet:ref/ARProcess]):

TransferFunctionModel[SARIMAProcess[{a},0,{},{1,{g},0,{}},(σ^2)],z]

TransferFunctionModel[ARProcess[{a+g,-a g},(σ^2)],z]

Simplify[%-%%]

(RefLink[SARIMAProcess, paclet:ref/SARIMAProcess]) is a generalization of an (RefLink[MAProcess, paclet:ref/MAProcess]):

TransferFunctionModel[SARIMAProcess[{},0,{b},{1,{},0,{h}},(σ^2)],z]

TransferFunctionModel[MAProcess[{b+h,b h},(σ^2)],z]

Simplify[%-%%]

Compare integration orders:

sarima1=SARIMAProcess[{},0,{},{4,{},1,{}},1];
sarima2=SARIMAProcess[{},1,{},{4,{},0,{}},1];
sarima3=SARIMAProcess[{},1,{},{4,{},1,{}},1];

Create random samples for each process:

samples=Table[SeedRandom[3];RandomFunction[s,{100}],{s,{sarima1,sarima2,sarima3}}];

Plot samples with various integrations:

ListLinePlot[samples,PlotLegends->{seasonal,serial,both}]

OpenersExampleSection5(Spacer1)Possible Issues  (4)

Multi-time-slice properties may not evaluate for symbolic time stamps:

Correlation[SARIMAProcess[{1/2},1,{},{3,{},1,{1/4}},1][{(Subscript[t, 1]),(Subscript[t, 2]),(Subscript[t, 3])}]]

Correlation[SARIMAProcess[{1/2},1,{},{3,{},1,{1/4}},1][{1,4,9}]]

Some properties are defined only for weakly stationary processes:

CovarianceFunction[SARIMAProcess[{2},{.2},1,{3,{.1},1,{.3}},1],h]

Use (RefLink[FindInstance, paclet:ref/FindInstance]) to find a weakly stationary process:

{inst}=FindInstance[a>0&&WeakStationarity[SARIMAProcess[{a},d,{.2},{3,{.1},sd,{.3}},1]],{a,d,sd}]

CovarianceFunction[SARIMAProcess[{a},d,{.2},{3,{.1},sd,{.3}},1]/.inst,h]

Slice distribution properties with inexact parameters may be ill-conditioned for symbolic times:

var[t_]=Variance[SARIMAProcess[{.4},1,{},{4,{.6},1,{}},1,{}][t]];

The negative result is incorrect:

var[2]

Use numeric times:

Variance[SARIMAProcess[{.4},1,{},{4,{.6},1,{}},1,{}][2]]

Or use exact values of parameters:

v[t_]=Variance[SARIMAProcess[{4/10},1,{},{4,{6/10},1,{}},1,{}][t]];

v[2]

N[%]

(RefLink[ToInvertibleTimeSeries, paclet:ref/ToInvertibleTimeSeries]) does not always exist:

ToInvertibleTimeSeries[SARIMAProcess[{.2},1,{.3,1},{12,{.2},1,{.3,1}},.2]]

There are zeros of (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel]) lying on the unit circle:

TransferFunctionZeros[TransferFunctionModel[SARIMAProcess[{.2},1,{.3,1},{12,{.2},1,{.3,1}},.2]]]

Abs[%]

OpenersExampleSection6(Spacer1)Neat Examples  (2)

Simulate a three-dimensional (RefLink[SARIMAProcess, paclet:ref/SARIMAProcess]):

A={{.2,.1,.1},{0,-.2,.3},{.2,-.1,.3}};
B={{.4,.2,0},{-.2,.8,-.3},{0,.2,0}};
S={{.8,.1,-.2},{.1,.5,.1},{-.2,.1,.3}};
proc=SARIMAProcess[{},1,{},{12,{A},3,{B}},S];
data=RandomFunction[proc,{100},k=12]["ValueList"];

Graphics3D@Table[{ColorData["SolarColors"][RandomReal[]],Tube@Line@data[[i]]},{i,k}]

Simulate paths from a SARIMA process:

SeedRandom[154];data=RandomFunction[SARIMAProcess[{.3},0,{.6},{6,{.7},1,{.4}},1],{50},200];

Take a slice at 50 and visualize its distribution:

sd=data["SliceData",50];

cf=ColorData["Rainbow"];
sliced=BarChart[Last[#],Axes->False,BarOrigin->Left,AspectRatio->4,ChartStyle->(cf/@Rescale[MovingAverage[First[#],2],{Min[sd],Max[sd]},{0,1}]),ImageSize->65]&[HistogramList[sd,{Range[Min[sd],Max[sd],(Max[sd]-Min[sd])/20]}]];

Plot paths and histogram distribution of the slice distribution at 50:

ListLinePlot[data,ImageSize->400,PlotRange->All,
AspectRatio->3/4,Epilog->Inset[sliced,{51,0},{0,10.5}],PlotStyle->(cf/@Rescale[sd]),BaseStyle->Directive[Thin,Opacity[0.5]],PlotRangePadding->{{0,15},{.5,.5}}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[SARMAProcess, paclet:ref/SARMAProcess])  ▪  (RefLink[ARMAProcess, paclet:ref/ARMAProcess])  ▪  (RefLink[ARIMAProcess, paclet:ref/ARIMAProcess])  ▪  (RefLink[FARIMAProcess, paclet:ref/FARIMAProcess])  ▪  (RefLink[ARProcess, paclet:ref/ARProcess])  ▪  (RefLink[MAProcess, paclet:ref/MAProcess])  ▪  (RefLink[TimeSeriesModelFit, paclet:ref/TimeSeriesModelFit])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Time Series Processes, paclet:guide/TimeSeriesProcesses])}, {▪(RefLinkPlain[Scientific Models, paclet:guide/ScientificModels])}, {▪(RefLinkPlain[Random Processes, paclet:guide/RandomProcesses])}})}})