PhenoBP: A function to extract breakpoints on a time series

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/PhenoBP.R

Description

A function to extract breakpoints and confidence intervals on a time series

Usage

1
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 plot.

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

PhenoExtract

Examples

1
2
3
4
5
6
7
8
## 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)

gianlucafilippa/phenopix documentation built on Nov. 4, 2019, 1:06 p.m.