detectAFFMean {ffstream} | R Documentation |
Given a vector x
, use the fFF method to sequentially detect changes
(or a single change) in the MEAN of the vector.
detectAFFMean(x, alpha = 0.01, eta = 0.01, BL = 50, multiple = TRUE, single = !multiple, usePrechange = FALSE, prechangeMean = NULL, prechangeSigma = NULL, prechangeVar = NULL, skipCheck = FALSE)
x |
The vector (stream) in which to detect change(s). |
alpha |
The value for the threshold. Default is |
eta |
The value for of the step size in the gradient descent step.
Results show that values of 0.1, 0.01, 0.001 all produce
similar results. Default is |
BL |
The burn-in length. Default is |
multiple |
Boolean to use to decide whether to detect multiple changes
or only a single change. Default is |
single |
Boolean to use to decide whether to detect only a single
change or multiple changes. Set to |
usePrechange |
Boolean indicating whether prechange parameters
(mean and variance) are known and will be used
(or not). Default is
|
prechangeMean |
Value to be used for the prechange mean.
Default is |
prechangeSigma |
Value to be used for the prechange standard
deviation. Default is |
prechangeVar |
Value to be used for the prechange variance.
Default is |
skipCheck |
A boolean which allows the function to skip the check
of the stream. Default is |
A list with the following elements:
tauhat
A vector of the changepoints found.
Dean Bodenham
D. A. Bodenham and N. M. Adams (2016) Continuous monitoring for changepoints in data streams using adaptive estimation. Statistics and Computing doi:10.1007/s11222-016-9684-8
# create a stream with three changepoints set.seed(8) x <- rnorm(400, 5, 1) + rep(c(0:3), each=100) # mean is 5 and s.d. is 1 # multiple changepoints list_aff <- detectAFFMean(x, alpha=0.01, eta=0.01, BL=50, multiple=TRUE) # now only a single (the first) changepoint list_aff2 <- detectAFFMean(x, alpha=0.01, eta=0.01, BL=50, single=TRUE) # now only a single (the first) changepoint, but with the prechange # mean and variance known list_aff3 <- detectAFFMean(x, alpha=0.01, eta=0.01, single=TRUE, prechangeMean=5, prechangeSigma=1)