| parametricFamily {stepR} | R Documentation |
Parametric families
Description
Overview about the supported parametric families (models). More details are given in section 5 of the vignette.
Details
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. Argumentsdhas to be a single, positive, finitenumeric. If omitted it will be estimated bysdrobnorm. FormonteCarloSimulationsd == 1will be used always. The observations argumentyhas 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 are1:length(y). The default penalty is"sqrt". InmonteCarloSimulationby defaultnrandom observations will be generated byrnorm."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
yhas to be a numeric vector with finite entries. The default interval system is"dyaPar"and possible lengths are2:length(y). The default penalty is"weights"which will automatically be converted to"none"incomputeStatandmonteCarloSimulation. InmonteCarloSimulationby defaultnrandom observations will be generated byrnorm."mDependentPS"normal distributed variables with unknown mean and m-dependent errors with known covariance structure given either by the argument
covariances,correlationsorfilter. 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)). Ifcorrelationsorfilteris used to specify the covariances an additional optional argumentsdcan be used to specify the constant standard deviation. Ifcovariancesis specified the argumentscorrelations,filterandsdwill be ignored and ifcorrelationsis specified the argumentfilterwill be ignored. The argumentcovarianceshas to be a finite numeric vector, m will be defined bym = 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 argumentcorrelationhas to be a finite numeric vector, m will be defined bym = 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 bycorrelations * sd^2. The argumentfilterhas to be an object of classlowpassFilterfrom which the correlation vector will be obtained. The argumentsdhas to be a single, positive, finitenumeric. If omitted it will be estimated bysdrobnormwithlag = m + 1. FormonteCarloSimulationsd == 1will be used always. The observations argumentyhas to be a numeric vector with finite entries. The default interval system is"dyaLen"and possible lengths are1:length(y). The default penalty is"sqrt". InmonteCarloSimulationby defaultnrandom 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.
References
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.
See Also
Distributions, sdrobnorm, rnorm
Examples
# 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))