Description Usage Arguments Details Value References See Also Examples
Computes an empirical fluctuation process according to a specified method from the generalized fluctuation test framework, which includes CUSUM and MOSUM tests based on recursive or OLS residuals, parameter estimates or ML scores (OLS first order conditions).
1 2 3 4 5 6 
X, y, formula 
specification of the linear regression model:
either by a regressor matrix 
data 
an optional data frame containing the variables in the model. By
default the variables are taken from the environment which 
type 
specifies which type of fluctuation process will be
computed, the default is 
h 
bandwidth (for MOSUM and ME processes only), either specified relative to the sample size as a numeric from interval (0,1), or as an integer >= 1 determining the absolute bandwidth size (number of samples). 
dynamic 
logical. If 
rescale 
logical. If 
lrvar 
logical or character. Should a longrun variance estimator
be used for the residuals? By default, the standard OLS variance is employed.
Alternatively, 
vcov 
a function to extract the covariance matrix for the coefficients
of the fitted model (only for 
... 
currently not used. 
If type
is one of "RecCUSUM"
, "OLSCUSUM"
,
"RecMOSUM"
or "OLSMOSUM"
the function efp
will return a
onedimensional empirical 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
kdimensional 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 type
is "ScoreCUSUM"
or "ScoreMOSUM"
a k+1dimensional
process will be returned, one for each score of the regression coefficients and one for
the scores of the variance. The process gives the decorrelated cumulative sums of the ML
scores (in a Gaussian model) or first order conditions respectively (in an OLS framework).
If there is a single structural change point t^*, the recursive CUSUM path starts to depart from its mean 0 at t^*. The Brownian bridge type paths will have their respective peaks around t^*. The Brownian bridge increments type 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.
efp
returns a list of class "efp"
with components including:
process 
the fitted empirical fluctuation process of class

type 
a string with the 
nreg 
the number of regressors, 
nobs 
the number of observations, 
par 
the bandwidth 
Brown R.L., Durbin J., Evans J.M. (1975), Techniques for testing constancy of regression relationships over time, Journal of the Royal Statistical Society, B, 37, 149163.
Chu C.S., Hornik K., Kuan C.M. (1995), MOSUM tests for parameter constancy, Biometrika, 82, 603617.
Chu C.S., Hornik K., Kuan C.M. (1995), The movingestimates test for parameter stability, Econometric Theory, 11, 669720.
Hansen B. (1992), Testing for Parameter Instability in Linear Models, Journal of Policy Modeling, 14, 517533.
Hjort N.L., Koning A. (2002), Tests for Constancy of Model Parameters Over Time, Nonparametric Statistics, 14, 113132.
Kr\"amer W., Ploberger W., Alt R. (1988), Testing for structural change in dynamic models, Econometrica, 56, 13551369.
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, 235239.
Ploberger W., Kr\"amer W. (1992), The CUSUM test with OLS residuals, Econometrica, 60, 271285.
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), 138.
doi: 10.18637/jss.v007.i02.
Zeileis A. (2005), A Unified Approach to Structural Change Tests Based on ML Scores, F Statistics, and OLS Residuals. Econometric Reviews, 24, 445–466. doi: 10.1080/07474930500406053.
Zeileis A. (2006), Implementing a Class of Structural Change Tests: An Econometric Computing Approach. Computational Statistics & Data Analysis, 50, 2987–3008. doi: 10.1016/j.csda.2005.07.001.
Zeileis A., Hornik K. (2007), Generalized MFluctuation Tests for Parameter Instability, Statistica Neerlandica, 61, 488–508. doi: 10.1111/j.14679574.2007.00371.x.
gefp
, plot.efp
, print.efp
,
sctest.efp
, boundary.efp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32  ## 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
## compute OLSbased CUSUM process and plot
## with standard and alternative boundaries
ocus.nile < efp(Nile ~ 1, type = "OLSCUSUM")
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)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.