({{, (RefLink[MAProcess, paclet:ref/MAProcess])[{(Subscript[b, 1]),…,(Subscript[b, q])},v]
represents a moving-average process of order q with normal white noise variance v.}, {, (RefLink[MAProcess, paclet:ref/MAProcess])[{(Subscript[b, 1]),…,(Subscript[b, q])},Σ]
represents a vector MA process with multinormal white noise covariance matrix Σ.}, {, (RefLink[MAProcess, paclet:ref/MAProcess])[{(Subscript[b, 1]),…,(Subscript[b, q])},v,init]
represents an MA process with initial data init. }, {, (RefLink[MAProcess, paclet:ref/MAProcess])[c,…]
represents an MA process with a constant c.}})

OpenersNotesSection(Spacer1)Details

(RefLink[MAProcess, paclet:ref/MAProcess]) is also known as a finite impulse response (FIR) filter.

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

The MA process is described by the difference equation  y(t) ==c+(1+(Subscript[b, 1]) (Subscript[\[DiscreteShift], {t,-1}])+⋯+(Subscript[b, q]) (Subscript[\[DiscreteShift], {t,-q}]))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 MA process should have real coefficients (Subscript[b, i]) and c, and a positive variance v.

An n-dimensional vector MA process should have real coefficient matrices (Subscript[b, i]) of dimensions n×n, real vector c of length n, and the covariance matrix Σ should be symmetric positive definite of dimensions n×n.

The MA process with zero constant has transfer function g((z^(-1)))  where:

(RefLink[MAProcess, paclet:ref/MAProcess])[tproc,q] for a time series process tproc gives an MA process of order q such that the series expansions about zero of the corresponding transfer functions agree up to degree q.

Possible time series processes tproc include (RefLink[ARProcess, paclet:ref/ARProcess]), (RefLink[ARMAProcess, paclet:ref/ARMAProcess]), and (RefLink[SARIMAProcess, paclet:ref/SARIMAProcess]).

(RefLink[MAProcess, paclet:ref/MAProcess])[q] represents a moving-average process of order q for use in (RefLink[EstimatedProcess, paclet:ref/EstimatedProcess]) and related functions.

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

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Simulate an MA process:

sample=RandomFunction[MAProcess[2,{.3,-.5},1],{0,100}]

ListPlot[sample,Filling->Axis]

Covariance function:

CovarianceFunction[MAProcess[{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)],s,t]

DiscretePlot3D[CovarianceFunction[MAProcess[{.4,.3,.5,.6,.3},1.],s,t],{s,0,10},{t,0,10},ExtentSize->1/2,ColorFunction->"Rainbow"]

Correlation function:

DiscretePlot[CorrelationFunction[MAProcess[{2,.5,-.3,.3},1],h],{h,0,10},ExtentSize->1/2]

Partial correlation function:

DiscretePlot[PartialCorrelationFunction[MAProcess[{2,.5,-.3,.3},1],h],{h,1,20},ExtentSize->1/2]

OpenersExampleSection1(Spacer1)Scope  (37)

OpenersExampleSubsection0(Spacer1)Basic Uses  (11)

Simulate an ensemble of paths:

data=RandomFunction[MAProcess[1,{.5},1],{30},4]

ListLinePlot[data,Filling->Axis]

Simulate with given precision:

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

Simulate a first-order scalar process:

sample[b_]:=RandomFunction[MAProcess[{b},.1],{1,2 10^2}];

Sample paths for positive and negative values of the parameter:

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

Initial values do not influence the process values:

sproc[x_]:=MAProcess[0,{.6,.3},1,{x}];

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

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

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

Simulate a two-dimensional process:

β={{.2,.1},{-.3,.2}};
Σ={{1,0},{0,.3}};
SeedRandom[4];
sample=RandomFunction[MAProcess[{β},Σ],{1,100}];

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[MAProcess[{α,β},Σ],{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}]

Estimation:

sample=RandomFunction[MAProcess[{.2,-.6,.8},1],{1,300}];
eproc=EstimatedProcess[sample,MAProcess[3]]

Compare the sample covariance functions with the one of the estimated process:

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

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

