Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gen_ar1

Generate an Autoregressive Order 1 ( AR(1) ) sequence


Description

Generate an Autoregressive Order 1 sequence given φ and σ^2.

Usage

gen_ar1(N, phi = 0.3, sigma2 = 1)

Arguments

N

An unsigned integer for signal length.

phi

A double that contains autocorrection.

sigma2

A double that contains process variance.

Details

The function implements a way to generate the AR(1)'s x[t] values without calling the general ARMA function. Thus, the function is able to generate values much faster than gen_arma.

Value

A vec containing the AR(1) process.

Process Definition

The Autoregressive order 1 (AR1) process with non-zero parameter phi in (-1,1) and sigma^2 in R^{+}. This process is defined as:

X[t] = phi[1]X[t-1] + W[t]

, where

W[t] ~ N(0,sigma^2) iid

AR(1) processes are sometimes used as an approximation for Bias Instability noises.

Generation Algorithm

The function first generates a vector of White Noise with length N+1 using gen_wn and then obtains the autoregressive values under the above process definition.

The X[0] (first value of X[t]) is discarded.


simts

Time Series Analysis Tools

v0.1.1
AGPL-3 | file LICENSE
Authors
Stéphane Guerrier [aut, cre, cph], James Balamuta [aut, cph], Roberto Molinari [aut, cph], Justin Lee [aut], Yuming Zhang [aut], Wenchao Yang [ctb], Nathanael Claussen [ctb], Yunxiang Zhang [ctb], Christian Gunning [cph], Romain Francois [cph], Ross Ihaka [cph], R Core Team [cph]
Initial release
2019-07-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.