Pharmaco interface (PKBugs Version 2.0)

Note: a bug has been identified which caused some multiple-dosing intravenous-infusion regimens to be specified incorrectly. This only applies to the Pharmaco interface -- PKBugs (running under WinBUGS 1.3) contains no known errors. All 'steady state' doses with 'intravenous infusion' specified as the input process were previously calculated incorrectly; the version of Pharmaco that can be downloaded below, however, includes a fix for this bug and can be installed directly over the top of any existing installations. I am very sorry for any inconvenience.

Note that the following BUGS-language elements were affected by the above bug: "pk.model", "", "pkIVinf1ss", "pkIVinf2ss", "pkIVinf3ss", "pk.model.M", "", "pkIVinf1ss.M", "pkIVinf2ss.M", and "pkIVinf3ss.M".

Pharmaco is an add-on interface to WinBUGS 1.4 that, together with WBDiff, constitutes Version 2.0 of the PKBugs software. Version 1.1 of PKBugs is still required in order to perform simple "point-and-click" specification of population PK models (i.e. without using the BUGS language) but Pharmaco will allow WinBUGS code generated using the "Print model" option in PKBugs 1.1 to be run directly through WinBUGS 1.4. This, of course, makes accessible to the population PK analyst the various new features of WinBUGS 1.4, such as the ability to run scripts in "batch-mode" and the facility to specify the structural model in terms of differential equations via WBDiff.

Some very minor alterations to the WinBUGS code generated using PKBugs 1.1's "Print model" option are required before that code can be run under the Pharmaco interface in WinBUGS 1.4: the loop (over "i" and "j") defining the "omega" matrix should be replaced by a single line of code in which "omega" is specified in terms of WinBUGS 1.4's matrix-valued version of the "inverse(.)" function. For your convenience I have prepared an upgrade patch for PKBugs 1.1 that will incorporate into the software a new menu option, namely "Export model", that will make this modification for you, i.e. WinBUGS code generated using the "Export model" option will run under WinBUGS 1.4 without any alterations (as long as the Pharmaco interface has been installed). (Note that with the upgrade patch installed, "Export model" should be used instead of "Print model".)

You can download the PKBugs 1.1 upgrade patch that installs the "Export model" option alluded to above from here. The Pharmaco interface itself can be downloaded from here.


  1. Pharmaco includes all of the 28 "single dose" models described in Section 2.1 of the PKBugs User Guide. These are used in exactly the same way as in WinBUGS 1.3/PKBugs 1.1, e.g.

    model[j] <- pkIVbol2(theta[i, 1:p], time[j], dose).
  2. If you wish to speed up your analysis, try appending ".M" to the model name, e.g.

    model[j] <- pkIVbol2.M(theta[i, 1:p], time[j], dose),
    model[j] <-, theta[i, 1:p], ...).

    If the structural model is complex, this will usually speed things up. It may, however, slow things down instead, so beware!
        Last Updated   January 2007

Site maintained by:
Dave Lunn
MRC Biostatistics Unit,
Institute of Public Health,
University Forvie site,
Robinson Way,
Cambridge CB2 0SR