parametricFamily | R Documentation |
Overview about the supported parametric families (models). More details are given in section 5 of the vignette.
The following parametric families (models and fitting methods) are available. Some of them have additional parameters that have to / can be specified in ...
.
"gauss"
independent normal distributed variables with unknown mean but known, constant standard deviation given by the optional argument sd
. Fits are obtained by the method SMUCE (Frick et al., 2014) for independent normal distributed observations. Argument sd
has to be a single, positive, finite numeric
. If omitted it will be estimated by sdrobnorm
. For monteCarloSimulation
sd == 1
will be used always. The observations argument y
has to be a numeric vector with finite entries. The default interval system is "all"
up to 1000 observations and "dyaLen"
for more observations. Possible lengths are 1:length(y)
. The default penalty is "sqrt"
. In monteCarloSimulation
by default n
random observations will be generated by rnorm
.
"hsmuce"
independent normal distributed variables with unknown mean and also unknown piecewise constant standard deviation as a nuisance parameter. Fits are obtained by the method HSMUCE (Pein et al., 2017). No additional argument has to be given. The observations argument y
has to be a numeric vector with finite entries. The default interval system is "dyaPar"
and possible lengths are 2:length(y)
. The default penalty is "weights"
which will automatically be converted to "none"
in computeStat
and monteCarloSimulation
. In monteCarloSimulation
by default n
random observations will be generated by rnorm
.
"mDependentPS"
normal distributed variables with unknown mean and m-dependent errors with known covariance structure given either by the argument covariances
, correlations
or filter
. Fits are obtained by the method SMUCE (Frick et al., 2014) for m-dependent normal distributed observations using partial sum tests and minimizing the least squares distance (Pein et al., 2017, (7) and (8)). If correlations
or filter
is used to specify the covariances an additional optional argument sd
can be used to specify the constant standard deviation. If covariances
is specified the arguments correlations
, filter
and sd
will be ignored and if correlations
is specified the argument filter
will be ignored. The argument covariances
has to be a finite numeric vector, m will be defined by m = length(covariances) - 1
, giving the vector of covariances, i.e. the first element must be positive, the absolute value of every other element must be smaller than or equal to the first one and the last element should not be zero. The argument correlation
has to be a finite numeric vector, m will be defined by m = length(correlations) - 1
, giving the vector of correlations, i.e. the first element must be 1, the absolute value of every other element must be smaller than or equal to the first one and the last element should not be zero. Covariances will be calculated by correlations * sd^2
. The argument filter
has to be an object of class lowpassFilter
from which the correlation vector will be obtained. The argument sd
has to be a single, positive, finite numeric
. If omitted it will be estimated by sdrobnorm
with lag = m + 1
. For monteCarloSimulation
sd == 1
will be used always. The observations argument y
has to be a numeric vector with finite entries. The default interval system is "dyaLen"
and possible lengths are 1:length(y)
. The default penalty is "sqrt"
. In monteCarloSimulation
by default n
random observations will be generated by calculating the coefficients of the corresponding moving average process and generating random observations from it.
The family is selected via the family
argument, providing the corresponding string, while additional parameters have to / can be specified in ...
if any.
Frick, K., Munk, A., Sieling, H. (2014) Multiscale change-point inference. With discussion and rejoinder by the authors. Journal of the Royal Statistical Society, Series B 76(3), 495–580.
Pein, F., Sieling, H., Munk, A. (2017) Heterogeneous change point inference. Journal of the Royal Statistical Society, Series B, 79(4), 1207–1227.
Pein, F., Tecuapetla-Gómez, I., Schütte, O., Steinem, C., Munk, A. (2017) Fully-automatic multiresolution idealization for filtered ion channel recordings: flickering event detection. arXiv:1706.03671.
Distributions, sdrobnorm
, rnorm
# parametric family "gauss": independent gaussian errors with constant variance
set.seed(1)
x <- seq(1 / 100, 1, 1 / 100)
y <- c(rnorm(50), rnorm(50, 2))
plot(x, y, pch = 16, col = "grey30", ylim = c(-3, 5))
# computation of SMUCE and its confidence statements
fit <- stepFit(y, x = x, alpha = 0.5, family = "gauss",
jumpint = TRUE, confband = TRUE)
lines(fit, lwd = 3, col = "red", lty = "22")
# confidence intervals for the change-point locations
points(jumpint(fit), col = "red")
# confidence band
lines(confband(fit), lty = "22", col = "darkred", lwd = 2)
# "gauss" is default for family
identical(stepFit(y, x = x, alpha = 0.5, jumpint = TRUE, confband = TRUE), fit)
# missing sd is estimated by sdrobnorm
identical(stepFit(y, x = x, alpha = 0.5, family = "gauss", sd = sdrobnorm(y),
jumpint = TRUE, confband = TRUE), fit)
# parametric family "hsmuce": independent gaussian errors with also
# piecewise constant variance
# estimaton that is robust against variance changes
set.seed(1)
y <- c(rnorm(50, 0, 1), rnorm(50, 1, 0.2))
plot(x, y, pch = 16, col = "grey30", ylim = c(-2.5, 2))
# computation of HSMUCE and its confidence statements
fit <- stepFit(y, x = x, alpha = 0.5, family = "hsmuce",
jumpint = TRUE, confband = TRUE)
lines(fit, lwd = 3, col = "red", lty = "22")
# confidence intervals for the change-point locations
points(jumpint(fit), col = "red")
# confidence band
lines(confband(fit), lty = "22", col = "darkred", lwd = 2)
# for comparison SMUCE
lines(stepFit(y, x = x, alpha = 0.5, jumpint = TRUE, confband = TRUE),
lwd = 3, col = "blue", lty = "22")
# parametric family "mDependentPS": m dependent observations with known covariances
# observations are generated from a moving average process
set.seed(1)
y <- c(rep(0, 50), rep(2, 50)) +
as.numeric(arima.sim(n = 100, list(ar = c(), ma = c(0.8, 0.5, 0.3)), sd = 0.5))
correlations <- as.numeric(ARMAacf(ar = c(), ma = c(0.8, 0.5, 0.3), lag.max = 3))
covariances <- 0.5^2 * correlations
plot(x, y, pch = 16, col = "grey30", ylim = c(-2, 4))
# computation of SMUCE for dependent observations with given covariances
fit <- stepFit(y, x = x, alpha = 0.5, family = "mDependentPS",
covariances = covariances, jumpint = TRUE, confband = TRUE)
lines(fit, lwd = 3, col = "red", lty = "22")
# confidence intervals for the change-point locations
points(jumpint(fit), col = "red")
# confidence band
lines(confband(fit), lty = "22", col = "darkred", lwd = 2)
# for comparison SMUCE for independent gaussian errors
lines(stepFit(y, x = x, alpha = 0.5, jumpint = TRUE, confband = TRUE),
lwd = 3, col = "blue", lty = "22")
# covariance structure can also be given by correlations and sd
identical(stepFit(y, x = x, alpha = 0.5, family = "mDependentPS",
correlations = correlations, sd = 0.5,
jumpint = TRUE, confband = TRUE), fit)
# if sd is missing it will be estimated by sdrobnorm
identical(stepFit(y, x = x, alpha = 0.5,family = "mDependentPS",
correlations = correlations, jumpint = TRUE, confband = TRUE),
stepFit(y, x = x, alpha = 0.5, family = "mDependentPS",
correlations = correlations,
sd = sdrobnorm(y, lag = length(correlations)),
jumpint = TRUE, confband = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.