ARProcess[{a1,…,ap},v]
represents a weakly stationary autoregressive process of order p with normal white noise variance v.
ARProcess[{a1,…,ap},Σ]
represents a weakly stationary vector AR process with multinormal white noise covariance matrix Σ.
ARProcess[{a1,…,ap},v,init]
represents an AR process with initial data init.
ARProcess[c,…]
represents an AR process with a constant c.
ARProcess
ARProcess[{a1,…,ap},v]
represents a weakly stationary autoregressive process of order p with normal white noise variance v.
ARProcess[{a1,…,ap},Σ]
represents a weakly stationary vector AR process with multinormal white noise covariance matrix Σ.
ARProcess[{a1,…,ap},v,init]
represents an AR process with initial data init.
ARProcess[c,…]
represents an AR process with a constant c.
Details
- ARProcess is also known as AR or VAR (vector AR).
- ARProcess is a discrete-time and continuous-state random process.
- The AR process is described by the difference equation
,
where
is the state output,
is the white noise input,
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 TemporalData object with time stamps understood as {…,-2,-1}.
- A scalar AR process can have real coefficients ai and c, a positive variance v, and a non-negative integer order p.
- An
-dimensional vector AR process can have real coefficient matrices ai of dimensions
×
, real vector c of length
, and the covariance matrix Σ should be symmetric positive definite of dimensions
×
. - The AR process with zero constant has transfer function
, where: -

