View source: R/group_dilution.R
| group_dilution | R Documentation |
Computes a group-based dilution factor for each model (row) in a model-inclusion
matrix. Regressors are assigned to "relatedness groups" via Nar_vec. For each
model and each group, the dilution exponent increases by 1 for every additional
regressor from that group beyond the first. The model's dilution factor is the
product of group-specific penalties.
group_dilution(Reg_ID, Nar_vec, p)
Reg_ID |
An |
Nar_vec |
An integer vector of length |
p |
Either:
If
|
Formally, for model i and group h >= 1, let
c_{ih} = \sum_{j=1}^K \gamma_{ij} I\{g(j)=h\}
and
D_i = \sum_{h \ge 1} \max(0, c_{ih} - 1).
If p is a scalar, the dilution factor is
p^{D_i}
.
If p is group-specific with values p_h, then
\mathrm{NarDilution}_i = \prod_{h \ge 1} p_h^{\max(0, c_{ih}-1)}.
A numeric vector of length MS containing the dilution factor for each model.
# Example model space: MS models, K regressors
Reg_ID <- rbind(
c(0,0,0,0,0), # null
c(1,1,0,0,0), # two from group 1 -> penalty p_1^(1)
c(1,1,1,0,0), # three from group 1 -> penalty p_1^(2)
c(1,1,0,1,1) # two from group 1 and two from group 2 -> p_1^1 * p_2^1
)
Nar_vec <- c(1,1,1,2,2)
# Scalar p (same for all groups)
group_dilution(Reg_ID, Nar_vec, p = 0.7)
# Group-specific p (vector in group order: group 1 then group 2)
group_dilution(Reg_ID, Nar_vec, p = c(0.7, 0.5))
# Group-specific p with explicit mapping via names
group_dilution(Reg_ID, Nar_vec, p = c("1"=0.7, "2"=0.5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.