Gianluca Baio
Department of Statistical Science | University College London
https://gianluca.statistica.it
https://egon.stats.ucl.ac.uk/research/statistics-health-economics
https://github.com/giabaio https://github.com/StatisticsHealthEconomics
@gianlubaio@mas.to @gianlubaio
Bayesian modelling for economic evaluation of healthcare interventions
València International Bayesian Analysis Summer School, 7th edition, University of Valencia
10 - 11 July 2024
Check out our departmental podcast “Random Talks” on Soundcloud!
Follow our departmental social media accounts + magazine “Sample Space”
Generally speaking, the computational effort depends in large part on the definition of the prior…
BUGS
/JAGS
/Stan
/Nimble
INLA
BUGS
WinBUGS
1.4.3
Windows
OpenBUGS
http://www.openbugs.net
Linux
and MacOS
JAGS
http://mcmc-jags.sourceforge.net
Mac
/Unix
/Windows
Stan
http://mc-stan.org/
BUGS
/JAGS
Interfaces exist to run these from other software, eg (R2OpenBUGS
, R2jags
, rstan
) Excel
, S-Plus
, SAS
, Matlab
, Stata
, …
BUGS
/JAGS
Example: linear regression
\[\begin{eqnarray*} y_i & \sim & \dnorm(\mu_i,\sigma) \qquad \mbox{for } i=1,\ldots,N \\ \mu_i & = & \alpha+\beta x_i \\ \tau & \sim & \dgamma(0.01,0.01)\\ \sigma & = & \tau^{-0.5} \\ \alpha & \sim & \dnorm(0,0.01) \\ \beta & \sim & \dnorm(0,0.01) \end{eqnarray*}\]
BUGS
/JAGS
have a built-in parser, which inspects the set of declarations and translates them into a DAG\[\begin{eqnarray*} y & \sim & \dbin(\theta, n) \\ \theta & \sim & \dbeta(a,b) \\ y_{pred} & \sim & \dbin(\theta, m) \end{eqnarray*}\]
NB: \(p(y_{pred}\mid y)\) is the predictive distribution
JAGS
from R
Map the “pen-and-paper” model into JAGS
code
Can code up the model in a .txt.
file
JAGS
from R
m
contains the MCMC output[1] "model" "BUGSoutput" "parameters.to.save"
[4] "model.file" "n.iter" "DIC"
[1] "n.chains" "n.iter" "n.burnin" "n.thin"
[5] "n.keep" "n.sims" "sims.array" "sims.list"
[9] "sims.matrix" "summary" "mean" "sd"
[13] "median" "root.short" "long.short" "dimension.short"
[17] "indexes.short" "last.values" "program" "model.file"
[21] "isDIC" "DICbyR" "pV" "DIC"
[25] "time2run"
Inference for Bugs model at "/tmp/RtmpGy2l2J/model22c593971f56c.txt",
2 chains, each with 6000 iterations (first 1000 discarded)
n.sims = 10000 iterations saved. Running time = 0.015 secs
mu.vect sd.vect 2.5% 97.5% Rhat n.eff
theta 0.563 0.076 0.411 0.708 1.001 10000
y.pred 22.491 4.352 14.000 31.000 1.001 10000
deviance 6.660 2.444 3.372 12.683 1.001 10000
For each parameter, n.eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor (at convergence, Rhat=1).
DIC info (using the rule: pV = var(deviance)/2)
pV = 3.0 and DIC = 9.6
DIC is an estimate of expected predictive error (lower deviance is better).
JAGS
outputR
code to post-process the resultsbmhe
(for diagnostics & plots)BCEA
(for economic evaluation)JAGS
outputJAGS
outputJAGS
output1. Intro HTA 2. Bayesian computation 3. ILD 4. ALD 5. NMA © Gianluca Baio (UCL) | | Bayesian models in HTA | VIBASS7 2024 | 10 - 11 July 2024 |