sim.varma {ldt}R Documentation

Generate Random Sample from a VARMA Model

Description

This function generates a multivariate time series using a VARMA process.

Usage

sim.varma(
  sigma = 2L,
  arList = 1L,
  maList = 0L,
  exoCoef = 0L,
  nObs = 100,
  nBurn = 10,
  intercept = TRUE,
  d = 0,
  startFrequency = NULL,
  seasonalCoefs = NULL
)

Arguments

sigma

A positive definite matrix representing the covariance matrix of the white noise series or an integer representing the dimension of a random covariance matrix to generate.

arList

A list of matrices representing the AR coefficients of the VARMA model or an integer representing the number of random AR coefficients to generate.

maList

A list of matrices representing the MA coefficients of the VARMA model or an integer representing the number of random MA coefficients to generate. For identification purposes, it generates diagonal matrices.

exoCoef

A matrix representing the coefficients of the exogenous variables or an integer representing the number of random exogenous coefficients to generate.

nObs

An integer representing the number of observations to generate.

nBurn

An integer representing the number of burn-in observations to remove from the generated time series.

intercept

A numeric vector representing the intercept of the VARMA model or a logical value indicating whether to generate a random intercept.

d

An integer representing the order of integration.

startFrequency

The frequency of the first observation in the data.

seasonalCoefs

An integer vector of size 4: (P,D,Q,s) where P is the number of random seasonal AR coefficients to generate, Q is the number of random seasonal MA coefficients to generate, D is the order of seasonal integration, and s is the number of seasons. These are effective if arList and maList are randomly generated within the function.

Value

A list with the following items:

y

The simulated endogenous data.

x

The simulated exogenous data.

e

The simulated white noise series.

sigma

The covariance matrix of the white noise series.

arList

The list of autoregressive coefficients.

maList

The list of moving average coefficients.

exoCoef

The matrix of exogenous coefficients.

intercept

The intercept vector.

d

The order of the integration.

seasonalCoefs

The argument seasonalCoefs

nObs

The number of observations generated.

nBurn

The number of burn-in observations removed.

Examples

sample1 <- sim.varma(2L, 3L, 2L)

ar1 <- matrix(c(0.7,0.2,-0.4,0.3),2,2)
ar2 <- matrix(c(-0.4,0.1,0.2,-0.3),2,2)
ma1 <- matrix(c(0.5,-0.1,0.3,0.4),2,2)
Sigma <- matrix(c(1,0.3,0.3,1),2,2)
B <- matrix(c(0.5,-0.3),2)

sample2 <- sim.varma(Sigma, list(ar1, ar2), list(ma1), exoCoef = B ,
                    nObs =100, nBurn =10 , intercept = c(1,-1))

# Plot the y series
matplot(sample2$y,type = "l")

# see the examples in 'estim.varma' or 'search.varma' functions

[Package ldt version 0.5.3 Index]