stan-dev / projpred

Projection predictive variable selection
https://mc-stan.org/projpred/
Other
109 stars 25 forks source link

Options to integrate out group-level effects #379

Closed fweber144 closed 1 year ago

fweber144 commented 1 year ago

In case of multilevel models, this PR adds two global options for "integrating out" group-level effects: projpred.mlvl_pred_new and projpred.mlvl_proj_ref_new. These refer to prediction time and projection time, respectively (the latter only affecting the reference model, not the submodels) and are explained in detail in the updated general package documentation (?`projpred-package`) from this PR. The defaults for these options are such that the former behavior is retained.

Note that "prediction time" also includes the submodel predictions from .init_submodel(), affecting KL divergence (or rather cross-entropy, i.e., output element ce) and the projected dispersion parameter values. Because of the latter, a warning is thrown when constructing a refmodel object with the final dis being not all-NAs (except for a few latent-projection cases where such a warning is not necessary).

The integration across the group-level effects is performed by considering existing group-levels from the training data as new group levels and drawing group-level effects randomly for these (for actually new group levels, drawing group-level effects randomly has already been done before).