({{, (RefLink[SARMAProcess, paclet:ref/SARMAProcess])[{(Subscript[a, 1]),…,(Subscript[a, p])},{(Subscript[b, 1]),…,(Subscript[b, q])},{s,{(Subscript[α, 1]),…,(Subscript[α, m])},{(Subscript[β, 1]),…,(Subscript[β, r])}},v] 
represents a weakly stationary seasonal autoregressive moving-average process with ARMA coefficients (Subscript[a, i]) and (Subscript[b, j]), seasonal order s, seasonal ARMA coefficients (Subscript[α, i]) and (Subscript[β, j]), and normal white noise with variance v.}, {, (RefLink[SARMAProcess, paclet:ref/SARMAProcess])[{(Subscript[a, 1]),…,(Subscript[a, p])},{(Subscript[b, 1]),…,(Subscript[b, q])},{s,{(Subscript[α, 1]),…,(Subscript[α, m])},{(Subscript[β, 1]),…,(Subscript[β, r])}},Σ] 
represents a weakly stationary vector SARMA process driven by normal white noise, with covariance matrix Σ.}, {, (RefLink[SARMAProcess, paclet:ref/SARMAProcess])[{(Subscript[a, 1]),…,(Subscript[a, p])},{(Subscript[b, 1]),…,(Subscript[b, q])},{{(Subscript[s, 1]),…},{(Subscript[α, 1]),…,(Subscript[α, m])},{(Subscript[β, 1]),…,(Subscript[β, r])}},Σ]
represents a weakly stationary vector SARMA process with multiple seasonal orders (Subscript[s, i]).}, {, (RefLink[SARMAProcess, paclet:ref/SARMAProcess])[{(Subscript[a, 1]),…,(Subscript[a, p])},{(Subscript[b, 1]),…,(Subscript[b, q])},{s,{(Subscript[α, 1]),…,(Subscript[α, m])},{(Subscript[β, 1]),…,(Subscript[β, r])}},v,init] 
represents a SARMA process with initial data init. }, {, (RefLink[SARMAProcess, paclet:ref/SARMAProcess])[c,…]
represents a SARMA process with a constant c.}})

OpenersNotesSection(Spacer1)Details

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

The SARMA 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}]))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 SARMA process should have real coefficients (Subscript[a, i]), (Subscript[α, i]), (Subscript[b, j]), (Subscript[β, j]), and c, positive integer seasonality coefficients s, and a positive variance v.

An n-dimensional vector SARMA process should have real coefficient matrices (Subscript[a, i]), (Subscript[α, i]), (Subscript[b, j]), and (Subscript[β, j]) of dimensions n×n, real vector c of length n, integer positive seasonality constants (Subscript[s, i]) or integer positive seasonality constant s, and the covariance matrix Σ should be symmetric positive definite of dimensions n×n.

