Learn R Programming

invivoPKfit (version 2.0.2)

fit_sigma.pk: Hyperparameter fitting

Description

Fit hyperparameter sigma for a `pk` object with pre-calculated model predictions

Usage

fit_sigma.pk(obj, preds, pred_col, k = 2, ...)

Value

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`.

Arguments

obj

A [pk] object.

preds

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()].

pred_col

A character vector with the name of the column with predictions.

k

Default 2. The `k` parameter in the log-likelihood formula (see Details). Must be named if used.

...

Additional arguments. Not currently in use.

Author

Gilberto Padilla Mercado

Details

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.