Learn R Programming

stepR (version 1.0-1)

stepbound: Jump estimation under restrictions

Description

Computes piecewise constant maximum likelihood estimators with minimal number of jumps under given restrictions on subintervals.

Usage

stepbound(y, bounds, ...)
## S3 method for class 'default':
stepbound(y, bounds, x = 1:length(y), x0 = 2 * x[1] - x[2],
  max.cand = NULL, family = c("gauss", "gaussvar", "poisson", "binomial", "gaussKern"),
  param = NULL, weights = rep(1, length(y)), refit = y,
  jumpint = confband, confband = FALSE, ...)
## S3 method for class 'stepcand':
stepbound(y, bounds, refit = TRUE, \dots)

Arguments

y
a vector of numerical observations
bounds
bounds on the value allowed on intervals; typically computed with bounds
x
a numeric vector of the same length as y containing the corresponding sample points
x0
a single numeric giving the last unobserved sample point directly before sampling started
max.cand, weights
family, param
specifies distribution of data, see family
refit
logical, for family = "gaussKern"; determines whether a fit taken the filter kernel into account will be computed at the end
jumpint
logical (FALSE by default), indicates if confidence sets for jumps should be computed
confband
logical, indicates if a confidence band for the piecewise-continuous function should be computed
...
arguments to be passed to generic methods

Value

  • An object of class stepfit that contains the fit; if jumpint = TRUE function jumpint allows to extract the confidence interval for the jumps, if confband = TRUE function confband allows to extract the confidence band.

encoding

utf8

References

Frick, K., Munk, A., and Sieling, H. (2013). Multiscale Change-Point Inference. eprint arXiv:1301.7212 [stat.ME], http://arxiv.org/abs/1301.7212. Hotz, T., Schütte{Schuette}, O., Sieling, H., Polupanow, T., Diederichsen, U., Steinem, C., and Munk, A. (2013). Idealizing Ion Channel Recordings by a Jump Segmentation Multiresolution Filter. (submitted)

See Also

bounds, smuceR, jsmurf, stepsel, stepfit, jumpint, confband

Examples

Run this code
# simulate poisson data with two levels
y <- rpois(100, c(rep(1, 50), rep(4, 50)))
# compute bounds
b <- bounds(y, penalty="len", family="poisson", q=4)
# fit step function to bounds
sb <- stepbound(y, b, family="poisson", confband=TRUE)
plot(y)
lines(sb)
# plot confidence intervals for jumps on axis
points(jumpint(sb), col="blue")
# confidence band
lines(confband(sb), lty=2, col="blue")

Run the code above in your browser using DataLab