fit: Fit the model

Description Usage Arguments Details Value See Also Examples

View source: R/fit_model.R

Description

This function is called internally by fit_all_models. It is the actual function performing the fitting procedure. To fit all the models, use fit_all_models instead.

Usage

1
2
fit(data, param_matrix_ini, xtol_rel = 1e-07, maxtime = Inf, lb = 0,
  ub = 3, print_level = 0)

Arguments

data

The dataset to be used

param_matrix_ini

The matrix storing initial values for the parameters

xtol_rel

Tolerance parameter for nloptr

maxtime

Maximum time (in seconds) allowed for nloptr to fit; use Inf for best fit!

lb

Lower boundary for parameter values during the optimisation (default = 0)

ub

Upper boundary for parameter values during the optimisation (default = 3)

print_level

Printing setting for nloptr

Details

The function uses the computation of the likelihood from logLik_from_vector_param and optimise the parameter values using the optimisation routine nloptr from the package of the same name. Specifically, we are using the method called "NLOPT_LN_BOBYQA".

Value

A list containing the outcome of the fitting procedure

See Also

fit_all_models

Examples

1
2
3
4
pmat_ini <- build_param_matrix(param_values = c(0.1, 0.2), param_str = c("w1" = "s"))
pmat_ini
## Warning: increase maxtime for real fit!
fit(data = SurvEles_small, param_matrix_ini = pmat_ini, maxtime = 1)

courtiol/SileR documentation built on May 16, 2020, 8:10 p.m.