This function uses optim to fit the triphasic model to data from a given subject
get_optim_fit_triphasic(initial_params, param_names, free_param_index,
data, forward_param_transform_fn = forward_param_transform_fn,
inv_param_transform_fn = inv_param_transform_fn, searchmethod)
named vector of the initial parameter guess.
names of parameter vector.
logical vector indicating whether the parameters A, delta, A_b, delta_b, B, gamma are to be recovered. This should be c(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) for the triphasic model.
dataframe with columns for the subject's viral load measurements ('vl'), and timing of sampling ('time')
list of transformation functions to be used when fitting the model in optim. Defaults to log transformations for all parameters (to allow unconstrained optimization).
list of transformation functions to be used when back-transforming the transformed parameters. Should be the inverse of the forward transformation functions. Defaults to exponential.
optimization algorithm to be used in optim. Defaults to Nelder-Mead.