carfima.sim: Simulating a CARFIMA(p,H,q) time series

Description Usage Arguments Value Details References Examples

Description

The function carfima.sim produces discrete time series data that follow a CARFIMA(p,H,q) model given the values for the model parameters and observation times.

Usage

1
carfima.sim(parameter, time, ar.p, ma.q)

Arguments

parameter

A vector of length p+q+2 for the generative values of the model parameters; p values of α_j's, q values of β_j's, H and σ.

time

A vector for the k observation times, either regularly or irregularly spaced.

ar.p

A scalar for the order of the AR model.

ma.q

A scalar for the order of the MA model.

Value

The outcome of carfima.sim is a vector for k simulated data following a CARFIMA(p,H,q) model given the values for the model parameters and observation times.

Details

This function produces simulated discrete time series data following a CARFIMA(p,H,q) model given the values for the model parameters and observation times. It first derives a k-dimensional multivariate Gaussian distribution whose mean set to a vector of zeroes, where k is the number of observations. The covariance matrix is then filled with Cov(Y_{t_i}, Y_{t_j}) and its closed-form formula is specified in Theorem 1(b) and 1(c) of Tsai and Chan (2005).

References

\insertRef

tsai_maximum_2005carfima

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
##### Irregularly spaced observation time generation.
##### For CRAN testing, time is set to be very short.

length.time <- 10
time.temp <- rexp(length.time, rate = 2)
time <- rep(NA, length.time + 1)
time[1] <- 0
for (i in 2 : (length.time + 1)) {
  time[i] <- time[i - 1] + time.temp[i - 1]
}
time <- time[-1]

##### Data genration for CARFIMA(1, H, 0) based on the observation times. 

parameter <- c(-0.4, 0.75, 0.2) 
# AR parameter alpha = -0.4
# Hurst parameter = 0.75
# process uncertainty sigma = 0.2
y <- carfima.sim(parameter = parameter, time = time, ar.p = 1, ma.q = 0)  

 

kisungyou/carfima documentation built on May 13, 2019, 5:24 p.m.