ts-models-AR2: Simulation of an AR(2) time series.

Description Usage Arguments Value Examples

Description

Returns a simulated time series (Y_t) that fulfills the following equation:

Y_t = a_1 Y_{t-1} + a_2 Y_{t-2} + ε_t,

where a_1 and a_2 are parameters and ε_t is independent white noise with marginal distribution specified by the parameter innov.

Usage

1
AR2(n, a1, a2, overhead = 500, innov = rnorm)

Arguments

n

length of the time series to be returned

a1

parameter

a2

parameter

overhead

an integer specifying the “warmup” period to reach an approximate stationary start for the times series

innov

a function with one parameter n that yields n independent pseudo random numbers each time it is called.

Value

Return an AR(2) time series with specified parameters.

Examples

1
plot(AR2(100, a1=0, a2=0.5), type="l")

quantspec documentation built on July 15, 2020, 1:07 a.m.