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

View source: R/dynamicWhittle_prior_and_mcmc_params.R

sim_tvarma12R 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. (2025). 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. (2025) . 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):

X_{t,T} = a_1(t/T)X_{t-1,T} + w_{t} + b_1(t/T) w_{t-1} + b_2(t/T) w_{t-2}, \quad t=1,2,\cdots,T,

where T is the length specified and \{w_t\} 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

a_1(u)=0, b_1(u)= 1.122(1 - 1.178\sin(\pi/2~u)), b_2(u) = -0.81.

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

a_1(u)=0, b_1(u)= 1.1\cos\left(1.5 - \cos\left(4\pi u \right) \right), b_2(u) = 0.

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

a_1(u)=1.2u-0.6, b_1(u)= 0, b_2(u) = 0.

Value

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

References

Tang et al. (2025) Bayesian nonparametric spectral analysis of locally stationary processes JASA <doi:10.1080/01621459.2025.2594191>

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)

beyondWhittle documentation built on April 15, 2026, 9:06 a.m.