LambdaGridGraphical {sharp} | R Documentation |
Grid of penalty parameters (graphical model)
Description
Generates a relevant grid of penalty parameter values for penalised graphical models.
Usage
LambdaGridGraphical(
xdata,
pk = NULL,
lambda_other_blocks = 0.1,
K = 100,
tau = 0.5,
n_cat = 3,
implementation = PenalisedGraphical,
start = "cold",
scale = TRUE,
resampling = "subsampling",
PFER_method = "MB",
PFER_thr = Inf,
FDP_thr = Inf,
Lambda_cardinal = 50,
lambda_max = NULL,
lambda_path_factor = 0.001,
max_density = 0.5,
...
)
Arguments
xdata |
data matrix with observations as rows and variables as columns. For multi-block stability selection, the variables in data have to be ordered by group. |
pk |
optional vector encoding the grouping structure. Only used for
multi-block stability selection where |
lambda_other_blocks |
optional vector of parameters controlling the
level of sparsity in neighbour blocks for the multi-block procedure. To use
jointly a specific set of parameters for each block,
|
K |
number of resampling iterations. |
tau |
subsample size. Only used if |
n_cat |
computation options for the stability score. Default is
|
implementation |
function to use for graphical modelling. If
|
start |
character string indicating if the algorithm should be
initialised at the estimated (inverse) covariance with previous penalty
parameters ( |
scale |
logical indicating if the correlation ( |
resampling |
resampling approach. Possible values are:
|
PFER_method |
method used to compute the upper-bound of the expected
number of False Positives (or Per Family Error Rate, PFER). If
|
PFER_thr |
threshold in PFER for constrained calibration by error
control. If |
FDP_thr |
threshold in the expected proportion of falsely selected
features (or False Discovery Proportion) for constrained calibration by
error control. If |
Lambda_cardinal |
number of values in the grid of parameters controlling the level of sparsity in the underlying algorithm. |
lambda_max |
optional maximum value for the grid in penalty parameters.
If |
lambda_path_factor |
multiplicative factor used to define the minimum value in the grid. |
max_density |
threshold on the density. The grid is defined such that the density of the estimated graph does not exceed max_density. |
... |
additional parameters passed to the functions provided in
|
Value
A matrix of lambda values with length(pk)
columns and
Lambda_cardinal
rows.
See Also
Other lambda grid functions:
LambdaGridRegression()
,
LambdaSequence()
Examples
# Single-block simulation
set.seed(1)
simul <- SimulateGraphical()
# Generating grid of 10 values
Lambda <- LambdaGridGraphical(xdata = simul$data, Lambda_cardinal = 10)
# Ensuring PFER < 5
Lambda <- LambdaGridGraphical(xdata = simul$data, Lambda_cardinal = 10, PFER_thr = 5)
# Multi-block simulation
set.seed(1)
simul <- SimulateGraphical(pk = c(10, 10))
# Multi-block grid
Lambda <- LambdaGridGraphical(xdata = simul$data, pk = c(10, 10), Lambda_cardinal = 10)
# Denser neighbouring blocks
Lambda <- LambdaGridGraphical(
xdata = simul$data, pk = c(10, 10),
Lambda_cardinal = 10, lambda_other_blocks = 0
)
# Using different neighbour penalties
Lambda <- LambdaGridGraphical(
xdata = simul$data, pk = c(10, 10),
Lambda_cardinal = 10, lambda_other_blocks = c(0.1, 0, 0.1)
)
stab <- GraphicalModel(
xdata = simul$data, pk = c(10, 10),
Lambda = Lambda, lambda_other_blocks = c(0.1, 0, 0.1)
)
stab$Lambda
# Visiting from empty to full graphs with max_density=1
Lambda <- LambdaGridGraphical(
xdata = simul$data, pk = c(10, 10),
Lambda_cardinal = 10, max_density = 1
)
bigblocks <- BlockMatrix(pk = c(10, 10))
bigblocks_vect <- bigblocks[upper.tri(bigblocks)]
N_blocks <- unname(table(bigblocks_vect))
N_blocks # max number of edges per block
stab <- GraphicalModel(xdata = simul$data, pk = c(10, 10), Lambda = Lambda)
apply(stab$Q, 2, max, na.rm = TRUE) # max average number of edges from underlying algo