TimeSeriesModelFit[sample,"MA"]

bestfit=%["BestFit"]

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

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

Find maximum likelihood estimator:

proc=MAProcess[1,{.3,.4},1];

SeedRandom[23];data=RandomFunction[proc,{100}];

Fix the constant and the variance and estimate the remaining parameters:

res=FindProcessParameters[data,MAProcess[1,{a,b},1],ProcessEstimator->"MaximumLikelihood"]

Plot the log-likelihood function together with the position of the estimated parameters:

ContourPlot[LogLikelihood[MAProcess[1,{x,y},1],data],{x,0.1,.8},{y,0.1,.8},Epilog->{Red,Point[{a,b}/.res]},PlotPoints->2]

Estimate a vector moving-average process:

proc=MAProcess[{1,2},{{{.2,.1},{.5,.3}}},{{1,.3},{.3,.5}}];
data=RandomFunction[proc,{10^3}];

eproc=EstimatedProcess[data,MAProcess[1]]

Compare covariance functions for each component:

Table[Show[ListPlot[CovarianceFunction[data["PathComponent",i],{8}],Filling->0,PlotStyle->PointSize[Medium],PlotRange->All],DiscretePlot[CovarianceFunction[eproc,h][[i,i]],{h,0,8},ExtentSize->1/2]],{i,1,2}]

Forecast future values:

proc=MAProcess[{5,6,5},.1];
sample=RandomFunction[proc,{1,50}];
forecast=TimeSeriesForecast[proc,sample,{10}]

Show the forecast path:

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=MAProcess[{{{.3,.1},{.9,.1}},{{.2,-.4},{.5,-.3}}},{{1,.2},{.2,.6}}];
data=RandomFunction[proc,{0,15}];

Find the forecast for the next 10 steps:

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

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  (6)

Correlation function exists in closed form:

CorrelationFunction[MAProcess[{b},(σ^2)],h]//PiecewiseExpand

CorrelationFunction[MAProcess[{(Subscript[b, 1]),(Subscript[b, 2]),(Subscript[b, 3]),(Subscript[b, 4])},(σ^2)],h]//PiecewiseExpand

Closed form of the partial correlation function for the first order:

PartialCorrelationFunction[MAProcess[{b},(σ^2)],h]

Covariance matrix:

Covariance[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][{1,2,5}]]//MatrixForm

Covariance matrix of an (RefLink[MAProcess, paclet:ref/MAProcess]) is symmetric multidiagonal:

Covariance[MAProcess[{1/3,1/4,1/3},1][Range[8]]]//MatrixForm

Correlation matrix:

Correlation[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][{1,2,5}]]//MatrixForm

Covariance function for a vector-valued process:

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

CovarianceFunction[MAProcess[{β},Σ],h]//TraditionalForm

Power spectral density:

Plot[PowerSpectralDensity[MAProcess[{-.1,-.4,.8},1],w],{w,-π,π},Filling->Axis]

PowerSpectralDensity[MAProcess[{b},(σ^2)],w]

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

a={{1/10,0},{1/3,0}};
Σ={{1,1/3},{1/3,1}};
proc=MAProcess[{a},Σ];

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

OpenersExampleSubsection2(Spacer1)Stationarity and Invertibility  (4)

(RefLink[MAProcess, paclet:ref/MAProcess]) is weakly stationary for any choice of parameters:

WeakStationarity[MAProcess[const,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)]]

For a vector process:

WeakStationarity[MAProcess[{{{.3,.2},{-.4,.1}}},{{1,.3},{.3,.6}}]]

Check if a time series is invertible:

proc=MAProcess[-2,{1,2},1];

TimeSeriesInvertibility[proc]

For a vector process:

TimeSeriesInvertibility[MAProcess[{{{.3,.2},{-.4,.1}}},{{1,.3},{.3,.6}}]]

Find invertible representation for a moving-average process:

proc=MAProcess[{4/3,1/2},1];
TimeSeriesInvertibility[proc]

iproc=ToInvertibleTimeSeries[proc]

The moments are being conserved:

Mean/@{proc[t],iproc[t]}

