Description Usage Arguments Value Note References See Also Examples
Compute the SMUCE estimator for one-dimensional data with i.i.d. Gaussian noises.
1 |
Y |
a numeric vector containing the noisy data |
q |
threshold value; a scalar number |
alpha |
significance level; if |
r |
numer of Monte Carlo simulations |
sd |
standard deviation of noises |
A list with components
value |
function values on each segment of the estimator |
left |
indices of leftmost points within each segment of the estimator |
n |
number of samples |
This is an efficient implementation of function smuceR
in R package stepR (CRAN) for data with i.i.d. Gaussian noises. The detailed algorithm is described in (Seiling, 2013).
Frick, K., Munk, A., and Sieling, H. (2014). Multiscale Change-Point Inference. J. R. Statist. Soc. B, with discussion and rejoinder by the authors, 76:495–580.
Seiling, H. (2013). Statistical Multiscale Segmentation: Inference, Algorithms and Applications. PhD thesis, University of Goettingen, Germany.
fdrseg
, dfdrseg
, simulQuantile
, sdrobnorm
, evalStepFun
, computeFdp
, v_measure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # simulate data
set.seed(2)
u0 <- c(rep(1, 50), rep(5, 50))
Y <- rnorm(100, u0)
# compute the estimate (q is automatically simulated)
uh <- smuce(Y)
# plot result
plot(Y, pch = 20, col = "grey", ylab = "", main = expression(alpha*" = 0.1"))
lines(u0, type = "s", col = "blue")
lines(evalStepFun(uh), type = "s", col = "red")
legend("topleft", c("Truth", "SMUCE"), lty = c(1, 1), col = c("blue", "red"))
# other choice of alpha
uh <- smuce(Y, alpha = 0.05)
# plot result
plot(Y, pch = 20, col = "grey", ylab = "", main = expression(alpha*" = 0.05"))
lines(u0, type = "s", col = "blue")
lines(evalStepFun(uh), type = "s", col = "red")
legend("topleft", c("Truth", "SMUCE"), lty = c(1, 1), col = c("blue", "red"))
## Not run:
# alternatively simulate quantiles first
alpha <- 0.1
q <- simulQuantile(1 - alpha, 100, type = "smuce")
# then compute the estimate
uh <- smuce(Y, q)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.