create_arp_data: Create data using an AR(1)

Description Usage Arguments Value

View source: R/VAR-1-simulation.R

Description

Given some starting values, coefficients and a sequence of error vectors, create_arp_data will compute a sequence of observables through a univariate autoregressive model.

Usage

1
create_arp_data(a, y0, e = rnorm(N), N = 100, intercept = FALSE)

Arguments

a

A numeric vector, specifying the lag coefficients. Its length will determine the maximum lag order p.

y0

A numeric vector, providing pre-sample observations. Its length must be at minimum p (see above).

e

A numeric vector, containing the innovations that hit the system. If unspecified, it will be drawn from a standard normal distribution.

N

An integer scalar. The sample size. Defaults to N = 100.

intercept

A logical scalar. If the first entry of a is the value of the intercept, set to TRUE. Otherwise leave at FALSE.

Value

An numeric vector of length N.


nielsaka/zeitreihe documentation built on March 17, 2020, 8:38 p.m.