Learn R Programming

strucchange (version 1.0-2)

efp: Empirical Fluctuation Processes

Description

Computes an empirical fluctuation process according to a specified method from the generalized fluctuation test framework, which includes CUSUM, MOSUM and estimates-based tests.

Usage

efp(formula, data, type = <>, h = 0.15, dynamic = FALSE,
    rescale = TRUE, tol = 1e-7)

Arguments

formula
a symbolic description for the model to be tested.
data
an optional data frame containing the variables in the model. By default the variables are taken from the environment which efp is called from.
type
specifies which type of fluctuation process will be computed. For details see below.
h
a numeric from interval (0,1) sepcifying the bandwidth. determins the size of the data window relative to sample size (for MOSUM and ME processes only).
dynamic
logical. If TRUE the lagged observations are included as a regressor.
rescale
logical. If TRUE the estimates will be standardized by the regressor matrix of the corresponding subsample according to Kuan & Chen (1994); if FALSE the whole regressor matrix will be used. (only if type
tol
tolerance when solve is used

Value

  • efp returns a list of class "efp" with components inlcuding
    • process
    {the fitted empirical fluctuation process of class "ts" or "mts" respectively,}
  • typea string with the type of the process fitted,
  • nregthe number of regressors,
  • nobsthe number of observations,
  • parthe bandwidth h used.

Details

If type is one of "Rec-CUSUM", "OLS-CUSUM", "Rec-MOSUM" or "OLS-MOSUM" the function efp will return a one-dimensional empiricial process of sums of residuals. Either it will be based on recursive residuals or on OLS residuals and the process will contain CUmulative SUMs or MOving SUMs of residuals in a certain data window. For the MOSUM and ME processes all estimations are done for the observations in a moving data window, whose size is determined by h and which is shifted over the whole sample.

If type is either "RE" or "ME" a k-dimensional process will be returned, if k is the number of regressors in the model, as it is based on recursive OLS estimates of the regression coefficients or moving OLS estimates respectively. The recursive estimates test is also called fluctuation test, therefore setting type to "fluctuation" was used to specify it in earlier versions of strucchange. It still can be used now, but will be forced to "RE".

If there is a single structural change point $t^*$, the recursive CUSUM path starts to depart from its mean 0 at $t^*$. The OLS-based CUSUM and the RE path (which are equivalent if there is only a constant regressor) will have their respective peaks around $t^*$. The MOSUM and ME paths should have a strong change at $t^*$.

The function plot has a method to plot the empirical fluctuation process; with sctest the corresponding test on structural change can be performed.

References

Brown R.L., Durbin J., Evans J.M. (1975), Techniques for testing constancy of regression relationships over time, Journal of the Royal Statistal Society, B, 37, 149-163.

Chu C.-S., Hornik K., Kuan C.-M. (1995), MOSUM tests for parameter constancy, Biometrika, 82, 603-617.

Chu C.-S., Hornik K., Kuan C.-M. (1995), The moving-estimates test for parameter stability, Econometric Theory, 11, 669-720.

Kr�mer W., Ploberger W., Alt R. (1988), Testing for structural change in dynamic models, Econometrica, 56, 1355-1369.

Kuan C.-M., Hornik K. (1995), The generalized fluctuation test: A unifying view, Econometric Reviews, 14, 135 - 161.

Kuan C.-M., Chen (1994), Implementing the fluctuation and moving estimates tests in dynamic econometric models, Economics Letters, 44, 235-239.

Ploberger W., Kr�mer W. (1992), The CUSUM test with OLS residuals, Econometrica, 60, 271-285.

Zeileis A., Leisch F., Hornik K., Kleiber C. (2002), strucchange: An R Package for Testing for Structural Change in Linear Regression Models, Journal of Statistical Software, 7(2), 1-38.

See Also

plot.efp, print.efp, sctest.efp, boundary.efp

Examples

Run this code
require(ts)

## Nile data with one breakpoint: the annual flows drop in 1898
## because the first Ashwan dam was built
data(Nile)
plot(Nile)

## test the null hypothesis that the annual flow remains constant over the years
## comput OLS-based CUSUM process and plot
## with standard and alternative boundaries
ocus.nile <- efp(Nile ~ 1, type = "OLS-CUSUM")
plot(ocus.nile)
plot(ocus.nile, alpha = 0.01, alt.boundary = TRUE)
## calculate corresponding test statistic
sctest(ocus.nile)

## UK Seatbelt data: a SARIMA(1,0,0)(1,0,0)_12 model
## (fitted by OLS) is used and reveals (at least) two
## breakpoints - one in 1973 associated with the oil crisis and
## one in 1983 due to the introduction of compulsory
## wearing of seatbelts in the UK.
data(UKDriverDeaths)
seatbelt <- log10(UKDriverDeaths)
seatbelt <- cbind(seatbelt, lag(seatbelt, k = -1), lag(seatbelt, k = -12))
colnames(seatbelt) <- c("y", "ylag1", "ylag12")
seatbelt <- window(seatbelt, start = c(1970, 1), end = c(1984,12))
plot(seatbelt[,"y"], ylab = expression(log[10](casualties)))

## use RE process
re.seat <- efp(y ~ ylag1 + ylag12, data = seatbelt, type = "RE")
plot(re.seat)
plot(re.seat, functional = NULL)
sctest(re.seat)

Run the code above in your browser using DataLab