CovarianceFunction[#,s,t]&/@{proc,iproc}

Find invertibility conditions:

cond2D=TimeSeriesInvertibility[MAProcess[{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)]]

RegionPlot[cond2D,{(Subscript[b, 1]),-2,2},{(Subscript[b, 2]),-2,2},AxesLabel->Automatic]

Find conditions for higher order:

cond3D=TimeSeriesInvertibility[MAProcess[{(Subscript[b, 1]),(Subscript[b, 2]),(Subscript[b, 3])},(σ^2)]]

RegionPlot3D[cond3D,{(Subscript[b, 1]),-2,2},{(Subscript[b, 2]),-2,2},{(Subscript[b, 3]),-2,2},PlotPoints->50,AxesLabel->Automatic,ViewPoint->{1,1,1}]

OpenersExampleSubsection3(Spacer1)Estimation Methods  (6)

The available methods for estimating an (RefLink[MAProcess, paclet:ref/MAProcess]):

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

SeedRandom[14];
data=RandomFunction[MAProcess[2,{.4,.2},1],{50}];

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

Compare log likelihoods:

LogLikelihood[#[[2]],data]&/@res

Method of moments allows following solvers:

solvers={Automatic,"LeastSquares","FindRoot","NSolve"};

SeedRandom[4];
data=RandomFunction[MAProcess[2,{.4,.2},1],{100}];

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

This method allows for fixed parameters:

EstimatedProcess[data,MAProcess[c,{.4,a,b},v],ProcessEstimator->"MethodOfMoments"]

Some relations between parameters are also permitted:

EstimatedProcess[data,MAProcess[c,{b/a,b,a,a*b},v],ProcessEstimator->"MethodOfMoments"]

Maximum conditional likelihood method allows following solvers:

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

SeedRandom[4];
data=RandomFunction[MAProcess[2,{.4,.2},1],{100}];

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

This method allows for fixed parameters:

EstimatedProcess[data,MAProcess[c,{.1,b},v],ProcessEstimator->"MaximumConditionalLikelihood"]

Some relations between parameters are also permitted:

EstimatedProcess[data,MAProcess[c,{b,b},v],ProcessEstimator->"MaximumConditionalLikelihood"]

Maximum likelihood method allows following solvers:

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

SeedRandom[4];
data=RandomFunction[MAProcess[2,{.4,.2},1],{100}];

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

This method allows for fixed parameters:

EstimatedProcess[data,MAProcess[c,{.1,b},v],ProcessEstimator->"MaximumLikelihood"]

Some relations between parameters are also permitted:

EstimatedProcess[data,MAProcess[c,{b,b},v],ProcessEstimator->"MaximumLikelihood"]

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

SeedRandom[4];
data=RandomFunction[MAProcess[2,{.4,.2},1],{100}];

Grid[Table[{m,EstimatedProcess[data,MAProcess[2],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,MAProcess[2],ProcessEstimator->{"SpectralEstimator",Method->m}]},{m,solvers}],Frame->All,Spacings->{1,2},Alignment->{Left,Center}]

This method allows for fixed parameters:

EstimatedProcess[data,MAProcess[c,{a,.5},v],ProcessEstimator->"SpectralEstimator"]

Some relations between parameters are also permitted:

EstimatedProcess[data,MAProcess[c,{b,b},v],ProcessEstimator->"SpectralEstimator"]

Minimum prediction method:

SeedRandom[4];
data=RandomFunction[MAProcess[2,{.4,.2},1],{100}];

EstimatedProcess[data,MAProcess[2],ProcessEstimator->"MinimumPredictionError"]

This method allows for fixed parameters:

EstimatedProcess[data,MAProcess[c,{b,.1},v],ProcessEstimator->"MinimumPredictionError"]

OpenersExampleSubsection4(Spacer1)Process Slice Properties  (5)

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

SliceDistribution[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},σ^2],t]//PDF[#,x]&

Multiple time slice distributions:

SliceDistribution[MAProcess[-.3,{.2,.3},1],{s,s+3}]//Mean

SliceDistribution[MAProcess[1,{.2,.3},1],{1,2,3}]//Covariance

Slice distribution of a vector-valued time series:

