PhenoBP {phenopix} | R Documentation |
Extract breakpoints on a time series
Description
A function to extract breakpoints and confidence intervals on a time series
Usage
PhenoBP(x, breaks=3, confidence=0.95, plot=TRUE, ...)
Arguments
x |
An univariate ts or zoo object |
breaks |
Maximum number of breaks to be detected |
confidence |
The confidence level for the uncertainty computation. Defaults to 0.95, i.e. 95% confidence interval (two-tails). |
plot |
Should a diagnostic plot be returned? |
... |
Arguments passed to |
Details
Threshold extraction is performed according to breakpoint analysis.
The function used is breakpoints
from package strucchange
.
The function also computes a confidence interval by a call to confint
.
Uncertainty analysis is therefore different from the approach used for other
thresholds (see e.g. PhenoGu
). Unlike the other thresholding approaches,
PhenoBP is born to work with raw data. It therefore does not require fitting
an equation. However, the function can also be used with fitted data. See example.
Value
A named vector with extracted breakpoints
Author(s)
Gianluca Filippa <gian.filippa@gmail.com>
See Also
Examples
## Not run:
data(bartlett2009.filtered)
breaks <- PhenoBP(bartlett2009.filtered, breaks=4)
mean.breaks.doy <- as.numeric(format(as.POSIXct(t(breaks[2,]),
origin='1970-01-01'), '
mean.breaks.doy
## End(Not run)