Computes confidence intervals for breakpoints.
# S3 method for breakpointsfull
confint(object, parm = NULL, level = 0.95,
breaks = NULL, het.reg = TRUE, het.err = TRUE, vcov. = NULL, sandwich = TRUE, ...)
# S3 method for confint.breakpoints
lines(x, col = 2, angle = 90, length = 0.05,
code = 3, at = NULL, breakpoints = TRUE, ...)
an object of class "breakpointsfull"
as computed by
breakpoints
from a formula
.
the same as breaks
, only one of the two should be
specified.
the confidence level required.
an integer specifying the number of breaks to be used. By default the breaks of the minimum BIC partition are used.
logical. Should heterogeneous regressors be assumed? If set
to FALSE
the distribution of the regressors is assumed to be
homogeneous over the segments.
logical. Should heterogeneous errors be assumed? If set
to FALSE
the distribution of the errors is assumed to be
homogeneous over the segments.
a function to extract the covariance matrix
for the coefficients of a fitted model of class "lm"
.
logical. Is the function vcov.
the sandwich
estimator or only the middle part?
an object of class "confint.breakpoints"
as returned by
confint
.
arguments passed to arrows
.
position on the y axis, where the confidence arrows should be drawn. By default they are drawn at the bottom of the plot.
logical. If TRUE
vertical lines for the breakpoints
are drawn.
currently not used.
A matrix containing the breakpoints and their lower and upper confidence boundary for the given level.
As the breakpoints are integers (observation numbers) the corresponding confidence intervals are also rounded to integers.
The distribution function used for the computation of confidence intervals of breakpoints is given in Bai (1997). The procedure, in particular the usage of heterogeneous regressors and/or errors, is described in more detail in Bai & Perron (2003).
The breakpoints should be computed from a formula with breakpoints
,
then the confidence intervals for the breakpoints can be derived by
confint
and these can be visualized by lines
. For an
example see below.
Bai J. (1997), Estimation of a Change Point in Multiple Regression Models, Review of Economics and Statistics, 79, 551-563.
Bai J., Perron P. (2003), Computation and Analysis of Multiple Structural Change Models, Journal of Applied Econometrics, 18, 1-22.
# NOT RUN {
## Nile data with one breakpoint: the annual flows drop in 1898
## because the first Ashwan dam was built
data("Nile")
plot(Nile)
## dating breaks
bp.nile <- breakpoints(Nile ~ 1)
ci.nile <- confint(bp.nile, breaks = 1)
lines(ci.nile)
# }
Run the code above in your browser using DataLab