linear_simu: Simulating Linear process model

View source: R/mean.R

linear_simuR Documentation

Simulating Linear process model

Description

Simulate a p dimensional Linear process model with length n.

Usage

linear_simu(n, mu, M.list, rho, K = 1001, err.dist = "t3", ...)

Arguments

n

A strictly positive integer corresponding to the length of output series.

mu

A numeric vector of mean of VAR2 model.

M.list

A list of p x p matrices, and (rho^(k-1)*M.list[[k]]) be the transition matrix for lag-k term.

rho

A scalar in (0,1) indicating the decay rate of the transition matrix for lag-k term as the k grows.

K

A strictly positive integer and (K-1) represents the number of lags considered.

err.dist

A character string, such as "normal", "pareto", "lognorm" or "t4", indicating the distribution of innovations.

...

Additional arguments.

Value

A p x n matrix corresponding to the simulated data

Author(s)

Haotian Xu

Examples

n = 100
p = 100
K = 1001
set.seed(123)
M.list = vector(mode = "list", length = K)
for(ll in 1:K){
  M.list[[ll]] = matrix(rnorm(p^2), nrow = p)
}
X = linear_simu(n = n, mu = rep(0, p), M.list = M.list, rho = 0.7, err.dist = "pareto")
dim(X)


HaotianXu/rcov documentation built on May 14, 2023, 5:04 a.m.