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"
=100
Maximal number of inner iterations. -
"max_iter_out"
=100
Maximal number of outer iterations. -
"delta_in"
=1e-06
Convergence of inner iterations. -
"delta_out"
=1e-06
Convergence of outer iterations. -
"min_mu_k"
=1e-06
Minimal 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-06
Minimal 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-04
Minimal increase of the outer function. -
"delta_halving"
=1e-06
Minimal difference at step-halving. -
"min_iter_halving_in"
=1
From which inner iteration should step halving be possible? -
"min_iter_halving_out"
=2
From 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? (nlminb
oroptim(Nelder-Mead)
) -
"initial_sm"
=TRUE
Should the smoothing parameters of the standardmgcv::gam
be 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"
=FALSE
Should 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 themgcv
output of the specified formula. There is no need to specify the initial parameters, ifinitial_sm = TRUE
andfix_smooth = FALSE
. -
"sp_range"
=c(1e-8, 1e15)
Range of all smoothing parameters. -
"reltol_opt"
=1e-06
Relative tolerance for optimizing the smoothing parameters. -
"quietly"
=FALSE
Should the algorithm print steps of optimizing the smoothing parameters and iteration procedure for the final model? -
"save_step_response"
=FALSE
Should 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.