7.8.4.1. statsmodels.tsa.arima_process.ArmaProcess¶
-
class
statsmodels.tsa.arima_process.
ArmaProcess
(ar, ma, nobs=100)[source]¶ Represent an ARMA process for given lag-polynomials
This is a class to bring together properties of the process. It does not do any estimation or statistical analysis.
Parameters: ar : array_like, 1d
Coefficient for autoregressive lag polynomial, including zero lag. See the notes for some information about the sign.
ma : array_like, 1d
Coefficient for moving-average lag polynomial, including zero lag
nobs : int, optional
Length of simulated time series. Used, for example, if a sample is generated. See example.
Notes
As mentioned above, both the AR and MA components should include the coefficient on the zero-lag. This is typically 1. Further, due to the conventions used in signal processing used in signal.lfilter vs. conventions in statistics for ARMA processes, the AR paramters should have the opposite sign of what you might expect. See the examples below.
Examples
>>> import numpy as np >>> np.random.seed(12345) >>> arparams = np.array([.75, -.25]) >>> maparams = np.array([.65, .35]) >>> ar = np.r_[1, -ar] # add zero-lag and negate >>> ma = np.r_[1, ma] # add zero-lag >>> arma_process = sm.tsa.ArmaProcess(ar, ma) >>> arma_process.isstationary True >>> arma_process.isinvertible True >>> y = arma_process.generate_sample(250) >>> model = sm.tsa.ARMA(y, (2, 2)).fit(trend='nc', disp=0) >>> model.params array([ 0.79044189, -0.23140636, 0.70072904, 0.40608028])
Methods
__init__
(ar, ma[, nobs])acf
([nobs])theoretical autocorrelation function of an ARMA process acovf
([nobs])theoretical autocovariance function of ARMA process arma2ar
([nobs])arma2ma
([nobs])from_coeffs
(arcoefs, macoefs[, nobs])Create ArmaProcess instance from coefficients of the lag-polynomials from_estimation
(model_results[, nobs])Create ArmaProcess instance from ARMA estimation results generate_sample
([nsample, scale, distrvs, ...])generate ARMA samples impulse_response
([nobs])get the impulse response function (MA representation) for ARMA process invertroots
([retnew])make MA polynomial invertible by inverting roots inside unit circle pacf
([nobs])partial autocorrelation function of an ARMA process periodogram
([nobs])periodogram for ARMA process given by lag-polynomials ar and ma Attributes
arroots
Roots of autoregressive lag-polynomial isinvertible
Arma process is invertible if MA roots are outside unit circle isstationary
Arma process is stationary if AR roots are outside unit circle maroots
Roots of moving average lag-polynomial