ts-models-AR1 function

Simulation of an AR(1) time series.

Simulation of an AR(1) time series.

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

where aa is a parameter and ϵt\epsilon_t is independent white noise with marginal distribution specified by the parameter innov.

AR1(n, a, overhead = 500, innov = rnorm)

Arguments

  • n: length of the time series to be returned
  • a: parameter of the model
  • overhead: an integer specifying the ``warmup'' period to reach an approximate stationary start for the times series
  • innov: a function that generates a random number each time innov(1) is called; used to specify the distribution of the innovations; rnorm by default

Returns

Returns an AR(1) time series with specified parameters.

Description

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

Yt=aYt1+ϵt, Y_t = a Y_{t-1} + \epsilon_t,

where aa is a parameter and ϵt\epsilon_t is independent white noise with marginal distribution specified by the parameter innov.

Examples

plot(AR1(100, a=-0.7), type="l")
  • Maintainer: Tobias Kley
  • License: GPL (>= 2)
  • Last published: 2024-07-11