Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/changepoints_lin1.R
This function detects change points for parameter changes of a linear AR(1) model without intercept based on simplicial depth. The model is defined by
Y_n = θ_{1} \cdot Y_{n-1} + E_n
with med(E_n)=0. The main idea is based on estimation and confidence intervalconstruction based on simplicial depth as proposed in Kustosz (2016). Thereby, the applied depth notion is given by the full simplicial depth.
1 | changepoints_lin1(y, level, bw, sw, plots = FALSE, method = "m1", mincper = 1, mincp = 1)
|
y |
An observed AR(1) process without intercept. |
level |
The level for which the confidence intervals for the phase change detection are calculated. |
bw |
A bandwidth, defining the sample size for sub-samples which are evaluated in the algorithm. |
sw |
A step-width to reduce the candidate points in which the change points are evaluated. |
plots |
A switch, activating plots while the calculations are preformed. The plots show the confidence regions for the actually considered windows. |
method |
This parameter determines the method to detect change points. If |
mincper |
Percentage to define relevant change-point clusters based on the length of the 'mincp' longest detected cluster. |
mincp |
The 'mincp' longest cluster is used to define a threshold for detected clusters which are considered for final break-point estimates. This implies, that (if enough clusters exist), the number also defines the minimal number of changes, found by the algorithm. |
. For details see Kustosz (2016).
candidates |
A vector of observation indices in which the algorithm tested for change points. |
changepoints |
A vector indicating, if a change point was detected in the respective candidate. |
Kustosz, Christoph
Kustosz, C. (2016). Depth based estimators and tests for
autoregressive processes with application. Ph. D. thesis. TU Dortmund.
RandomARMod_lin2
, lin1_CI
, est_lin1
, dS_lin1
, dS_lin1_test
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | int1 <- 0
int2 <- 0
arp1 <- 1.001
arp2 <- 1.02
set.seed(17)
y1 <- RandomARMod_lin2(50, int1, arp1, 15, "3")
y2 <- RandomARMod_lin2(50, int2, arp2, y1[length(y1)], "3")
y <- c(y1, y2)
CP1 <- changepoints_lin1(y, 0.99, 25, 5, plots = FALSE, method = "m1")
CP2 <- changepoints_lin1(y, 0.99, 25, 5, plots = FALSE, method = "m2")
par(mfrow=c(2,1))
plot(y, type="l")
abline(v=CP1$candidates[CP1$changepoints==1], col=2,lty=2)
abline(v=CP2$candidates[CP2$changepoints==1], col=3,lty=3)
plot(y, type="l")
abline(v=CP1$rjumps, col=2,lty=3,lwd=2)
abline(v=CP2$rjumps, col=3,lty=3,lwd=3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.