arfima.sim {nsarfima}R Documentation

Simulate ARFIMA Process

Description

Simulates a series under the given ARFIMA model by applying an MA filter to a series of innovations.

Usage

arfima.sim(
  n,
  d = 0,
  ar = numeric(),
  ma = numeric(),
  mu = 0,
  sig2 = 1,
  stat.int = FALSE,
  n.burn,
  innov,
  exact.innov = TRUE
)

Arguments

n

Desired series length.

d

Fractional differencing parameter.

ar

Vector of autoregressive parameters.

ma

Vector of moving average parameters, following the same sign convention as arima.

mu

Mean of process. By default, added after integer integration but before burn-in truncation (see stat.int).

sig2

Innovation variance if innovations not provided.

stat.int

Controls integration for non-stationary values of d (i.e. d>=0.5). If TRUE, d split into integer part and stationary part, which will result in a trend when d>=0.5 and mu!=0.

n.burn

Number of burn-in steps. If not given, chosen based off presence of long memory (i.e. d>0).

innov

Series of innovations. Drawn from normal distribution if not given.

exact.innov

Whether to force the exact innovation series to be used. If FALSE, innovations will be prepended with resampled points as needed to match n+n.burn.

Details

The model is defined by values for the AR and MA parameters (\phi and \theta, respectively), along with the fractional differencing parameter d. When d\geq 0.5, then the integer part is taken as m=\lfloor d+0.5\rfloor, and the remainder (between -0.5 and 0.5) stored as d. For m=0, the model is:

\left(1 - \sum_{i=1}^p \phi_i B^i\right)\left(1 - B\right)^d (y_t - \mu)=\left(1 + \sum_{i=1}^q \theta_i B^i\right) \epsilon_t

where B is the backshift operator (B y_t = y_{t-1}) and \epsilon_t is the innovation series. When m > 0, the model is defined by:

y_t = (1 - B)^{-m}x_t

\left(1 - \sum_{i=1}^p \phi_i B^i\right)(1 - B)^d (x_t - \mu)=\left(1 + \sum_{i=1}^q \theta_i B^i\right) \epsilon_t

When stat.int = FALSE, the differencing filter applied to the innovations is not split into parts, and the series model follows the first equation regardless of the value of d. This means that \mu is added to the series after filtering and before any truncation. When stat.int = TRUE, x_t - \mu is generated from filtered residuals, \mu is added, and the result is cumulatively summed m times. For non-zero mean and m>0, this will yield a polynomial trend in the resulting data.

Note that the burn-in length may affect the distribution of the sample mean, variance, and autocovariance. Consider this when generating ensembles of simulated data

Value

A numeric vector of length n.

Examples

## Generate ARFIMA(1,d,0) series with Gaussian innovations
x <- arfima.sim(1000, d=0.6, ar=c(-0.4)) 

## Generate ARFIMA(1,d,0) series with uniform innovations.
innov.series <- runif(1000, -1, 1)
x <- arfima.sim(1000, d=0.6, ar=c(-0.4), innov=innov.series, exact.innov=TRUE)

[Package nsarfima version 0.2.0.0 Index]