| generate_projection_indexes | R Documentation |
Generates projection index sets for high-dimensional multivariate detectors using circular combinations.
generate_projection_indexes(D, p)
D |
Integer. Total number of dimensions. |
p |
Integer. Projection subset size (number of dimensions per projection). |
This function generates systematic projection sets for use with multivariate detectors. The circular combination approach ensures good coverage of the dimensional space while keeping the number of projections manageable.
A list of integer vectors. Each element is a vector of 0-based column indices representing one projection.
# Generate 2-dimensional projections from 5 dimensions
proj <- generate_projection_indexes(D = 5, p = 2)
print(proj)
# Use with multivariate detector
det <- detector_create(type = "multivariate", dim_indexes = proj)
set.seed(42)
p <- 5
# Create data: changepoint at t=1000
Y_multi <- rbind(
matrix(rnorm(1000 * p, mean = -1, 1), ncol = p),
matrix(rnorm(500 * p, mean = 1.2), ncol = p)
)
# Full multivariate detection
system.time(
res_multi <- focus_offline(Y_multi, threshold = Inf,
type = "multivariate", family = "gaussian")
)
# Low-dimensional projection approximation
dim_indexes <- generate_projection_indexes(5, 2)
system.time(
res_multi_approx <- focus_offline(Y_multi, threshold = Inf,
type = "multivariate", family = "gaussian",
dim_indexes = dim_indexes)
)
# Verify similarity
all.equal(res_multi$stat, res_multi_approx$stat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.