scalar process 
vector process;
is the
×
identity matrix - ARProcess[tproc,p] for a time series process tproc gives an AR process of order p such that the series expansions about zero of the corresponding transfer functions agree up to degree p.
- Possible time series processes tproc include ARProcess, ARMAProcess, and SARIMAProcess.
- ARProcess[p] represents an autoregressive process of order p for use in EstimatedProcess and related functions.
- ARProcess can be used with such functions as CovarianceFunction, RandomFunction, and TimeSeriesForecast.
Examples
open all close allBasic Examples (3)
data = RandomFunction[ARProcess[2, {.3, -.5}, .1], {1, 10 ^ 2}]ListPlot[data, Filling -> Axis]CovarianceFunction[ARProcess[{a}, σ^2], s, t]DiscretePlot3D[CovarianceFunction[ARProcess[{.7, -.4, .5}, 1.], s, t], {s, 0, 10}, {t, 0, 10}, ExtentSize -> 1 / 2, ColorFunction -> "Rainbow"]DiscretePlot[CorrelationFunction[ARProcess[{.5, .1, .3, -.2}, 1], h], {h, 0, 20}, ExtentSize -> 1 / 2]DiscretePlot[PartialCorrelationFunction[ARProcess[{.5, .1, .3, -.2}, 1], h], {h, 1, 9}, ExtentSize -> 1 / 2]Scope (38)
Basic Uses (11)
Simulate an ensemble of paths:
data = RandomFunction[ARProcess[1, {.5}, 1], {30}, 4]ListLinePlot[data, Filling -> Axis]Simulate with given precision:
RandomFunction[ARProcess[1, {2 / 10, 1 / 10}, 1 / 10], {1, 4}, WorkingPrecision -> 20]["Path"]Simulate a first-order scalar process:
sample[a_] := RandomFunction[ARProcess[{a}, .1], {1, 200}];Sample paths for positive and negative values of the parameter:
ListPlot[sample[#], Filling -> Axis, PlotLabel -> ("a = " ~~ ToString[#])]& /@ {-0.9, 0.9}Compare the serial dependence between consecutive values on scatter plots:
pairs[a_] := Transpose[{Most[#], Rest[#]}]&[sample[a]["Values"]];ListPlot[pairs[#], PlotLabel -> ("a = " ~~ ToString[#])]& /@ {-0.9, 0.9}Simulate a weakly stationary process with given initial values:
sproc[x_] := ARProcess[0, {.4, .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)]For a process with a trend, initial values influence the behavior of the whole path:
tproc[x_] := ARProcess[0, {1.1, -0.04}, 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}};
Σ = {{1.0, 0}, {0, 0.3}};
sample = RandomFunction[ARProcess[{α}, Σ], {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[ARProcess[{α, β}, Σ], {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}]sample = RandomFunction[ARProcess[{.2, -.4}, .1], {1, 300}];
eproc = EstimatedProcess[sample, ARProcess[2]]Compare the sample covariance functions with that 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 TimeSeriesModel to automatically find orders:
TimeSeriesModelFit[sample, "AR"]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 the maximum likelihood estimator:
proc = ARProcess[1, {.3, .4}, 1];SeedRandom[23];data = RandomFunction[proc, {100}];Fix the constant and the variance and estimate the remaining parameters:
res = FindProcessParameters[data, ARProcess[1, {a, b}, 1], ProcessEstimator -> "MaximumLikelihood"]Plot the log-likelihood function together with the position of the estimated parameters:
logℒ[x_Real, y_Real] := LogLikelihood[ARProcess[1, {x, y}, 1], data]ContourPlot[logℒ[x, y], {x, 0.1, .49}, {y, 0.1, .49}, Epilog -> {Red, Point[{a, b} /. res]}]Estimate a vector autoregressive process:
proc = ARProcess[{1, 2}, {{{.2, .1}, {.5, .3}}}, {{1, .3}, {.3, .5}}];
data = RandomFunction[proc, {10 ^ 3}];eproc = EstimatedProcess[data, ARProcess[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}]proc = ARProcess[2, {.1, .4}, .1];
sample = RandomFunction[proc, {1, 50}];Find the forecast for the next 10 steps:
forecast = TimeSeriesForecast[proc, sample, {10}]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 = ARProcess[{{{.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}]Covariance and Spectrum (6)
For low order it is possible to find the closed form of the correlation function:
CorrelationFunction[ARProcess[{a}, σ^2], h]//PiecewiseExpandCorrelationFunction[ARProcess[{1 / 3, 1 / 2}, σ^2], h]//FunctionExpand//PiecewiseExpandPartial correlation function is zero for lags larger than the process order:
PartialCorrelationFunction[ARProcess[{a, b}, σ^2], h]//Simplify[#, h ≠ 0 && Element[h, Integers]]&PartialCorrelationFunction[ARProcess[{a, b, c, d}, σ^2], 1]Correlation[ARProcess[{a, b}, σ^2][{1, 2, 3}]]//Simplify//MatrixFormCovariance[ARProcess[{a}, σ^2][{1, 2, 3}]]//Simplify//MatrixFormInverse of the covariance matrix of an ARProcess is symmetric multidiagonal:
cov = Covariance[ARProcess[{1 / 7, 1 / 4, 1 / 5}, 1][Range[8]]];
Inverse[cov]//MatrixFormCovariance function for a vector-valued process:
Σ = {{Subscript[σ, 1]^2, ρ Subscript[σ, 1]Subscript[σ, 2]}, {ρ Subscript[σ, 1]Subscript[σ, 2], Subscript[σ, 2]^2}};
α = {{a, 0}, {0, b}};CovarianceFunction[ARProcess[{α}, Σ], h]//TraditionalFormPlot[PowerSpectralDensity[ARProcess[{.4, -.4, .3}, 1], w], {w, -π, π}, Filling -> Axis]PowerSpectralDensity[ARProcess[{a}, σ^2], w]Vector ARMAProcess:
a = {{1 / 9, 0}, {1 / 3, 1 / 2}};
b = {{1, 3 / 4}, {1 / 2, -1 / 4}};
Σ = {{1, 1 / 3}, {1 / 3, 1}};
proc = ARMAProcess[{a}, {b}, Σ];psd = PowerSpectralDensity[proc, ω];
psd//FullSimplify//MatrixFormStationarity and Invertibility (4)
Check if a time series process is weakly stationary:
WeakStationarity[ARProcess[.3, {1, 2}, 1, {}]]WeakStationarity[ARProcess[{{{.3, .2}, {-.4, .1}}}, {{1, .3}, {.3, .6}}]]Find conditions for a process to be weakly stationary:
cond2D = WeakStationarity[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, σ^2]]RegionPlot[cond2D, {Subscript[a, 1], -2, 2}, {Subscript[a, 2], -2, 2}, FrameLabel -> Automatic]Find conditions for higher order:
cond3D = WeakStationarity[ARProcess[{Subscript[a, 1], Subscript[a, 2], Subscript[a, 3]}, σ^2]]RegionPlot3D[Simplify@cond3D, {Subscript[a, 1], -2, 2}, {Subscript[a, 2], -2, 2}, {Subscript[a, 3], -2, 2}, PlotPoints -> 40, AxesLabel -> Automatic]Variance is positive only for a weakly stationary process:
v = Variance[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, 1][∞]]//FullSimplifyDefine stationarity conditions:
cond = WeakStationarity[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, 1]]Variance is positive, assuming weak stationarity:
FullSimplify[v > 0, cond]Autoregressive process is always invertible:
TimeSeriesInvertibility[ARProcess[const, {Subscript[a, 1], Subscript[a, 2]}, σ^2]]Estimation Methods (6)
The available methods for estimating an ARProcess:
methods = {Automatic, "MethodOfMoments", "MaximumConditionalLikelihood", "MaximumLikelihood", "SpectralEstimator", "MaximumEntropy"};SeedRandom[14];
data = RandomFunction[ARProcess[2, {.4, .2, .3}, 1], {100}];Grid[res = Table[{m, EstimatedProcess[data, ARProcess[3], ProcessEstimator -> m]}, {m, methods}], Frame -> All, Spacings -> {1, 2}, Alignment -> {Left, Center}]LogLikelihood[#[[2]], data]& /@ resMethod of moments admits the following solvers:
solvers = {Automatic, "LevinsonDurbin", "LeastSquares", "FindRoot", "NSolve"};SeedRandom[4];
data = RandomFunction[ARProcess[2, {.4, .2}, 1], {100}];Grid[Table[{m, EstimatedProcess[data, ARProcess[3], ProcessEstimator -> {"MethodOfMoments", Method -> m}]}, {m, solvers}], Frame -> All, Spacings -> {1, 2}, Alignment -> {Left, Center}]Use a general solver for moments when fixing or repeating parameters:
EstimatedProcess[data, ARProcess[c, {.4, b}, v], ProcessEstimator -> "MethodOfMoments"]Maximum conditional likelihood method allows the following solvers:
solvers = {Automatic, "FindMaximum", "NMaximize"};SeedRandom[4];
data = RandomFunction[ARProcess[2, {.4, .2}, 1], {100}];Grid[Table[{m, EstimatedProcess[data, ARProcess[3], ProcessEstimator -> {"MaximumConditionalLikelihood", Method -> m}]}, {m, solvers}], Frame -> All, Spacings -> {1, 2}, Alignment -> {Left, Center}]This method allows for fixed parameters:
EstimatedProcess[data, ARProcess[c, {.1, b}, v], ProcessEstimator -> "MaximumConditionalLikelihood"]Some relations between parameters are also permitted:
EstimatedProcess[data, ARProcess[c, {b, b}, v], ProcessEstimator -> "MaximumConditionalLikelihood"]Maximum likelihood method allows the following solvers:
solvers = {Automatic, "FindMaximum", "NMaximize"};SeedRandom[4];
data = RandomFunction[ARProcess[2, {.4, .2}, 1], {100}];Grid[Table[{m, EstimatedProcess[data, ARProcess[2], ProcessEstimator -> {"MaximumLikelihood", Method -> m}]}, {m, solvers}], Frame -> All, Spacings -> {1, 2}, Alignment -> {Left, Center}]This method allows for fixed parameters:
EstimatedProcess[data, ARProcess[c, {.1, b}, v], ProcessEstimator -> "MaximumLikelihood"]Some relations between parameters are also permitted:
EstimatedProcess[data, ARProcess[c, {b, b}, v], ProcessEstimator -> "MaximumLikelihood"]Spectral estimator allows specification of windows used for PowerSpectralDensity calculation:
SeedRandom[4];
data = RandomFunction[ARProcess[2, {.4, .2, .1}, 1], {100}];Grid[Table[{m, EstimatedProcess[data, ARProcess[3], 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, ARProcess[2], ProcessEstimator -> {"SpectralEstimator", Method -> m}]}, {m, solvers}], Frame -> All, Spacings -> {1, 2}, Alignment -> {Left, Center}]This method allows for fixed parameters:
EstimatedProcess[data, ARProcess[c, {.1, b}, v], ProcessEstimator -> "SpectralEstimator"]Some relations between parameters are also permitted:
EstimatedProcess[data, ARProcess[c, {b, b}, v], ProcessEstimator -> "SpectralEstimator"]SeedRandom[4];
data = RandomFunction[ARProcess[2, {.4, .2}, 1], {100}];EstimatedProcess[data, ARProcess[2], ProcessEstimator -> "MaximumEntropy"]It is also known as Burg method:
EstimatedProcess[data, ARProcess[2], ProcessEstimator -> "Burg"]Process Slice Properties (5)
Univariate SliceDistribution:
SliceDistribution[ARProcess[c, {a}, σ^2], t]//PDF[#, x]&Multivariate slice distributions:
SliceDistribution[ARProcess[{.2, .3}, 1], {s, s + 3}]//MeanSliceDistribution[ARProcess[{.2, .3}, 1], {1, 2, 3}]//CovarianceSlice distribution of a vector-valued time series:
α = {{Subscript[a, 1], 0}, {0, Subscript[a, 2]}};
Σ = {{Subscript[σ, 1]^2, ρ Subscript[σ, 1]Subscript[σ, 2]}, {ρ Subscript[σ, 1]Subscript[σ, 2], Subscript[σ, 2]^2}};Mean[ARProcess[{c1, c2}, {α}, Σ][3]]Covariance[SliceDistribution[ARProcess[{c1, c2}, {α}, Σ], {1, 2, 3}]]//MatrixFormFirst-order probability density function with zero initial conditions:
pdf = PDF[ARProcess[c, {a}, σ^2, {}][t], x]//PiecewiseExpand//SimplifyPlot[Evaluate@Table[pdf /. {c -> 1, a -> .7, σ -> 1}, {t, 1, 4}], {x, -3, 6}, Filling -> Axis, PlotLegends -> {"t = 1", "t = 2", "t = 3", "t = 4"}]μ = Mean[ARProcess[c, {Subscript[a, 1], Subscript[a, 2]}, σ^2][∞]]v = Variance[ARProcess[c, {Subscript[a, 1], Subscript[a, 2]}, σ^2][∞]]Compare with the density function of a normal distribution:
PDF[NormalDistribution[μ, Sqrt[v]], x]FullSimplify[% - PDF[ARProcess[c, {Subscript[a, 1], Subscript[a, 2]}, σ^2][∞], x]]Compute the expectation of an expression:
Expectation[x[3] ^ 2, xARProcess[c, {Subscript[a, 1], Subscript[a, 2]}, σ^2]]Probability[x[7] < 6, xARProcess[{a}, σ^2]]Skewness and kurtosis functions are constant:
Skewness[ARProcess[c, {a}, σ^2][t]]Kurtosis[ARProcess[c, {Subscript[a, 1], Subscript[a, 2]}, σ^2][t]]Table[Moment[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, σ^2][t], r], {r, 0, 5}]CharacteristicFunction[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, σ^2][t], w]MomentGeneratingFunction[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, σ^2][t], w]CentralMoment and its generating function:
Table[CentralMoment[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, σ^2][t], r], {r, 0, 5}]CentralMomentGeneratingFunction[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, σ^2][t], w]FactorialMoment has no closed form for symbolic order:
Table[FactorialMoment[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, σ^2][t], r], {r, 0, 5}]FactorialMomentGeneratingFunction[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, σ^2][t], w]Cumulant and its generating function:
Table[Cumulant[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, σ^2][t], r], {r, 0, 5}]CumulantGeneratingFunction[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, σ^2][t], w]Representations (6)
Approximate an MA process with an AR process of order 3:
proc = MAProcess[.4, {.2, .3, -.1}, 1];
aproc = ARProcess[proc, 3]Compare the covariance function for the original and the approximate processes:
DiscretePlot[CovarianceFunction[#, h], {h, 0, 10}, ExtentSize -> 1 / 2, PlotLabel -> Head[#]]& /@ {proc, aproc}proc = MAProcess[{.4, .2}, {{{.2, .5}, {-.3, .5}}}, {{.6, .2}, {.2, .4}}];
aproc = ARProcess[proc, 3]Approximate an ARMA process with an AR process:
ARProcess[ARMAProcess[c, {Subscript[a, 1], Subscript[a, 2]}, {Subscript[b, 1], Subscript[b, 2], Subscript[b, 3]}, v], 2]Approximate an ARMA with fixed initial values:
proc = ARMAProcess[.4, {.2, -.3, -.2}, {.8, -.2, .7}, 1., {}];
aproc = ARProcess[proc, 3]SeedRandom[13];sample = RandomFunction[proc, {100}];
SeedRandom[13];asample = RandomFunction[aproc, {100}];
ListLinePlot[{sample, asample}, PlotLegends -> {"ARMA", "AR"}]Approximate a SARIMA process with an AR process:
proc = SARIMAProcess[{.2, -.3, -.1}, 1, {.6, .2}, {4, {.3}, 1, {}}, 1];
aproc = ARProcess[proc, 15]SeedRandom[13];sample = RandomFunction[proc, {150}];
SeedRandom[13];asample = RandomFunction[aproc, {150}];
ListLinePlot[{sample, asample}, PlotLegends -> {"SARIMA", "AR"}]TransferFunctionModel representation:
TransferFunctionModel[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, σ^2], z]α = {{.2, .3}, {0, .1}};
β = {{-.3, .1}, {.5, -.4}};
Σ = {{1, 0}, {0, 1}};
TransferFunctionModel[ARProcess[{α, β}, Σ], z]PoleZeroPlot of a stationary AR process:
proc = ARProcess[{.3, .4, .1}, 1];
tfm = TransferFunctionModel[proc];PoleZeroPlot[tfm]A non stationary AR process has at least one pole outside the unit circle:
proc = ARProcess[{.3, .5, .8}, 1, {}];
PoleZeroPlot[StateSpaceModel[proc]]StateSpaceModel representation:
StateSpaceModel[ARProcess[{Subscript[a, 1], Subscript[a, 2]}, σ^2]]α = {{.2, .3}, {0, .1}};
β = {{-.3, .1}, {.5, -.4}};
Σ = {{1, 0}, {0, 1}};
StateSpaceModel[ARProcess[{α, β}, Σ]]Applications (6)
Use ARProcess to estimate an ARMAProcess:
data = RandomFunction[proc = ARMAProcess[{.3}, {.2}, 1], {10 ^ 4}];
ar = EstimatedProcess[data, ARProcess[20]]Transform the estimated process to ARMA with given orders:
arma = ARMAProcess[ar, {1, 1}]Compare log-likelihood values:
LogLikelihood[#, data]& /@ {proc, arma}Consider the mean daily temperature for Champaign in August 2012:
temp = TemporalData[TimeSeries, {{{20.5, 20.89, 22.5, 27.44, 26.5, 20.33, 18.83, 23.06, 20.83, 19.72,
14.89, 15.28, 18.11, 18.72, 17.5, 20.83, 17.94, 13.56, 16.44, 14.33, 14.72, 15.83, 17.28,
19.89, 20.44, 21.39, 24.89, 22.78, 22.83, 20.22, 24.4 ... te", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}, ValueDimensions -> 1,
MetaInformation -> {"Source" -> HoldForm[WeatherData["Champaign", "MeanTemperature",
{{2012, 8}, {2012, 8}, "Day"}]]}}}, True, 10.1];temp["Source"]DateListPlot[temp, Joined -> True, Filling -> Axis]eproc = EstimatedProcess[temp, ARProcess[20]]Compare CorrelationFunction of the model and the data:
ListPlot[TemporalData[CorrelationFunction[#, {30}]& /@ {temp, eproc}], Filling -> {1 -> {2}}, PlotStyle -> PointSize[Medium], PlotLegends -> {"Data", "Model"}]The hourly readings of temperature in June 2011 near your location:
temp = TemporalData[TimeSeries, {{{20, 18.3, 17.2, 16.1, 15.6, 18.3, 21.1, 23.3, 25.6, 27.2, 28.3, 28.9,
30, 30, 30, 30.6, 30, 28.3, 25.6, 22.8, 22.2, 20.6, 19.4, 17.8, 17.8, 16.1, 17.8, 17.8, 18.9,
18.3, 19.4, 20, 18.3, 18, 18.3, 19, 20.6, 22.8 ... "Hour"}]}, 1, {"Discrete", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1},
MetaInformation -> {"Source" -> HoldForm[WeatherData[FindGeoLocation[], "Temperature",
{2011, 6}]]}}}, True, 10.1];temp["Source"]DateListPlot[temp, Joined -> True, Filling -> Axis]proc = EstimatedProcess[temp, ARProcess[48]]Create TimeSeriesModel with estimated process:
tsm = TimeSeriesModelFit[temp, proc]Check goodness of fit by investigating residuals:
{#["ACFPlot"], #["PACFPlot"]}&[tsm]The daily exchange rates of the euro to the dollar from May 2012 through September 2012:
data = TemporalData[Automatic, {{{1.31, 1.31, 1.31, 1.3, 1.3, 1.3, 1.29, 1.29, 1.29, 1.27, 1.28, 1.28,
1.27, 1.26, 1.26, 1.26, 1.25, 1.24, 1.24, 1.23, 1.24, 1.24, 1.25, 1.26, 1.25, 1.26, 1.25, 1.25,
1.26, 1.26, 1.26, 1.26, 1.27, 1.27, 1.25, 1.25 ... Data`DateSpecification[{2012, 5, 2}, {2012, 9, 28}, "BusinessDay", "DayRange"]}, 1,
{"Discrete", 1}, {"Discrete", 1}, 1,
{MetaInformation -> {"Source" -> HoldForm[FinancialData]["EUR/USD",
{{2012, 5, 1}, {2012, 9, 30}}]}}}, True, 9.];data["Source"]DateListPlot[data, Joined -> True, Filling -> Bottom]The scatter plot of consecutive values indicates strong serial correlation:
With[{vals = data["Values"]}, ListPlot[Transpose[{Most[vals], Rest[vals]}]]]Fit an AR process to the exchange rates:
eproc = EstimatedProcess[data, ARProcess[3]]Forecast for 20 business days ahead:
forecast = TimeSeriesForecast[eproc, data, {20}]Plot the forecast with original data:
DateListPlot[{data, forecast}, Joined -> True, Filling -> Bottom]Daily mean temperature readings in years 2000–2011 near your location:
temp = TemporalData[TimeSeries, {{{-1.22, -4.2, 2.14, 9.92, 18.05, 20.6, 25.11, 23.63, 18.85, 10.11, 4.42,
-0.59, -4.52, -0.63, 4.72, 13.81, 14.6, 22.48, 23.41, 23.75, 19.75, 12.52, 7.45, -2.27, -7.41,
-3.33, 4.81, 9.41, 22.12, 21.34, 25.7, 23.2 ... , 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1},
MetaInformation -> {"Source" -> HoldForm[WeatherData[FindGeoLocation[], "MeanTemperature",
{{1980, 1}, {2012, 1}, "Month"}]]}}}, True, 10.1];temp["Source"]DateListPlot[temp, Joined -> True, Filling -> Bottom]tsm = TimeSeriesModelFit[temp, "AR"]eproc = tsm["Process"]Check stationarity assuming Automatic initial conditions:
WeakStationarity[eproc]Compare CorrelationFunction and PartialCorrelationFunction of the model and the sample:
modelCorr = DiscretePlot[#[eproc, h], {h, 1, 60}, PlotRange -> {-1, 1}, ExtentSize -> 1 / 2]& /@ {CorrelationFunction, PartialCorrelationFunction};
sampleCorr = ListLinePlot[#[temp["PathStates"], {1, 60}], PlotRange -> {-1, 1}, PlotLabel -> #]& /@ {CorrelationFunction, PartialCorrelationFunction};
MapThread[Show[#2, #1]&, {modelCorr, sampleCorr}]The following data represents the return on DJIA and return on market capitalization for eight months during 1961. Fit a VAR model to this data:
data = TemporalData[{{1, {0.02619, 0.032994}}, {2, {0.02575, 0.033013}}, {3, {0.01442, 0.006127}}, {4, {0.02067, 0.022185}}, {5, {-0.02172, -0.030350}}, {6, {0.01913, 0.033709}}, {7, {0.03243, 0.022871}}, {8, {-0.03279, -0.020618}}}]ListLinePlot[data]eproc = EstimatedProcess[data, ARProcess[1]]Simulate the estimated process:
sample = RandomFunction[eproc, {1, 8}, 10 ^ 3];Find the mean path for each component:
mean = TimeSeriesThread[Mean, sample];ListLinePlot[mean]Properties & Relations (7)
ARProcess is a special case of an ARMAProcess:
TransferFunctionModel[ARMAProcess[{Subscript[a, 1], Subscript[a, 2], Subscript[a, 3]}, {}, σ^2], z]TransferFunctionModel[ARProcess[{Subscript[a, 1], Subscript[a, 2], Subscript[a, 3]}, σ^2], z]% - %%ARProcess is a special case of an ARIMAProcess:
TransferFunctionModel[ARIMAProcess[{Subscript[a, 1], Subscript[a, 2], Subscript[a, 3]}, 0, {}, σ^2], z]TransferFunctionModel[ARProcess[{Subscript[a, 1], Subscript[a, 2], Subscript[a, 3]}, σ^2], z]% - %%ARProcess is a special case of a FARIMAProcess:
TransferFunctionModel[FARIMAProcess[{Subscript[a, 1], Subscript[a, 2], Subscript[a, 3]}, 0, {}, σ^2], z]TransferFunctionModel[ARProcess[{Subscript[a, 1], Subscript[a, 2], Subscript[a, 3]}, σ^2], z]% - %%ARProcess is a special case of a SARMAProcess:
TransferFunctionModel[SARMAProcess[{a}, {}, {1, {g}, {}}, σ^2], z]TransferFunctionModel[ARProcess[{a + g, -a g}, σ^2], z]Simplify[% - %%]ARProcess is a special case of a SARIMAProcess:
TransferFunctionModel[SARIMAProcess[{a}, 0, {}, {1, {g}, 0, {}}, σ^2], z]TransferFunctionModel[ARProcess[{a + g, -a g}, σ^2], z]Simplify[% - %%]Squared values of an ARCHProcess follow an AR process:
proc = ARCHProcess[1, {.2, .3}];data = RandomFunction[proc, {10 ^ 4}]["PathStates"];CorrelationFunction and PartialCorrelationFunction of squared values:
dataSQ = data ^ 2;
ListPlot[#[dataSQ, {30}], Filling -> Axis, PlotRange -> {-.2, 1}, PlotLabel -> #]& /@ {CorrelationFunction, PartialCorrelationFunction}The corresponding autoregressive process:
ar = ARProcess[proc]CorrelationFunction and PartialCorrelationFunction of the AR process:
ListPlot[#[ar, {30}], Filling -> Axis, PlotRange -> {-.2, 1}, PlotLabel -> #]& /@ {CorrelationFunction, PartialCorrelationFunction}Cumulated AR process is equivalent to an ARMAProcess:
ar = ARProcess[{a}, v];
proc = TransformedProcess[x[t] + x[t - 1], xar, t];arma = ARMAProcess[{a}, {1}, v];Mean[proc[t]]Mean[arma[t]]Table[CovarianceFunction[proc, t, t + k] - CovarianceFunction[arma, t, t + k], {k, 0, 10}, {t, 1, 10}]//SimplifyPossible Issues (5)
Some properties are defined only for wide-sense stationary processes:
CovarianceFunction[ARProcess[{2, 3, .3}, 1], h]Use FindInstance to find an example of a weakly stationary AR process:
FindInstance[a > 1 && WeakStationarity[ARProcess[{a, b, 1 / 3}, 1]], {a, b}]CovarianceFunction[ARProcess[{3 / 2, -5 / 4, 1 / 3}, 1], h]//DiscretePlot[#, {h, 0, 10}]&A process without specified initial values must satisfy weak stationarity conditions:
ProcessParameterAssumptions[ARProcess[{a}, v]]Some properties will work after specifying initial value(s):
RandomFunction[ARProcess[{1}, 1], {3}]RandomFunction[ARProcess[{1}, 1, {}], {3}]Levinson–Durbin estimation method is not always applicable:
SeedRandom[4];
data = RandomFunction[ARProcess[2, {.4, .2}, 1], {100}];EstimatedProcess[data, ARProcess[c, {.4, b, b}, v], ProcessEstimator -> {"MethodOfMoments", Method -> "LevinsonDurbin"}]EstimatedProcess[data, ARProcess[c, {.4, b, b}, v], ProcessEstimator -> {"MethodOfMoments", Method -> "NSolve"}]The method of moments may not find a solution in estimation:
SeedRandom[4];
data = RandomFunction[ARProcess[2, {.4, .2}, 1], {100}];EstimatedProcess[data, ARProcess[c, {a * b, a, b}, v], ProcessEstimator -> {"MethodOfMoments", Method -> "NSolve"}]EstimatedProcess[data, ARProcess[c, {a * b, a, b}, v], ProcessEstimator -> "MaximumConditionalLikelihood"]Maximum entropy estimation method does not allow fixed or repeated parameters:
SeedRandom[4];
data = RandomFunction[ARProcess[2, {.4, .2}, 1], {100}];EstimatedProcess[data, ARProcess[c, {.1, b, b}, v], ProcessEstimator -> "MaximumEntropy"]EstimatedProcess[data, ARProcess[c, {.1, b, b}, v], ProcessEstimator -> Automatic]Neat Examples (2)
Simulate a weakly stationary three-dimensional ARProcess:
A = {{.2, .1, .1}, {0, -.2, .3}, {.2, -.1, .3}};
S = {{.8, .1, -.2}, {.1, .5, .1}, {-.2, .1, .3}};
proc1 = ARProcess[{A}, S];
data1 = RandomFunction[proc1, {100}]["PathStates"];Graphics3D[{ColorData["SolarColors"][RandomReal[]], Tube@Line@data1}]Non-weakly stationary process, starting at the origin:
B = {{.9, .2, .8}, {-.2, .8, -.3}, {.2, .2, .4}};
S = {{.8, .1, -.2}, {.1, .5, .1}, {-.2, .1, .3}};
proc2 = ARProcess[{B}, S, {}];
data2 = RandomFunction[proc2, {100}]["PathStates"];Graphics3D[{ColorData["SolarColors"][RandomReal[]], Tube@Line@data2}]Simulate paths from an AR process:
SeedRandom[154];
data = RandomFunction[ARProcess[{.3}, 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 -> 55]&[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}], PlotStyle -> (cf /@ Rescale[sd]), BaseStyle -> Directive[Thin, Opacity[0.5]], PlotRangePadding -> {{0, 15}, {.5, .5}}]Related Guides
Text
Wolfram Research (2012), ARProcess, Wolfram Language function, https://reference.wolfram.com/language/ref/ARProcess.html (updated 2014).
CMS
Wolfram Language. 2012. "ARProcess." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/ARProcess.html.
APA
Wolfram Language. (2012). ARProcess. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ARProcess.html
BibTeX
@misc{reference.wolfram_2026_arprocess, author="Wolfram Research", title="{ARProcess}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/ARProcess.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_arprocess, organization={Wolfram Research}, title={ARProcess}, year={2014}, url={https://reference.wolfram.com/language/ref/ARProcess.html}, note=[Accessed: 13-June-2026]}