# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.timeseries.linear.univariate.arima

## Class ARIMASim

• java.lang.Object
• com.numericalmethod.suanshu.stats.timeseries.linear.univariate.arima.ARIMASim
• All Implemented Interfaces:
RandomNumberGenerator, Seedable

public class ARIMASim
extends Object
implements RandomNumberGenerator
This class simulates an ARIMA (AutoRegressive Integrated Moving Average) process. It a generalization of an AutoRegressive Moving Average (ARMA) model. It is applied in some cases where data show evidence of non-stationarity, where an initial differencing step (corresponding to the "integrated" part of the model) can remove the non-stationarity.

An ARMA model is a tool for understanding and, perhaps, predicting future values in this series. The model consists of two parts, an autoregressive (AR) part and a moving average (MA) part. It is usually denoted as ARMA(p, q) where p is the order of the autoregressive part and q the order of the moving average part. The notation AR(p) refers to the autoregressive model of order p. It is defined as the weighted sum of the lagged values, a constant, and a white noise. The notation MA(q) refers to the autoregressive model of order q. It is defined as the weighted sum of the lagged white noises and a drift. That is, a moving average model is conceptually a linear regression of the current value of the series against previous (unobserved) white noise error terms or random shocks. The random shocks are supposed to propagate to future values of the time series.

• ### Constructor Summary

Constructors
Constructor and Description
ARIMASim(ARIMAModel arima)
Construct an ARIMA model, using random standard Gaussian innovations.
ARIMASim(ARIMAModel arima, double[] lags, double[] innovations, RandomNumberGenerator rng)
Construct an ARIMA model.
ARIMASim(ARIMAModel arima, RandomNumberGenerator rng)
Construct an ARIMA model.
• ### Method Summary

All Methods
Modifier and Type Method and Description
double nextDouble()
Get the next random double.
void seed(long... seeds)
Seed the random number/vector/scenario generator to produce repeatable experiments.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### ARIMASim

public ARIMASim(ARIMAModel arima,
double[] lags,
double[] innovations,
RandomNumberGenerator rng)
Construct an ARIMA model.
Parameters:
arima - an ARIMA model
lags - the lags of AR length; lags[0] is $$x_{t-1}$$
innovations - the innovations of MA length; innovations[0] is $$e_{t-1}$$
rng - a random number generator to generate innovations
• #### ARIMASim

public ARIMASim(ARIMAModel arima,
RandomNumberGenerator rng)
Construct an ARIMA model. The lags and innovations are initialized to 0.
Parameters:
arima - an ARIMA model
rng - a random number generator to generate innovations
• #### ARIMASim

public ARIMASim(ARIMAModel arima)
Construct an ARIMA model, using random standard Gaussian innovations.
Parameters:
arima - an ARIMA model
• ### Method Detail

• #### seed

public void seed(long... seeds)
Description copied from interface: Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments.
Specified by:
seed in interface Seedable
Parameters:
seeds - the seeds
• #### nextDouble

public double nextDouble()
Description copied from interface: RandomNumberGenerator
Get the next random double.
Specified by:
nextDouble in interface RandomNumberGenerator
Returns:
the next random number