plot.beast: Bayesian changepoint detection and time series decomposition

View source: R/plot.beast.R

plot.beastR Documentation

Bayesian changepoint detection and time series decomposition

Description

Plot the result obtained from the beast function.

Usage


## S3 method for class 'beast'
plot(
     x, 
     index = 1,
     vars  = c('st','s','scp','sorder','t','tcp','torder','slpsgn','o','ocp','error'),  
     col         = NULL, 
     main        = "BEAST decomposition and changepoint detection",
     xlab        = 'Time',
     ylab        = NULL,
     cex.main    = 1,
     cex.lab     = 1,  
     relative.heights = NULL,           
     interactive = FALSE,
     ncpStat     = c('median','mode','mean','pct90','max'),
     ...	 
   ) 

Arguments

x

a "beast" object returned by beast,beast.irreg, or beast123. It may contain one or many time series.

index

an integer (default to 1 ) or a vector of two integers to specify the index of the time series to plot if x contains results for multiple time series. index is always 1 if x has 1 time series. If x is returned by beast123 with a 2D input,index should be a single integer. If x is from beast123 applied to 3D arrays of time series (e.g., stacked satellite images), index can be a linear index or two subscripts to specify the row and column of the pixel/grid.

vars

a vector of strings indicating the elements or variables of x to plot. Possible vars strings include 'st' (season plus trend), 's' (season component), 't' (trend component), 'o' (outliers), 'scp', 'tcp', 'ocp' (occurrence probability of seasonal/trend/outlier changepoint), 'sorder' (seasonal harmonic order), 'torder' (trend polynomial order), 'samp' (amplitude of seasonality), 'tslp' (slope of trend), 'slpsgn' (probabilities of the slope being positive, zero, and negative) and 'error' (remainder).

relative.heights

a numeric vector of the same length as that of vars to specify the relative heights of subplots of individual variables in vars.

col

a string vector of the same length as that of vars to specify the colors of individual subplots associated with vars.

main

a string; the main title.

xlab

a string: the x axis title.

ylab

a string vector of the same length as that of vars to specify the y axis names of individual subplots associated with vars

cex.main

cex for the main title

cex.lab

cex for the axis title

interactive

a bool scalar. If TRUE, an interactive GUI is used for examining individual elements of x.

ncpStat

character. A string to specify which statistic is used for the Number of ChangePoint (ncp). Five values are possible: 'mean', 'mode', 'median','pct90', and 'max'; the default is 'median'. Individual models sampled by BEAST has a varying dimension (e.g., number of changepoints or knots). For example, if mcmc$samples=10, the numbers of changepoints for the 10 sampled models are assumed to be c(0, 2, 4, 1, 1, 2, 7, 6, 6, 1). The mean ncp will be 3.1 (rounded to 3), the median is 2.5 (2), the mode is 1, and the maximum is 7. The 'max' option plots all the changepoints recorded in out$trend$cp, out$season$cp, or out$outlier$cp; many of these changepoints are bound to be false positives, so do not treat all of them as actual changepoints.

...

additional parameters to be implemented.

Value

This function creates various plots to demonstrate the results of a beast decomposition. .

References

  1. Zhao, K., Wulder, M.A., Hu, T., Bright, R., Wu, Q., Qin, H., Li, Y., Toman, E., Mallick, B., Zhang, X. and Brown, M., 2019. Detecting change-point, trend, and seasonality in satellite time series data to track abrupt changes and nonlinear dynamics: A Bayesian ensemble algorithm. Remote Sensing of Environment, 232, p.111181 (the beast algorithm paper).

  2. Zhao, K., Valle, D., Popescu, S., Zhang, X. and Mallick, B., 2013. Hyperspectral remote sensing of plant biochemistry using Bayesian model averaging with variable and band selection. Remote Sensing of Environment, 132, pp.102-119 (the Bayesian MCMC scheme used in beast).

  3. Hu, T., Toman, E.M., Chen, G., Shao, G., Zhou, Y., Li, Y., Zhao, K. and Feng, Y., 2021. Mapping fine-scale human disturbances in a working landscape with Landsat time series on Google Earth Engine. ISPRS Journal of Photogrammetry and Remote Sensing, 176, pp.250-261(a beast application paper).

See Also

beast, beast.irreg, beast123, plot.beast,minesweeper, tetris, geeLandsat

Examples


 library(Rbeast)
 data(simdata)
## Not run:  
 result=beast123(simdata, metadata=list(whichDimIsTime=1))
 plot(result,1)
 plot(result,2)

## End(Not run)

Rbeast documentation built on May 18, 2022, 9:05 a.m.

Related to plot.beast in Rbeast...