computeGroupSizeWeight: Compute the group size weight vector with an authorized...

View source: R/MLGL.R

computeGroupSizeWeightR Documentation

Compute the group size weight vector with an authorized maximal size

Description

Compute the group size weight vector with an authorized maximal size

Usage

computeGroupSizeWeight(hc, sizeMax = NULL)

Arguments

hc

output of hclust

sizeMax

maximum size of cluster to consider

Value

the weight vector

Examples

set.seed(42)
# Simulate gaussian data with block-diagonal variance matrix containing 12 blocks of size 5
X <- simuBlockGaussian(50, 12, 5, 0.7)
# Generate a response variable
y <- X[, c(2, 7, 12)] %*% c(2, 2, -2) + rnorm(50, 0, 0.5)
# use 20 as the maximal number of group
hc <- hclust(dist(t(X)))
w <- computeGroupSizeWeight(hc, sizeMax = 20)
# Apply MLGL method
res <- MLGL(X, y, hc = hc, weightSizeGroup = w)

MLGL documentation built on March 31, 2023, 9:32 p.m.