Create an ARMA processΒΆ

In this basic example we are going to build an ARMA process defined by its linear recurrence coefficients.

In [37]:
from __future__ import print_function
import openturns as ot
import math as m
In [38]:
# Define the recurrence coefficients AR, MA (4,2)
myARCoef = ot.ARMACoefficients([0.4, 0.3, 0.2, 0.1])
myMACoef = ot.ARMACoefficients([0.4, 0.3])
In [39]:
# Define the white noise distribution of the recurrent relation.
myTimeGrid = ot.RegularGrid(0.0, 0.1, 10)
myWhiteNoise = ot.WhiteNoise(ot.Triangular(-1.0, 0.0, 1.0), myTimeGrid)
In [40]:
# Create the process:
process = ot.ARMA(myARCoef, myMACoef, myWhiteNoise)
print(process)
ARMA(X_{0,t} + 0.4 X_{0,t-1} + 0.3 X_{0,t-2} + 0.2 X_{0,t-3} + 0.1 X_{0,t-4} = E_{0,t} + 0.4 E_{0,t-1} + 0.3 E_{0,t-2}, E_t ~ Triangular(a = -1, m = 0, b = 1))
In [41]:
# Draw a sample
sample = process.getSample(6)
sample.drawMarginal(0)
Out[41]:
../../_images/examples_probabilistic_modeling_arma_process_6_0.svg