Learn R Programming

ssaBSS (version 0.1.1)

rtvvar: Simulation of Time Series with Time-varying Variance

Description

Simulating time-varying variance based on TV-VAR model

Usage

rtvvar(n, alpha, beta = 1, simple = FALSE)

Value

The simulated series as a ts object.

Arguments

n

Length of the time series

alpha

Parameter \(\alpha\) in TV-VAR

beta

Parameter \(\beta\) in TV-VAR. Default is 1.

simple

A logical vector indicating whether \(h_t\) is considered as its own process, or just \(t/T\). Default is FALSE.

Author

Sara Taskinen, Markus Matilainen

Details

Time varying variance (TV-VAR) process \(x_t\) with parameters \(\alpha\) and \(\beta\) is of the form $$x_t = \tilde h_t \epsilon_t,$$ where, if simple = FALSE, $$\tilde h_t^2 = h_t^2 + \alpha x_{t-1}^2,$$ where \(\epsilon\) are iid \(N(0,1)\), \(x_0 = 0\) and \(h_t = 10 - 10 \sin(\beta \pi t/T + \pi/6) (1 + t/T)\),

and if simple = TRUE, $$\tilde h_t = t/T.$$

References

Patilea V. and Raïssi H. (2014) Testing Second-Order Dynamics for Autoregressive Processes in Presence of Time-Varying Variance, Journal of the American Statistical Association, 109 (507), 1099-1111.

Examples

Run this code

n <- 5000
X <- rtvvar(n, alpha = 0.2, beta = 0.5, simple = FALSE)
plot(X)

Run the code above in your browser using DataLab