Helper function to help set up penalties
get_penalties(
varnames,
poly,
poly_prefix = "poly_",
int_sep = "\\:",
pool = FALSE,
gamma = 0.5,
cumulative_k = FALSE,
cumulative_poly = TRUE
)
a list of relevant information for the variables, including:
the numeric value of the penalties
Variable type (main effect, order k interaction, etc)
names of variables
names of the covariates in the model matrix
max polynomial considered
what comes before the polynomial specification in these varnames?
What denotes the multiplication for interactions?
Should polynomials and interactions be pooled?
How much should the penalty increase with group size (0.5 assumes equal contribution of prior information)
Should penalties be increased cumulatively as order interaction increases? (only used if !pool)
Should penalties be increased cumulatively as order polynomial increases? (only used if !pool)
This is primarily a helper function for sparseR, but it may be useful if doing the model matrix set up by hand.