WindowSweep {bcpa} | R Documentation |
This is the workhorse function of the BCPA. It performs a sweep of the time series, searching for most significant change points and identifying the parsimonious model according to an adjusted BIC.
WindowSweep(data, variable, windowsize = 50, windowstep = 1, K = 2, tau = TRUE, range = 0.6, progress = TRUE, plotme = FALSE, ...)
data |
the data to be analyzed. Most typically,
output of the |
variable |
a character string representing the
response to apply the BCPA to. For example
|
windowsize |
integer size of the analysis window as a number of data points (not time units). Should probably be no smaller than 20. |
windowstep |
integer step size of analysis. Values greater than 1 speed the analysis up. |
K |
senstivity parameter for the adjusted BIC. Smaller values make for a less sensitive model selection, i.e. more likely that the null model of no significant changes will be selected. |
tau |
a logical indicating whether the autocorrelation "rho" or the characteristic time "tau" should be estimated. |
range |
a number between 0 and 1 that determines the
extent of each window that is scanned for changepoints.
I.e., if the window is 100 datapoints long, at the
default |
progress |
logical - whether or not to output a progress bar as the analysis is being performed. |
plotme |
logical - whether or not to plot the analysis as it is happening. This slows the analysis considerably, especially in non-dynamic graphic environments like RStudio. |
... |
additional parameters to be passed to the
|
an object of class windowsweep
, which is a list
containing:
ws |
a data frame containing the change point, selected model, and parameter estimates |
x |
the response variable |
t |
the time variable - in the units specified in the data object |
t.POSIX |
the time variable as a POSIX objects (contianing Y-M-D H:S) |
windowsize |
the window size |
windowstep |
the window step size |
Eliezer Gurarie
for internal functions: GetModels
,
GetBestBreak
, GetDoubleL
; for
summarizing output: ChangePointSummary
; for
plotting output: plot.bcpa
data(Simp) plot(Simp) Simp.VT <- GetVT(Simp) Simp.ws <- WindowSweep(Simp.VT, "V*cos(Theta)", windowsize = 50, windowstep = 1, progress=TRUE) plot(Simp.ws, threshold=7) plot(Simp.ws, type="flat", clusterwidth=3) PathPlot(Simp, Simp.ws) PathPlot(Simp, Simp.ws, type="flat") DiagPlot(Simp.ws)