bfmThresh: BFM With Magnitude Threshold

Description Usage Arguments Details Value Author(s) Examples

Description

bfm with automatic magn thresholding and re-monitoring

Usage

1
2
3
bfmThresh(x, dates, start, monend = NULL, magnThresh = 0, magnPeriod = 1,
  adjust = 1, verbose = FALSE, formula = response ~ harmon, order = 1,
  returnBFM = FALSE, ...)

Arguments

x

Numeric. Time series vector

dates

Time (date) index of x

start

Numeric. Start of monitoring period. See bfastmonitor

monend

Numeric. Optional: end of the monitoring period. See bfmSpatial

magnThresh

Numeric. Threshold for breakpoints. All breakpoints with magnitude < magnThresh are ignored, all data adjust years preceding this breakpoint are deleted, and monitoring continues with a revised history period.

magnPeriod

Numeric. Period of time (in years) from which to compute magnitude (as median of residuals)

adjust

Numeric. Delete all observations within this many years preceding a breakpoint, if that breakpoint has a magnitude less than magnThresh

verbose

Logical. Display error messages (if any)?

formula

See bfastmonitor

order

See bfastmonitor

returnBFM

Logical. Return a regular bfastmonitor object?

...

Arguments to pass to bfastmonitor

Details

The magnitude is computed as the median of the residuals within the period magnPeriod years after the break date. If this magnitude is greater than magnThresh, all observations preceding the break date by adjust years are deleted (including the observation at the break date), the start of the monitoring period is reset to the break date, the model is re-fit and monitoring continues until the end of the time series is reached, or a breakpoint with magnitude > magnThresh is found.

The default value for magnPeriod is 1, assuming that no follow-up land use or other dynamics take place within a 1-year period.

The amplitude of the fitted 1st order model can be computed by taking sqrt{harmoncos^2 + harmonsin^2}

Value

Numeric vector with output: break date, magnitude, length of history period (in years), R-squared of fitted model, Adjusted R-squared of fitted model, Intercept of fitted model, cosine coefficient(s) (if applicable), sine coefficient(s) (if applicable), error flag (1 means an error was encountered in the try() statement). If returnBFM is FALSE, a list with the above values as first item and a regular BFM object as second item is returned.

Author(s)

Ben DeVries

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(bfmThresh)
data(tura)
s <- getSceneinfo(names(tura))
xy <- c(820692.4, 829564.4)
z <- zoo(tura[cellFromXY(tura, xy)][1, ], s$date)
z <- window(z, start = "1999-01-01")
bfm <- bfmThresh(z, dates = time(z), start = c(2005, 1), plot = TRUE)
print(bfm)
bfm2 <- bfmThresh(z, dates = time(z), start = c(2005, 1), magnThresh = -500, plot = TRUE)
print(bfm2)

bendv/bfmThresh documentation built on May 12, 2019, 10:58 a.m.