β={{(Subscript[b, 1]),0},{0,(Subscript[b, 2])}};
Σ={{((Subscript[σ, 1])^2),ρ (Subscript[σ, 1])(Subscript[σ, 2])},{ρ (Subscript[σ, 1])(Subscript[σ, 2]), ((Subscript[σ, 2])^2)}};
MAProcess[{(Subscript[c, 1]),(Subscript[c, 2])},{β},Σ][t]//Mean

First-order probability density function:

pdf=PDF[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},σ^2,{}][t],x]//PiecewiseExpand//Simplify

Plot[Evaluate@Table[pdf/.{c->1,(Subscript[b, 1])->1/2,(Subscript[b, 2])->2/3,σ->1},{t,1,3}],{x,-3,5},Filling->Axis,PlotLegends->{"t = 1","t = 2", "t = 3"}]

Stationary mean and variance:

μ=Mean[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][∞]]

v=Variance[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][∞]]

Compare with the density function of a normal distribution:

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

FullSimplify[%-PDF[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][∞],x]]

Compute the expectation of an expression:

Expectation[x[t]^2,x\[Distributed]MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)]]

Calculate a probability:

Probability[x[t]<6,x\[Distributed]MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)]]

Skewness and kurtosis are constant:

Skewness[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][t]]

Kurtosis[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][t]]

Moment of order r:

Table[Moment[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][t],r],{r,0,4}]//Together

Generating functions:

CharacteristicFunction[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][t],w]

MomentGeneratingFunction[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][t],w]

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

Table[CentralMoment[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][t],r],{r,0,4}]

CentralMomentGeneratingFunction[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][t],w]

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

Table[FactorialMoment[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][t],r],{r,0,4}]

FactorialMomentGeneratingFunction[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][t],w]

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

Table[Cumulant[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][t],r],{r,0,4}]

CumulantGeneratingFunction[MAProcess[c,{(Subscript[b, 1]),(Subscript[b, 2])},(σ^2)][t],w]

OpenersExampleSubsection5(Spacer1)Representations  (5)

Approximate an AR process with an MA process of order 5:

proc=ARProcess[{.2,.3,-.1,.3},1];
aproc=MAProcess[proc,5]

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

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

Approximate a vector process:

proc=ARProcess[{.4,.2},{{{.2,.5},{-.3,.5}}},{{.6,.2},{.2,.4}}];
aproc=MAProcess[proc,3]

Approximate an ARMA process with an MA process:

MAProcess[ARMAProcess[c,{(Subscript[a, 1]),(Subscript[a, 2])},{(Subscript[b, 1]),(Subscript[b, 2]),(Subscript[b, 3])},(σ^2)],2]

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

Compare sample paths:

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

Approximate a SARIMA process with an MA process:

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

Compare sample paths:

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

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

TransferFunctionModel[MAProcess[{a,b,c},(σ^2)],z]

For a vector-valued process:

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

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

StateSpaceModel[MAProcess[{a,b,c},(σ^2)]]

For a vector-valued process:

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

OpenersExampleSection3(Spacer1)Applications  (1)

Consider the following time series data and determine whether it is adequately modeled by an (RefLink[MAProcess, paclet:ref/MAProcess]):

data=TimeSeries[];

ListPlot[data,PlotStyle->PointSize[Tiny]]

The correlation function drops off after lag 3. This is evidence of an (RefLink[MAProcess, paclet:ref/MAProcess])[3]:

ListPlot[CorrelationFunction[data,{1,20}],PlotRange->All,Filling->0,AxesOrigin->{0,0},PlotStyle->PointSize[Medium]]

The partial correlation alternates and dampens slowly, which also indicates an (RefLink[MAProcess, paclet:ref/MAProcess]):

ListPlot[PartialCorrelationFunction[data,{1,20}],PlotRange->All,Filling->0,AxesOrigin->{0,0},PlotStyle->PointSize[Medium]]

Fit an (RefLink[MAProcess, paclet:ref/MAProcess])[3] model to the data:

model=EstimatedProcess[data,MAProcess[3]]

Find residuals between the data and the model:

tsm=TimeSeriesModelFit[data,model]

