resARMod_lin2: Reisduals of an linar AR(1) process

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

View source: R/resARMod_lin2.R

Description

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

r_n = y_n - θ_0 - θ_1 y_{n-1}

Usage

1
resARMod_lin2(theta, dat)

Arguments

theta

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

dat

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

Details

Details can be found in Kustosz (2016). The function is mainly used to calculate the residuals in the simplicial depth statistics.

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_lin2,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_lin2(theta, y)

## Generating an example process in advance
theta <- c(0.2, 1.01)
N <- 100
y0 <- 1
y <- RandomARMod_lin2(nobs = N, intercept = theta[1], arp = theta[2], start = y0)

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

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