
Updating index coefficients and non-linear functions iteratively
Source:R/model_smimodel.R
inner_update.RdIteratively updates index coefficients and non-linear functions using mixed
integer programming. (A helper function used within
update_smimodelFit; users are not expected to directly call
this function.)
Arguments
- x
Fitted
gam.- data
Training data set on which models will be trained. Should be a
tsibble.- yvar
Name of the response variable as a character string.
- family
A description of the error distribution and link function to be used in the model (see
glmandfamily).- index.vars
A
charactervector of names of the predictor variables for which indices should be estimated.- s.vars
A
charactervector of names of the predictor variables for which splines should be fitted individually (rather than considering as part of an index).- linear.vars
A
charactervector of names of the predictor variables that should be included linearly into the model.- num_ind
Number of indices.
- dgz
The
tibbleof derivatives of the estimated smooths.- alpha_old
Current vector of index coefficients.
- lambda0
Penalty parameter for L0 penalty.
- lambda2
Penalty parameter for L2 penalty.
- M
Big-M value to be used in MIP.
- max.iter
Maximum number of MIP iterations performed to update index coefficients for a given model.
- tol
Tolerance for loss.
- TimeLimit
A limit for the total time (in seconds) expended in a single MIP iteration.
- MIPGap
Relative MIP optimality gap.
- NonConvex
The strategy for handling non-convex quadratic objectives or non-convex quadratic constraints in Gurobi solver.
- verbose
A named list controlling verbosity options. Defaults to
list(solver = FALSE, progress = FALSE).- solver
Logical. If TRUE, print detailed solver output.
- progress
Logical. If TRUE, print optimisation algorithm progress messages.
Value
A list containing following elements:
- best_alpha
The vector of best index coefficient estimates.
- min_loss
Minimum value of the objective function(loss).
- index.ind
An
integervector that assigns group index for each predictor, corresponding tobest_alpha.- ind_pos
A list that indicates which predictors belong to which index, corresponding to
best_alpha.- X_new
A matrix of selected predictor variables, corresponding to
best_alpha.