Learn R Programming

sparsevar (version 1.0.0)

simulate_var: VAR simulation

Description

This function generates a simulated multivariate VAR time series.

Usage

simulate_var(n, p, nobs, rho, sparsity, mu, method, covariance, ...)

Value

A a list of NxN matrices ordered by lag

data a list with two elements: series the multivariate time series and noises the time series of errors

S the variance/covariance matrix of the process

Arguments

n

dimension of the time series (default n = 100).

p

number of lags of the VAR model (default p = 1).

nobs

number of observations to be generated (default nobs = 250).

rho

base value for the covariance matrix (default rho = 0.5).

sparsity

density (in percentage) of the number of nonzero elements of the VAR matrices (default sparsity = 0.05).

mu

a vector containing the mean of the simulated process (default mu = 0).

method

which method to use to generate the VAR matrix. Possible values are "normal" or "bimodal" ((default method = "normal")).

covariance

type of covariance matrix to use in the simulation. Possible values: "Toeplitz", "block1", "block2", "Wishart" or simply "diagonal" (default covariance = "Toeplitz").

...

the options for the simulation. These are: muMat: the mean of the entries of the VAR matrices; sdMat: the sd of the entries of the matrices;