resARMod_linar2: Residuals of a AR(2) process without intercept

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

View source: R/resARMod_linar2.R

Description

The function calculates the residuals of an AR(2) process without intercept for given parameter and data based on

r_n = y_n - θ_1 y_{n-1} - θ_2 y_{n-2}

Usage

1
resARMod_linar2(theta, dat)

Arguments

theta

Parameter vector θ= (θ_1,θ_2).

dat

One dimensional observation vector y=(y_0,...,y_N).

Value

The output is a vector with N elements defined by r = (r_1,...,r_N).

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

RandomARMod_linar2,dS_lin2,dS1_lin2,dS2_lin2,dS3_lin2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Minimal Example
y <- c(1, 2, 3)
theta <- c(1, 1)
resARMod_linar2(theta, y)

## Generating an example process in advance
theta <- c(0.6, 0.44)
N <- 100
y0 <- c(13, 14)
y <- RandomARMod_linar2(nobs = N, arp1 = theta[1], arp2 = theta[2], start = y0)

res <- resARMod_linar2(theta, y)
par(mfrow=c(1, 2))
plot(res)
hist(res)

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