RandomARMod_linar2: Ramdom linear AR(2) Series

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/RamdomARMod_linar2.R

Description

The function generates an random linear AR(2) process with given autoregression parameters and starting value. Further the errors can be specified by 4 predefined examples. The main equation is given by

Y_n = θ_1 * Y_{n-1} + θ_2 * Y_{n-2} + E_n,

, whereby E_n are i.i.d with med(E_n)=0 and y_0 is fixed and known.

Usage

1
RandomARMod_linar2(nobs, arp1, arp2, start, cont = "0")

Arguments

nobs

Number of observations for the process to generate.

arp1

Autoregression parameter θ_1.

arp2

Autoregression parameter θ_2.

start

Starting value of the process y_0, y_1 given by a vector c(y0,y1).

cont

Error distribution defined by value in ("0","1","2","3","4").
"0" : E_n is i.i.d. N(0,sd) distributed.
"1" : E_n is i.i.d. N(0,sd) distributed, but in Pois(5/100) drawn points in time N(5,1) errors are added.
"2" : E_n is i.i.d. Gumbel distributed with parameters 10 and -3.665129.
"3" : E_n is i.i.d. Frechet distributed with parameters 1.928, -2, 10.
"4" : E_n is i.i.d. Gamma distributed with paramters 1 and 1. Further the errors are centered by -0.6932 to satisfy a med(E_n)=0 condition.

Details

All error distributions are chosen to satistify med(E_n)=0. Remarks on the error distributions can be found in Kustosz (2016).

Value

the function returns a vector (y_0,...,y_N) which is a simulation of the AR process given by the input paramters

Author(s)

Kustosz, Christoph

References

Kustosz, C. (2016). Depth based estimators and tests for autoregressive processes with application. Ph. D. thesis. TU Dortmund.

See Also

dS1_lin2, dS2_lin2, dS3_lin2, dS_lin2

Examples

1
2
y <- RandomARMod_linar2(100, 0.4, 0.6, c(5, 5), "1")
plot(y, type="l")

ChrisKust/rexpar documentation built on May 6, 2019, 11:48 a.m.