sim_tvarma12 {beyondWhittle}R Documentation

simulate from the tvARMA(1,2) process for illustration

Description

simulate from the tvARMA(1,2) process for illustration

Usage

sim_tvarma12(
  len_d,
  dgp = NULL,
  ar_order = 1,
  ma_order = 2,
  a1 = NULL,
  b1 = NULL,
  b2 = NULL,
  innov_distribution = NULL,
  wn = NULL
)

Arguments

len_d

a positive integer indicating the length of the simulated process.

dgp

optional: the tv-ARMA models demonstrated in section 4.2 of Tang et al. (2023). Should be chosen from "LS1", "LS2" and "LS3". See section Details.

ar_order, ma_order, a1, b1, b2

If dgp is not supplied, these arguments can be used to specify customized tv-ARMA process (up to order(1,2)). See details.

innov_distribution

optional: the distributions of innovation used in section 4.2.2 of Tang et al. (2023) . Should be chosen from "a", "b", "c". "a" denotes standard normal distribution, "b" indicates standardized Student-t distribution with degrees of freedom 4 and "c" denotes standardized Pareto distribution with scale 1 and shape 4.

wn

If innov_distribution is not specified, one may supply its own innovation sequence. Please make sure the length of wn is at least the sum of len_d and the MA order of the process. If ma_order is specified, then MA order is exactly ma_order. If dgp is specified, the MA order of "LS1", "LS2" and "LS3" can be found in section Details below.

Details

This function simulates from the following time-varying Autoregressive Moving Average model with order (1,2):

Xt,T = a1(tT) Xt-1,T + wt + b1(tT) wt-1 + b2(tT) wt-2, t=1,2,...,T,

where T is the length specified and {wt} are a sequence of i.i.d. random variables with mean 0 and standard deviation 1.

For dgp = "LS1", it is a tvMA(2) process (MA order is 2) with

a1(u)=0, b1(u)=1.122(1-1.178sin(π/2 u)), b2(u)=-0.81.

For dgp = "LS2", it is a tvMA(1) process (MA order is 1) with

a1(u)=0, b1(u)=1.1cos(1.5-cos(4π u)), b2(u)=0.

For dgp = "LS3", it is a tvAR(1) process (MA order is 0) with

a1(u)=1.2u-0.6, b1(u)=0, b2(u)=0.

Value

a numeric vector of length len_d simulated from the given process.

References

Tang et al. (2023) Bayesian nonparametric spectral analysis of locally stationary processes ArXiv preprint <arXiv:2303.11561>

Examples

## Not run: 
sim_tvarma12(len_d = 1500, 
dgp = "LS2", 
innov_distribution = "a") # generate from LS2a

sim_tvarma12(len_d = 1500, 
dgp = "LS2", 
wn = rnorm(1502)) # again, generate from LS2a

sim_tvarma12(len_d = 1500, 
ar_order = 0, 
ma_order = 1, 
b1 = function(u){1.1*cos(1.5 - cos(4*pi*u))}, 
innov_distribution = "a") # again, generate from LS2a

sim_tvarma12(len_d = 1500, 
ar_order = 0, 
ma_order = 1, 
b1 = function(u){1.1*cos(1.5 - cos(4*pi*u))}, 
wn = rnorm(1502)) # again, generate from LS2a

## End(Not run)

[Package beyondWhittle version 1.2.1 Index]