ts-models-AR2 function

Simulation of an AR(2) time series.

Simulation of an AR(2) time series.

Returns a simulated time series (Yt)(Y_t) that fulfills the following equation: [REMOVE_ME]Yt=a1Yt1+a2Yt2+ϵt,[REMOVEME2] Y_t = a_1 Y_{t-1} + a_2 Y_{t-2} + \epsilon_t, [REMOVE_ME_2]

where a1a_1 and a2a_2 are parameters and ϵt\epsilon_t is independent white noise with marginal distribution specified by the parameter innov.

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.

Returns

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

Description

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

Yt=a1Yt1+a2Yt2+ϵt, Y_t = a_1 Y_{t-1} + a_2 Y_{t-2} + \epsilon_t,

where a1a_1 and a2a_2 are parameters and ϵt\epsilon_t is independent white noise with marginal distribution specified by the parameter innov.

Examples

plot(AR2(100, a1=0, a2=0.5), type="l")
  • Maintainer: Tobias Kley
  • License: GPL (>= 2)
  • Last published: 2024-07-11