# arfima.sim: Simulate ARFIMA Process In nsarfima: Methods for Fitting and Simulating Non-Stationary ARFIMA Models

## Description

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

## Usage

  1 2 3 4 5 6 7 8 9 10 11 12 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 (φ and θ, respectively), along with the fractional differencing parameter d. When d≥q 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:

≤ft(1 - ∑_{i=1}^p φ_i B^i\right)≤ft(1 - B\right)^d (y_t - μ)=≤ft(1 + ∑_{i=1}^q θ_i B^i\right) ε_t

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

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

≤ft(1 - ∑_{i=1}^p φ_i B^i\right)(1 - B)^d (x_t - μ)=≤ft(1 + ∑_{i=1}^q θ_i B^i\right) ε_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 μ is added to the series after filtering and before any truncation. When stat.int = TRUE, x_t - μ is generated from filtered residuals, μ 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

 1 2 3 4 5 6 ## 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) 

### Example output




nsarfima documentation built on Aug. 6, 2020, 5:10 p.m.