| confint.segmentation {tilingArray} | R Documentation |
Compute Bai's confidence intervals for specified segmentations
## S3 method for class 'segmentation':
confint(object,parm="breakpoints", level = 0.95,
nSegments=NULL,
het.reg = FALSE,het.err = FALSE, ...)
object |
Object of class "segmentation";
Result of findSegments |
parm |
character; which parameters to compute confidence intervals for; only "breakpoints" is implemented |
level |
Confidence level of the confidence intervals |
nSegments |
Number of segments in segmentations to compute
confidence intervals for. Defaults to computing them for all
segmentations considered in findSegments |
het.reg |
logical. Should heterogenous regressors be assumed? If set
to FALSE the distribution of the regressors is assumed to be
homogenous over the segments. |
het.err |
logical. Should heterogenous errors be assumed? If set
to FALSE the distribution of the errors is assumed to be
homogenous over the segments. |
... |
currently not used |
Basically, this function just prepares an object for calling
the function computeConfInt.
The distribution function used for the computation of confidence intervals of breakpoints is given in Bai (1997). The procedure, in particular the usage of heterogenous 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 with the segmentation.
For an example see plot.segmentation.
An object of class "segmentation". Actually the same as the
argument object with the following list items replaced
chosenSegNo |
Numeric; Segment numbers of segmentations, for which confidence intervals were computed |
confInt |
List of confidence intervals as tables for those segmentations |
residuals |
List of numeric vectors containing the residuals for those segmentations |
call |
with call of this function appended |
Joern Toedling toedling@ebi.ac.uk
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.
computeConfInt,findSegments,
plot.segmentation,confint
# generate random data with 5 segments:
x <- c(rnorm(10,0,1),rnorm(10,3,1),rnorm(10,0.5,0.5),
rnorm(10,1.5,1),rnorm(10,5,1))
segres <- findSegments(x, maxcp=10, maxk=15)
segres <- confint.segmentation(segres,nSegments=c(3,4,5,6))
# see that the step between segments 3 and 4 is less certain than
# the other ones:
segres$confInt
plot(segres,5, pch=20)