| match_control {FlexGAM} | R Documentation |
Function to check the control parameters
Description
Controls if the values of the control parameters are correct. If any control parameters are missing those are set to default. For internal use only.
Usage
match_flexgam_control(control = NULL, formula = formula, data=NULL)
Arguments
control |
List of control parameters or NULL. |
formula |
Formula of the model to calculate the initial smoothing parameters. |
data |
Data of the model to calculate the initial smoothing parameters. |
Details
Controls if the values of the control parameters are correct. If control parameters are missing they are set to default:
-
"max_iter_in"=100Maximal number of inner iterations. -
"max_iter_out"=100Maximal number of outer iterations. -
"delta_in"=1e-06Convergence of inner iterations. -
"delta_out"=1e-06Convergence of outer iterations. -
"min_mu_k"=1e-06Minimal value of the fitted value. Also used to generate the upper limit for binomial data. Used to truncate the fitted values for numeric stability. (Occurrence can be read in the details). -
"min_Psi_d"=1e-06Minimal value of the derivative of the outer function. Used to truncate the derivatives for numeric stability. (Occurrence can be read in the details). -
"min_increase"=1e-04Minimal increase of the outer function. -
"delta_halving"=1e-06Minimal difference at step-halving. -
"min_iter_halving_in"=1From which inner iteration should step halving be possible? -
"min_iter_halving_out"=2From which outer iteration the deviance stopping criterion should be applied? The minimum value is 2, to get the algorithm always starting. -
"opt_function"="optim"Which optimization function should be used to optimize the smoothing parameters? (nlminboroptim(Nelder-Mead)) -
"initial_sm"=TRUEShould the smoothing parameters of the standardmgcv::gambe used as initial values for the covariates smoothing parameters and a grid search be applied to get initial values for the smoothing parameter of the outer function? -
"fix_smooth"=FALSEShould the initial smoothing parameters (sm_par_vec) be used without optimization? -
"sm_par_vec"=c("lambda"=1,"s(x1)"=...)Initial smoothing parameters. Vector must start with"lambda"for the response function. The names of the covariate effects must fit to themgcvoutput of the specified formula. There is no need to specify the initial parameters, ifinitial_sm = TRUEandfix_smooth = FALSE. -
"sp_range"=c(1e-8, 1e15)Range of all smoothing parameters. -
"reltol_opt"=1e-06Relative tolerance for optimizing the smoothing parameters. -
"quietly"=FALSEShould the algorithm print steps of optimizing the smoothing parameters and iteration procedure for the final model? -
"save_step_response"=FALSEShould the steps of the algorithm be saved for convergences checks? -
"initial_model"=c("with_intercept","no_intercept")Whether the initial model should be estimated with or without intercept.
Value
List of control parameters to fit the flexgam model.
Note
The function is designed for internal usage.
Author(s)
Elmar Spiegel
References
Spiegel, Elmar, Thomas Kneib and Fabian Otto-Sobotka. Generalized additive models with flexible response functions. Statistics and Computing (2017). https://doi.org/10.1007/s11222-017-9799-6
See Also
Examples
# Only for internal usage.