@@ -198,9 +198,8 @@ estim_param <- function(obs_list, crit_function = crit_log_cwss, model_function,
198
198
CroptimizR :: BIC , CroptimizR :: AICc ,
199
199
CroptimizR :: AIC
200
200
),
201
- weight = NULL ,
201
+ weight = NULL ,
202
202
var_names = lifecycle :: deprecated()) {
203
-
204
203
# Managing parameter names changes between versions:
205
204
if (rlang :: has_name(optim_options , " path_results" )) {
206
205
lifecycle :: deprecate_warn(" 0.5.0" , " estim_param(optim_options = 'is deprecated, use `out_dir` instead of `path_results`')" )
@@ -299,12 +298,14 @@ estim_param <- function(obs_list, crit_function = crit_log_cwss, model_function,
299
298
" The following parameters are defined both in forced_param_values and param_info
300
299
arguments of estim_param function while they should not (a parameter cannot
301
300
be both forced and estimated except if it is part of the `candidate` parameters):" ,
302
- paste(tmp ,collapse = " ," ),
301
+ paste(tmp , collapse = " ," ),
303
302
" \n They will be removed from forced_param_values."
304
303
)
305
304
forced_param_values <-
306
- forced_param_values [setdiff(names(forced_param_values ),
307
- setdiff(param_names , candidate_param ))]
305
+ forced_param_values [setdiff(
306
+ names(forced_param_values ),
307
+ setdiff(param_names , candidate_param )
308
+ )]
308
309
}
309
310
}
310
311
@@ -360,8 +361,8 @@ estim_param <- function(obs_list, crit_function = crit_log_cwss, model_function,
360
361
crt_candidates <- oblig_param_list
361
362
if (length(crt_candidates ) == 0 ) crt_candidates <- candidate_param [[1 ]] # in case there are only candidates ...
362
363
count <- 1
363
- param_selection_steps <- NULL
364
- tmp <- optim_switch(optim_method = optim_method ,optim_options = optim_options )
364
+ param_selection_steps <- NULL
365
+ tmp <- optim_switch(optim_method = optim_method , optim_options = optim_options )
365
366
366
367
# Parameter selection loop
367
368
while (! is.null(crt_candidates )) {
@@ -422,7 +423,7 @@ estim_param <- function(obs_list, crit_function = crit_log_cwss, model_function,
422
423
forced_param_values = forced_param_values_tmp ,
423
424
info_level = info_level ,
424
425
info_crit_list = info_crit_list ,
425
- weight = weight
426
+ weight = weight
426
427
)
427
428
428
429
# # Run the estimation
@@ -432,14 +433,13 @@ estim_param <- function(obs_list, crit_function = crit_log_cwss, model_function,
432
433
)
433
434
434
435
# # In case no results, there was an error during the estimation process => stop
435
- if (length(res_tmp )== 0 ) {
436
+ if (length(res_tmp ) == 0 ) {
436
437
stop(" There was an error during the parameter estimation process.
437
438
Please check warnings and messages displayed above and/or by running warnings()." )
438
439
}
439
440
440
441
# # The following is done only if parameter selection is activated
441
442
if (! is.null(candidate_param )) {
442
-
443
443
# ## Update results in param_selection_steps
444
444
param_selection_steps <- post_treat_FwdRegAgMIP(
445
445
res_tmp , crit_options ,
@@ -465,8 +465,10 @@ estim_param <- function(obs_list, crit_function = crit_log_cwss, model_function,
465
465
466
466
# Print and store results of parameter estimation steps if parameter selection was activated
467
467
if (! is.null(candidate_param )) {
468
- summary_FwdRegAgMIP(param_selection_steps , info_crit_list , path_results_ORI ,
469
- res )
468
+ summary_FwdRegAgMIP(
469
+ param_selection_steps , info_crit_list , path_results_ORI ,
470
+ res
471
+ )
470
472
save_results_FwdRegAgMIP(param_selection_steps , path_results_ORI )
471
473
res $ param_selection_steps <- param_selection_steps
472
474
}
0 commit comments