Testing for Change Points in Time Series via Polynomial Regression
Testing for Change Points in Time Series via Polynomial Regression
The function uses a nonlinear polynomial regression model in which it tests for the null hypothesis of structural stability in the regression parameters against the alternative of a break at an unknown time. The method is based on the extreme value distribution of a maximum-type test statistic which is asymptotically equivalent to the maximally selected likelihood ratio. The resulting testing approach is easily tractable and delivers accurate size and power of the test, even in small samples if(!exists(".Rdpack.currefs")) .Rdpack.currefs <-new.env();Rdpack::insert_citeOnly(keys="Aue_etal_2008",package="funtimes",cached_env=.Rdpack.currefs) .
y: a vector that contains univariate time series observations. Missing values are not allowed.
a.order: order of the autoregressive model which must be a non-negative integer number.
alpha: significance level for testing hypothesis of no change point. Default value is 0.05.
crit.type: method of obtaining critical values: "asymptotic" (default) or "bootstrap".
bootstrap.method: type of bootstrap if crit.type = "bootstrap": "nonparametric" (default) or "parametric".
num.bootstrap: number of bootstrap replications if crit.type = "bootstrap". Default number is 1000.
Returns
A list with the following components: - index: time point where the change point has occurred.
stat: test statistic.
crit.val: critical region value (CV(alpha, n)).
p.value: p-value of the change point test.
Examples
## Not run:#Example 1:#Simulate some time series:set.seed(23450)series_1 = rnorm(137,3,5)series_2 = rnorm(213,0,1)series_val = c(series_1, series_2)AuePolyReg_test(series_1,1)# no change (asymptotic)AuePolyReg_test(series_val,1)# one change (asymptotic)#Example 2:#Consider a time series with annual number of world terrorism incidents from 1970 till 2016:c.data = Ecdat::terrorism["incidents"]incidents.ts <- ts(c.data, start =1970, end =2016)#Run a test for change points:AuePolyReg_test(incidents.ts,2)# one change (asymptotic)AuePolyReg_test(incidents.ts,2,0.05,"bootstrap","parametric",200)# one change (bootstrap)incidents.ts[44]#number of victims at the value of change pointyear <-197+44-1# year when the change point occurredplot(incidents.ts)# see the visualized data#The structural change point occurred at the 44th value which corresponds to 2013, #with 11,990 identified incidents in that year. These findings can be explained with #a recent rise of nationalism and extremism due to appearance of the social media, #Fisher (2019): White Terrorism Shows 'Stunning' Parallels to Islamic State's Rise. #The New York Times.## End(Not run)