About 30 years ago, a friend asked if I could add Bayesian analysis to my pharmacokinetic (PK) programs: “Look at the equation—it is very simple.” Yes, deceptively so. By this same logic, Einstein’s Field Equations are also simple.

Of course, in both cases, implementation is exponentially more complex. I chose the Levenberg–Marquardt (LM) Maximum A Posteriori (MAP) estimation because it is a fast and accurate optimizer and is considered the gold standard for therapeutic drug monitoring (TDM). MAP estimation finds the best-fit PK parameters given both observed data and the population model. Another way of putting it, MAP shrinks estimates toward the population mean, and that “shrinkage” is why it is so useful in TDM.
LM uses gradient information—it computes the Jacobian (partial derivatives of the predicted concentration with respect to each parameter) at every iteration and uses that to steer directly toward the minimum. This makes it fast and accurate in well-behaved models.
However, least squares (Error²) penalizes outliers exponentially. Outliers create gradients that can pull the algorithm toward a nonsensical solution, or create local minima that the Jacobian calculation cannot “see” past.
Users get frustrated when our Bayesian analysis software returns a “Bayesian failed” message. In the classic Bayesian scenario, the fallback in the presence of an outlier is effectively a return to the population model. Obviously, that is not safe—hence the “Bayesian failed” message.
The root of the problem is that vancomycin pharmacokinetics vary widely. In addition, failure to converge is more likely with fewer data points. Therefore, a single-point vancomycin analysis involving an outlier fails too often.
I have always been dissatisfied with this outcome, as there was no fallback. Lately, I have been working on a safe alternative when the data fail to converge with LM. Here is a comparison of common methods for implementing Bayesian serum level analysis. Most are designed for population PK analysis, not individual patient TDM.

I developed a small utility to compare the three most clinically useful Bayesian implementations, and they generally show agreement: Bayesian PK Method Comparator
I believe the Nelder–Mead (downhill simplex) method can serve as a useful fallback, provided appropriate guardrails are in place. I am currently evaluating its integration.