Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/resARMod_lin2.R
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}
1 | resARMod_lin2(theta, dat)
|
theta |
Parameter vector θ=(θ_0,θ_1). |
dat |
One dimensional observation vector y=(y_0,...,y_N). |
Details can be found in Kustosz (2016). The function is mainly used to calculate the residuals in the simplicial depth statistics.
The output is a vector with N elements defined by r = (r_1,...,r_N).
Kustosz, Christoph
Kustosz, C. (2016). Depth based estimators and tests for
autoregressive processes with application. Ph. D. thesis. TU Dortmund.
RandomARMod_lin2
,dS_lin2
,dS1_lin2
,dS2_lin2
,dS3_lin2
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.