This function maximises the likelihood of the observed data using the Port algorithm stats::nlminb(), and the specified initial or fixed parameters and starting values. In each step of the optimisation, the kinetic model is solved using the function mkinpredict(), except if an analytical solution is implemented, in which case the model is solved using the degradation function in the mkinmod object. The parameters of the selected error model are fitted simultaneously with the degradation model parameters, as both of them are arguments of the likelihood function.

mkinfit(
mkinmod,
observed,
parms.ini = "auto",
state.ini = "auto",
err.ini = "auto",
fixed_parms = NULL,