Last chance! 50% off unlimited learning
Sale ends in
Computes two-sided bounds for a set of intervals based on a multiresolution criterion (MRC).
Deprecation warning: This function is deprecated, but still working, however, may be defunct in a future version. Please use instead the function computeBounds
. An example how to reproduce results (currently only family "gauss"
is supported) is given below.
bounds(y, type = "MRC", …)
bounds.MRC(y, q, alpha = 0.05, r = ceiling(50 / min(alpha, 1 - alpha)),
lengths = if(family == "gaussKern")
2^(floor(log2(length(y))):ceiling(log2(length(param$kern)))) else
2^(floor(log2(length(y))):0), penalty = c("none", "len", "var", "sqrt"),
name = if(family == "gaussKern") ".MRC.ktable" else ".MRC.table", pos = .GlobalEnv,
family = c("gauss", "gaussvar", "poisson", "binomial","gaussKern"), param = NULL,
subset, max.iter = 1e2, eps = 1e-3)
# S3 method for bounds
[(x, subset)
a numeric vector containing the serial data
so far only bounds of type "MRC"
are implemented
further arguments to be passed on to bounds.MRC
quantile of the MRC; if specified, alpha
and r
will be ignored
level of significance
number of simulations to use to obtain quantile of MRC for specified alpha
vector of interval lengths to use, dyadic intervals by default
penalty term in the multiresolution statistic: "none"
for no penalty, "len"
for penalizing the length of an interval, "var"
for penalizing the variance over an interval, and "sqrt"
for penalizing the square root of the MRC
specifies distribution of data, see family
a subset of indices of y
for which bounds should be aggregated
under which name and where precomputed results are stored, or retrieved, see assign
maximal iterations in Newton's method to compute non-Gaussian MRC bounds
tolerance in Newton's method
an object of class bounds
Returns an object of class bounds
, i.e. a list whose entry bounds
contains two-sided bounds (lower
and upper
) of the considered intervals (with left index li
and right index ri
) in a data.frame
, along with a vector start
specifying in which row of entry bounds
intervals with corresponding li
start (if any; specified as a C-style index), and a logical
feasible
telling whether a feasible solution exists for these bounds (always TRUE
for MRC bounds which are not restricted to a subset
).
# NOT RUN {
y <- rnorm(100, c(rep(0, 50), rep(1, 50)), 0.5)
b <- computeBounds(y, q = 4, intervalSystem = "dyaLen", penalty = "none")
b <- b[order(b$li, b$ri), ]
attr(b, "row.names") <- seq(along = b$li)
# entries in bounds are recovered by computeBounds
all.equal(bounds(y, q = 4)$bounds, b) # TRUE
# simulate signal of 100 data points
Y <- rpois(100, 1:100 / 10)
# compute bounds for intervals of dyadic lengths
b <- bounds(Y, penalty="len", family="poisson", q=4)
# compute bounds for all intervals
b <- bounds(Y, penalty="len", family="poisson", q=4, lengths=1:100)
# }
Run the code above in your browser using DataLab