residuals=tsm["FitResiduals"];

Histogram[residuals["Values"]]

Test if residuals are normal white noise:

DistributionFitTest[residuals,Automatic,"TestDataTable"]

DistributionFitTest[residuals,Automatic,"ShortTestConclusion"]

OpenersExampleSection4(Spacer1)Properties & Relations  (5)

(RefLink[MAProcess, paclet:ref/MAProcess]) is a special case of an (RefLink[ARMAProcess, paclet:ref/ARMAProcess]):

TransferFunctionModel[ARMAProcess[{},{a,b,c},(σ^2)],z]

TransferFunctionModel[MAProcess[{a,b,c},(σ^2)],z]

%-%%

(RefLink[MAProcess, paclet:ref/MAProcess]) is a special case of an (RefLink[ARIMAProcess, paclet:ref/ARIMAProcess]):

TransferFunctionModel[ARIMAProcess[{},0,{a,b,c},(σ^2)],z]

TransferFunctionModel[MAProcess[{a,b,c},(σ^2)],z]

%-%%

(RefLink[MAProcess, paclet:ref/MAProcess]) is a special case of a (RefLink[FARIMAProcess, paclet:ref/FARIMAProcess]):

TransferFunctionModel[FARIMAProcess[{},0,{a,b,c},(σ^2)],z]

TransferFunctionModel[MAProcess[{a,b,c},(σ^2)],z]

%-%%

(RefLink[MAProcess, paclet:ref/MAProcess]) is a special case of a (RefLink[SARMAProcess, paclet:ref/SARMAProcess]):

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

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

Simplify[%-%%]

(RefLink[MAProcess, paclet:ref/MAProcess]) is a special case of a (RefLink[SARIMAProcess, paclet:ref/SARIMAProcess]):

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

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

Simplify[%-%%]

OpenersExampleSection5(Spacer1)Possible Issues  (3)

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

ToInvertibleTimeSeries[MAProcess[{.3,1},.2]]

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

TransferFunctionZeros[TransferFunctionModel[MAProcess[{.3,1},.2]]]

Abs[%]

The method of moments may not find a solution in estimation:

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

EstimatedProcess[data,MAProcess[c,{b,Exp[b]},v],ProcessEstimator->{"MethodOfMoments",Method->"NSolve"}]

Use a different solver:

EstimatedProcess[data,MAProcess[c,{b,Exp[b]},v],ProcessEstimator->{"MethodOfMoments",{Method->"FindRoot",MaxIterations->500}}]

Minimum prediction error estimation method does not allow repeated parameters:

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

EstimatedProcess[data,MAProcess[c,{b,b},v],ProcessEstimator->"MinimumPredictionError"]

Use a different method:

EstimatedProcess[data,MAProcess[c+b,{.1,b},v]]

OpenersExampleSection6(Spacer1)Neat Examples  (2)

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

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=MAProcess[{A,B},S];
data=RandomFunction[proc,{100},k=5]["ValueList"];

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

Simulate paths from an MA process:

SeedRandom[154];
data=RandomFunction[MAProcess[{.3,.6},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->42]&[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[ARProcess, paclet:ref/ARProcess])  ▪  (RefLink[ARMAProcess, paclet:ref/ARMAProcess])  ▪  (RefLink[ARIMAProcess, paclet:ref/ARIMAProcess])  ▪  (RefLink[FARIMAProcess, paclet:ref/FARIMAProcess])  ▪  (RefLink[SARMAProcess, paclet:ref/SARMAProcess])  ▪  (RefLink[SARIMAProcess, paclet:ref/SARIMAProcess])  ▪  (RefLink[TimeSeriesInvertibility, paclet:ref/TimeSeriesInvertibility])  ▪  (RefLink[ToInvertibleTimeSeries, paclet:ref/ToInvertibleTimeSeries])  ▪  (RefLink[NormalDistribution, paclet:ref/NormalDistribution])  ▪  (RefLink[MultinormalDistribution, paclet:ref/MultinormalDistribution])  ▪  (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel])  ▪  (RefLink[StateSpaceModel, paclet:ref/StateSpaceModel])}})}})

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