Fit hyperparameter sigma for a `pk` object with pre-calculated model predictions
fit_sigma.pk(obj, preds, pred_col, k = 2, ...)
The same [pk] object, with new element beginning with `ext_fit` containing a list of the prediction data used as input and two data.frames with optimized sigma values and AICs for those predictions per `data_group`.
A [pk] object.
A data.frame similar to the results from [predict.pk()] which contains pre-calculated predictions in addition to the concentration over time values which can be obtained from [get_data.pk()].
A character vector with the name of the column with predictions.
Default 2. The `k` parameter in the log-likelihood formula (see Details). Must be named if used.
Additional arguments. Not currently in use.
Gilberto Padilla Mercado
This function estimates the hyperparameter \(\sigma\) from a data.frame of pre-calculated model predictions, using numerical optimization implemented in [optimx::optimx()]. The optimization is done by maximizing the log-likelihood function implemented in [log_likelihood()]. Only the non-excluded observations are used.