The SARMA process with zero constant has transfer function α((((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), and (Subscript[𝟙, n]) is an n-dimensional unit.

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

(RefLink[SARMAProcess, paclet:ref/SARMAProcess]) 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  (46)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Simulate a SARMA process:

SeedRandom[13];sample=RandomFunction[SARMAProcess[1,{.5},{.2},{12,{.8},{-.2}},1],{1,10^2}]

ListPlot[sample,Filling->Axis]

Covariance function:

CovarianceFunction[SARMAProcess[{},{a},{3,{},{b}},(σ^2)],s,t]

DiscretePlot3D[CovarianceFunction[SARMAProcess[{},{},{6,{.6},{4}},1.],s,t],{s,0,25},{t,0,25},ExtentSize->1/2,ColorFunction->"Rainbow"]

Correlation function:

DiscretePlot[CorrelationFunction[SARMAProcess[{.4},{1},{12,{.8},{.4}},1],h],{h,0,60},ExtentSize->1/2]

Partial correlation function:

DiscretePlot[PartialCorrelationFunction[SARMAProcess[{.4},{1},{12,{.8},{.4}},1],h],{h,1,40},ExtentSize->1/2]

OpenersExampleSection1(Spacer1)Scope  (33)

OpenersExampleSubsection0(Spacer1)Basic Uses  (9)

Simulate an ensemble of paths:

data=RandomFunction[SARMAProcess[1,{.5},{},{12,{.6},{.1}},1],{50},4]

ListLinePlot[data,Filling->Axis]

Simulate with given precision:

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

Simulate a scalar process with different seasonalities:

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

Sample paths for positive and negative values of the parameter:

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

Simulate a weakly stationary process with given initial values:

sproc[x_]:=SARMAProcess[0,{.6},{.3},{4,{.6},{-.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)]

For a process with a trend, initial values influence the behavior of the whole path:

tproc[x_]:=SARMAProcess[0,{.9},{.3},{4,{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}};
sample=RandomFunction[SARMAProcess[{α},{β},{4,{α},{}},Σ],{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])],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[SARMAProcess[{},{β},{12,{α},{}},Σ],{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[SARMAProcess[.2,{},{},{4,{.8},{.4}},1],{1,10^3}];
eproc=EstimatedProcess[sample,SARMAProcess[c,{},{},{4,{a},{b}},v]]

Compare the sample correlation functions with that of the estimated process:

Show[ListPlot[CorrelationFunction[sample,{15}],Filling->0,PlotStyle->PointSize[Medium]],DiscretePlot[CorrelationFunction[eproc,h],{h,0,15},ExtentSize->1/2]]

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

TimeSeriesModelFit[sample,"SARMA"]

bestfit=%["BestFit"]

Compare the sample covariance functions with the best time series model:

Show[ListPlot[CorrelationFunction[sample,{15}],Filling->0,PlotStyle->PointSize[Medium]],DiscretePlot[CorrelationFunction[bestfit,h],{h,0,15},ExtentSize->1/2]]

Forecast future values:

proc=SARMAProcess[.5,{.1,.4},{-.3},{4,{.6},{2}},.1];
sample=RandomFunction[proc,{1,50}];

Find the forecast for the next 20 steps:

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

Show the 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=SARMAProcess[{1,2},{{{.2,.1},{.5,.3}}},{{{.9,.3},{-.3,.5}}},{4,{{{-.7,.2},{.3,.4}}},{{{.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)Covariance and Spectrum  (5)

Closed-form correlation function for low order:

CorrelationFunction[SARMAProcess[{},{},{4,{.1},{.2}},1],h]//FullSimplify

Correlation matrix:

Correlation[SARMAProcess[{.2},{.1},{12,{.3},{.1}},1][{1,5}]]//MatrixForm

Covariance matrix:

Covariance[SARMAProcess[{-.4},{2},{4,{.9},{.2}},1][{1,5}]]//MatrixForm

Covariance function for a vector-valued process:

Σ={{((Subscript[σ, 1])^2),ρ (Subscript[σ, 1])(Subscript[σ, 2])},{ρ (Subscript[σ, 1])(Subscript[σ, 2]),((Subscript[σ, 2])^2)}};
α={{a,0},{0,b}};
β={{c,0},{0,d}};

CovarianceFunction[SARMAProcess[{α},{},{4,{β},{}},Σ],0]//MatrixForm

Power spectral density:

proc=SARMAProcess[{-.6,-.7},{.4,.3},{12,{.3,.2},{.1,.8}},1];

Plot[PowerSpectralDensity[proc,w],{w,-π,π},Filling->Axis]

PowerSpectralDensity[SARMAProcess[{a},{b},{3,{g},{h}},(σ^2)],w]

Vector (RefLink[SARMAProcess, paclet:ref/SARMAProcess]):

a={{1/9,0},{1/3,1/2}};
b={{1/3,1/4},{1/2,0}};
Σ={{1,0},{0,1}};
proc=SARMAProcess[{},{},{4,{b},{a}},Σ];

psd=PowerSpectralDensity[proc,ω];
psd//FullSimplify//MatrixForm

OpenersExampleSubsection2(Spacer1)Stationarity and Invertibility  (4)

Check if a time series is weakly stationary:

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

For a vector process:

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

Find conditions for a process to be weakly stationary:

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

Stationarity conditions depend only on the autoregressive coefficients:

WeakStationarity[SARMAProcess[{},{b},{s,{},{g}},(σ^2)]]

Check if a time series is invertible:

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

TimeSeriesInvertibility[proc]

Find its invertible representation:

ToInvertibleTimeSeries[proc]

For a vector process:

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

Find invertibility conditions:

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

OpenersExampleSubsection3(Spacer1)Estimation Methods  (5)

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

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

SeedRandom[121];
data=RandomFunction[SARMAProcess[{.4},{.3},{3,{.2},{}},1],{200}];

Grid[res=Table[{m,Quiet@EstimatedProcess[data,SARMAProcess[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[13241];
data=RandomFunction[SARMAProcess[.2,{.1},{.1},{4,{.2},{}},1],{300}];

Grid[Table[{m,Quiet@EstimatedProcess[data,SARMAProcess[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,SARMAProcess[c,{.4,b},{m},{3,{.2},{w}},v],ProcessEstimator->"MethodOfMoments"]

Some relations between parameters are also permitted:

EstimatedProcess[data,SARMAProcess[c,{a*b,b},{a},{3,{b},{w}},v],ProcessEstimator->"MethodOfMoments"]

Maximum conditional likelihood method allows the following solvers:

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

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

Grid[Table[{m,EstimatedProcess[data,SARMAProcess[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,SARMAProcess[c,{.1},{m},{3,{.2},{r}},v],ProcessEstimator->"MaximumConditionalLikelihood"]

Some relations between parameters are also permitted:

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

Maximum likelihood method allows the following solvers:

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

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

Grid[Table[{m,Quiet@EstimatedProcess[data,SARMAProcess[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,SARMAProcess[c,{b},{.3},{3,{.2},{w}},v],ProcessEstimator->"MaximumLikelihood"]

Some relations between parameters are also permitted:

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

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

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

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

Spectral estimator allows following solvers:

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

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

This method allows for fixed parameters:

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

Some relations between parameters are also permitted:

EstimatedProcess[data,SARMAProcess[c,{b,b},{m},{3,{b},{w}},v],ProcessEstimator->"SpectralEstimator"]

OpenersExampleSubsection4(Spacer1)Process Slice Properties  (5)

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

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

Multiple time slice distributions:

Mean@SARMAProcess[1,{.2},{.3},{4,{},{.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@SARMAProcess[{α},{β},{3,{γ},{δ}},Σ][t]

First-order stationary probability density function:

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

times=Table[i,{i,1,13,3}];

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

Stationary mean and variance:

μ=Mean[SARMAProcess[1,{.4},{.3},{4,{.6},{.1}},1][∞]]

v=Variance[SARMAProcess[{.4},{.3},{4,{.6},{.1}},1][∞]]

Compare with the density function of a normal distribution:

PDF[NormalDistribution[μ,Sqrt[v]],x]

FullSimplify[%-PDF[SARMAProcess[1,{.4},{.3},{4,{.6},{.1}},1][∞],x]]

Compute the expectation of an expression:

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

Calculate a probability:

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

Skewness and kurtosis:

Skewness[SARMAProcess[{.2},{.3},{4,{},{.1}},1][∞]]

Kurtosis[SARMAProcess[{.2},{.3},{4,{},{.1}},1][∞]]

Moment of order r:

Table[Moment[SARMAProcess[{.2},{.3},{4,{},{.1}},1][t],r],{r,0,4}]

Generating functions:

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

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

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

Table[CentralMoment[SARMAProcess[{.2},{.3},{4,{},{.1}},1][t],r],{r,0,4}]

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

(RefLink[FactorialMoment, paclet:ref/FactorialMoment]) has no closed form for symbolic order:

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

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

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

Table[Cumulant[SARMAProcess[{.2},{.3},{4,{},{.1}},1][t],r],{r,0,4}]

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

OpenersExampleSubsection5(Spacer1)Representations  (5)

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

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

Compare the covariance function for the original and the approximate processes:

DiscretePlot[CovarianceFunction[#,h],{h,0,20},ExtentSize->1/2,PlotRange->All,PlotLabel->Head[#]]&/@{proc,aproc}

For a vector process:

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

ARProcess[proc,3]

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

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

Compare sample paths:

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

For a vector process:

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

MAProcess[proc,3]

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

proc=SARMAProcess[1,{2/10,-3/10},{6/10,2/10},{12,{3/10},{}},1];
aproc=ARMAProcess[proc]

Compare covariance functions:

DiscretePlot[CovarianceFunction[#,h],{h,0,20},ExtentSize->1/2,PlotRange->All,PlotLabel->Head[#]]&/@{proc,aproc}

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

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

For a vector-valued process:

A={{.2,.3},{0,.1}};
B={{-.3,0},{.5,-.4}};
Σ={{1,0},{0,1}};
TransferFunctionModel[SARMAProcess[{},{A},{4,{B},{}},Σ],z]

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

StateSpaceModel[SARMAProcess[{a},{b},{4,{g},{h}},(σ^2)]]

For a vector-valued process:

A={{.2,.3},{0,.1}};
B={{-.3,.1},{.5,-.4}};
Σ={{1,0},{0,1}};
StateSpaceModel[SARMAProcess[{},{A},{3,{B},{}},Σ]]

OpenersExampleSection3(Spacer1)Applications  (3)

Use a SARMA process to model daily, monthly, and half-yearly autocorrelations:

proc=SARMAProcess[{.1},{},{30,{.3,0,0,0,0,.5},{}},1];

The covariance function shows the serial correlations:

cov=CovarianceFunction[proc,k];

DiscretePlot[cov,{k,1,3*365},PlotRange->All]

Daily mean temperature readings on the first of each month from the years 2000–2011 near your location:

temp=TimeSeries[];

temp["Source"]

DateListPlot[temp,Joined->True,Filling->Bottom]

Find process parameters:

tsm=TimeSeriesModelFit[temp]

The estimated time series process:

eproc=tsm["Process"]

Forecast future values for the next three years:

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

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

Fit a SARMA model for the hourly measurements of temperature in August:

temp=TimeSeries[];

temp["Source"]

DateListPlot[temp,Filling->Axis]

Find process parameters:

eproc=EstimatedProcess[temp,SARMAProcess[Mean[temp],{a1,a2},{b},{12,{c1,c2},{d1}},v],ProcessEstimator->"MaximumConditionalLikelihood"]

Check if the process is weakly stationary:

WeakStationarity[eproc]

The SARMA model does capture the seasonal trend well:

ListPlot[CorrelationFunction[#,{100}]&/@{temp,eproc},PlotStyle->PointSize[Medium],PlotLegends->{"Data","Model"},DataRange->{0,100}]

OpenersExampleSection4(Spacer1)Properties & Relations  (3)

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

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

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

Simplify[%-%%]

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

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

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

Simplify[%-%%]

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

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

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

Simplify[%-%%]

OpenersExampleSection5(Spacer1)Possible Issues  (2)

Some properties are defined only for weakly stationary processes:

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

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

FindInstance[a>0&&WeakStationarity[SARMAProcess[{a},{.2},{3,{.1},{.3}},1]],a]

CovarianceFunction[SARMAProcess[{1/2},{.2},{3,{.1},{.3}},1],h]

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

ToInvertibleTimeSeries[SARMAProcess[{.2},{.3,1},{4,{.2},{.3,1}},.2]]

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

TransferFunctionZeros[TransferFunctionModel[SARMAProcess[{.2},{.3,1},{4,{.2},{.3,1}},.2]]]

Abs[%]

OpenersExampleSection6(Spacer1)Neat Examples  (2)

Simulate a weakly stationary three-dimensional (RefLink[SARMAProcess, paclet:ref/SARMAProcess]):

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}};
proc1=SARMAProcess[{},{},{12,{A},{B}},S];
data1=RandomFunction[proc1,{100}]["PathStates"];

Graphics3D[{ColorData["SolarColors"][RandomReal[]],Tube@Line@data1}]

Non-weakly stationary process, starting at the origin:

a={{.9,.2,.8},{-.2,.8,-.3},{.2,.2,.4}};
proc2=SARMAProcess[{a},{B},{12,{a},{A}},S,{}];
data2=RandomFunction[proc2,{100}]["PathStates"];

Graphics3D[{ColorData["SolarColors"][RandomReal[]],Tube@Line@data2}]

Simulate paths from a SARMA process:

SeedRandom[154];data=RandomFunction[SARMAProcess[{.3},{.6},{6,{.8},{.2}},1],{50},300];

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->60]&[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,11}],PlotStyle->(cf/@Rescale[sd]),BaseStyle->Directive[Thin],PlotRangePadding->{{0,15},{.5,.5}}]

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

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