library(curvHDR)
# Univariate curvHDR examples:
xUniv <- c(rnorm(1000,-2),rnorm(1000,2))
gate1a <- curvHDRfilter(xUniv)
plot(gate1a)
print(gate1a$poly) # List of intervals that define gate1a.
if (FALSE) print(gate1a$insideFilter) # Indicators of inclusion of
# xUniv inside gate1a.
gate1b <- curvHDRfilter(xUniv,HDRlevel=0.5)
plot(gate1b)
print(gate1b$poly) # List of intervals that define gate1b.
if (FALSE) print(gate1b$insideFilter) # Indicators of inclusion of
# xUniv inside gate1b.
# Bivariate curvHDR examples:
xBiva <- cbind(c(rnorm(1000,-2),rnorm(1000,2)),
c(rnorm(1000,-2),rnorm(1000,2)))
if (FALSE) gate2a <- curvHDRfilter(xBiva)
plot(gate2a)
print(gate2a$poly) # List of polygon vertices that define gate2a.
print(gate2a$insideFilter) # Indicators of inclusion of
# xBiva inside gate2a.
if (FALSE) {
gate2b <- curvHDRfilter(xBiva,HDRlevel=0.5)
plot(gate2b)
print(gate2b$poly) # List of polygon vertices that define gate2b.
print(gate2b$insideFilter) # Indicators of inclusion of
# xBiva inside gate2b.
}
# Trivariate curvHDR examples:
if (FALSE) {
xTriv <- cbind(c(rnorm(1000,-2),rnorm(1000,2)),
c(rnorm(1000,-2),rnorm(1000,2)),
c(rnorm(1000,-2),rnorm(1000,2)))
gate3a <- curvHDRfilter(xTriv)
plot(gate3a)
print(gate3a$poly) # List of polyhedron elements that define gate3a.
print(gate3a$insideFilter) # Indicators of inclusion of
# xTriv inside gate3a.
}
if (FALSE) {
gate3b <- curvHDRfilter(xTriv,HDRlevel=0.5)
plot(gate3b)
print(gate3b$poly) # List of polyhedron elements that define gate3b.
print(gate3b$insideFilter) # Indicators of inclusion of
# xTriv inside gate3b.
}
Run the code above in your browser using DataLab