FDRSeg (version 1.0-2)

computeFdp: Compute false discovery proportion (FDP)

Description

Compute false discovery proportion for estimated change-points, see (Li et al., 2015) for a detailed explanation.

Usage

computeFdp(u, eJ)

Arguments

u

true signal; a numeric vector

eJ

estimated change-points; a numeric vector

Value

A scalar takes value in [0, 1].

References

Li, H., Munk, A., and Sieling, H. (2015). FDR-control in multiscale change-point segmentation. arXiv:1412.5844.

See Also

fdrseg, v_measure

Examples

Run this code
# NOT RUN {
# simulate data
set.seed(2)
u0 <- c(rep(1, 50), rep(5, 50))
Y  <- rnorm(100, u0)

# compute FDRSeg
uh <- fdrseg(Y)

plot(Y, pch = 20, col = "grey", xlab = "", ylab = "")
lines(u0, type = "s", col = "blue")
lines(evalStepFun(uh), type = "s", col = "red")
legend("topleft", c("Truth", "FDRSeg"), lty = c(1, 1), col = c("blue", "red"))

# compute false discovery proportion
fdp <- computeFdp(u0, uh$left)
cat("False discovery propostion is ", fdp, "\n")
# }

Run the code above in your browser using DataLab