value of information calculations in r

18
Value of information calculations in R Howard Thom with Wei Fang, Zhenru Wang, Mike Giles, Chris Jackson, Mike Giles, Christoph Andrieu and Nicky Welton UCL, 11 th July 2018 School of Social and Community Medicine

Upload: others

Post on 21-Oct-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Value of information calculations in R

Value of information calculations in R

Howard Thom with

Wei Fang, Zhenru Wang, Mike Giles, Chris Jackson, Mike Giles,

Christoph Andrieu and Nicky Welton

UCL, 11th July 2018

School of Social and Community Medicine

Page 2: Value of information calculations in R

Overviewโ€ข Recall the formula for the expected value of partial perfect information (EVPPI)

๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ ๐‘‹ = ๐ธ๐‘‹ max๐‘‘โˆˆ๐ท๐ธ๐‘Œ|๐‘‹ ๐‘๐ต๐‘‘ ๐‘‹, ๐‘Œ โˆ’ max

๐‘‘โˆˆ๐ท๐ธ๐‘‹,๐‘Œ ๐‘๐ต๐‘‘ ๐‘‹, ๐‘Œ

โ€ข EVPPI can be estimated (in principle) by nested Monte Carlo simulation:

1

๐‘

๐‘›=1

๐‘

max๐‘‘โˆˆ๐ท

1

๐‘€

๐‘š=1

๐‘€

๐‘๐ต๐‘‘ ๐‘‹(๐‘›), ๐‘Œ(๐‘š,๐‘›) โˆ’max

๐‘‘โˆˆ๐ท

1

๐‘€๐‘

๐‘›=1

๐‘

๐‘š=1

๐‘€

๐‘๐ต๐‘‘ ๐‘‹(๐‘›), ๐‘Œ(๐‘š,๐‘›)

โ€ข This requires ๐‘ samples of ๐‘‹(๐‘›) and M samples ๐‘Œ(๐‘š,๐‘›) conditional on each ๐‘‹(๐‘›)

โ€ข This nested simulation is biased due to Jensenโ€™s inequality and computationally intensive.

โ€ข Near impossible to estimate using Excel; possible in R but may struggle for complex models

โ€ข R can parallelise computation to increase efficiency: run each sample from ๐‘‹(๐‘›) on separate CPU.โ€ข Package โ€˜parallelโ€™ in R.

โ€ข Can also use meta-modelling techniques, some of which have been implemented in easy-to-use R

packages or online servies.

โ€ข We propose using efficient Monte Carlo sampling schemes for efficient and accurate estimation

Page 3: Value of information calculations in R

Meta-modelling approaches

โ€ข Consider the first term of the EVPPI

๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ ๐‘‹ = ๐ธ๐‘‹ max๐‘‘โˆˆ๐ท๐ธ๐‘Œ|๐‘‹ ๐‘๐ต๐‘‘ ๐‘‹, ๐‘Œ โˆ’ max

๐‘‘โˆˆ๐ท๐ธ๐‘‹,๐‘Œ ๐‘๐ต๐‘‘ ๐‘‹, ๐‘Œ

โ€ข We can remove the nested simulation by regressing ๐‘๐ต๐‘‘ ๐‘‹, ๐‘Œ on ๐‘‹๐‘๐ต๐‘‘ ๐‘‹, ๐‘Œ = ๐ธ๐‘Œ|๐‘‹ ๐‘๐ต๐‘‘ ๐‘‹, ๐‘Œ + ํœ€

๐‘๐ต๐‘‘ ๐‘‹, ๐‘Œ = ๐‘”๐‘‘(๐‘‹) + ํœ€

โ€ข Where ๐‘”๐‘‘(๐‘‹) is some unknown smooth function and ๐ธ ํœ€ = 0

โ€ข The fitted values ๐‘”๐‘‘ ๐‘‹ are estimates of ๐ธ๐‘Œ|๐‘‹ ๐‘๐ต๐‘‘ ๐‘‹, ๐‘Œ

โ€ข EVPPI now requires only a single loop

๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ ๐‘‹ โ‰ˆ1

๐พ

๐‘˜=1

๐พ

max๐‘‘ ๐‘”๐‘‘ ๐‘‹(๐‘˜) โˆ’max

๐‘‘

1

๐พ

๐‘˜=1

๐พ

๐‘”๐‘‘ ๐‘‹(๐‘˜)

โ€ข Need to choose a ๐‘”๐‘‘() that represents well how ๐‘๐ต๐‘‘ depends on ๐‘‹, ๐‘Œ, ๐‘๐ต๐‘‘โ€ข Estimating ๐‘”๐‘‘() itself may be computationally challenging

Page 4: Value of information calculations in R

Generalised additive modelโ€ข The generalised additive model (GAM) is commonly used to estimate EVPPI for sets of up to

5 parameters.

โ€ข Assuming ๐‘ (๐‘‹) is a smooth function, the GAM is

๐‘๐ต๐‘‘๐‘˜= ๐‘  ๐‘‹ ๐‘˜ + ํœ€(๐‘˜)

โ€ข Where the function ๐‘ (๐‘‹) is a sum of known โ€˜basisโ€™ functions

๐‘  ๐‘‹ =

๐‘›=1

๐‘

๐›พ๐‘›๐‘๐‘›(๐‘‹)

โ€ข The ๐›พ๐‘› are parameters estimated from the samples of ๐‘๐ต๐‘‘ and ๐‘‹.

โ€ข In higher dimensions would need to specify a multivariate smooth function

๐‘๐ต๐‘‘ = ๐‘  ๐‘‹1, โ€ฆ , ๐‘‹๐‘ž + ํœ€

โ€ข Would need ๐‘๐‘ž basis functions where ๐‘ is number of basis functions needed for each

dimension.

โ€ข Computationally infeasible if number of independent variables greater than 5 or 6

โ€ข GAM are implemented in the BCEA for R package and the SAVI website.

Page 5: Value of information calculations in R

Gaussian process regressionโ€ข A further option implemented in BCEA and SAVI is Gaussian process (GP) regression

โ€ข The regression model is

๐‘๐ต๐‘‘ = ๐‘”๐‘‘(๐‘ฟ๐‘–) + ํœ€

with ํœ€~๐‘(0, ๐œŽ2)

โ€ข The ๐‘ฟ๐‘– are the set of ๐‘ž focal parameters

โ€ข Now the function ๐‘”๐‘‘(๐‘ฟ๐‘–) is a GP which is equivalent to

๐‘๐ต(๐‘‹)~๐‘๐‘œ๐‘Ÿ๐‘š๐‘Ž๐‘™(๐‘ฏ๐›ฝ, ๐œŽ2๐œฎ(๐›ฟ) + ฮฝ๐‘ฐ)

โ€ข Where

๐‘ฏ =

1 ๐‘‹1(1)

1 ๐‘‹1(2)

โ‹ฏ ๐‘‹๐‘ž(1)

โ‹ฏ ๐‘‹๐‘ž(2)

โ‹ฎ โ‹ฎ

1 ๐‘‹1(๐‘)โ‹ฑ โ‹ฎ

โ‹ฏ ๐‘‹๐‘ž(๐‘)

โ€ข Hyperparameters are pre-specified by the SAVI software, which may adversely affect its performance.

โ€ข R code available that can better estimate the hyperparameters and conduct GP regression.

โ€ข GP involves inverting an ๐‘ ร— ๐‘ matrix at ๐‘‚(๐‘3) computational cost.

โ€ข The dimension of the focal parameters ๐‘ฟ๐‘– also influences the cost.

Page 6: Value of information calculations in R

SPDE-INLAโ€ข The BCEA package includes a highly efficient adaptation of the GP regression method.

โ€ข Adapts ideas from spatial statistics for approximation of high dimensional with low dimensional

problems

โ€ข Approximates high dimensional GP with low dimensional GP that is solution to a form of SPDE.

โ€ข This changes task from inverting dense ๐‘ ร—๐‘ matrix at ๐‘‚(๐‘3) cost to inverting sparse ๐‘ ร—๐‘ matrix at ๐‘‚(๐‘ 32) cost

โ€ข SPDE is latent Gaussian model, efficiently solved by integrated nested Laplace approximation (INLA)โ€ข BCEA uses the โ€˜R-INLAโ€™ package in R.

โ€ข SPDE approach doesnโ€™t work in high dimensional parameter space.

โ€ข BCEA therefore uses principal fitted components projection to reduce to 2-dimensions.โ€ข BCEA uses the โ€˜ldrโ€™ package in R.

โ€ข Syntax in R is relatively simple:

evppi.inla<-evppi(param.indices,all.param.samples,bcea.model.object,method="INLA")

Page 7: Value of information calculations in R

Multilevel Monte-Carloโ€ข Key idea is to choose an estimator ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ0 with a larger bias but much lower cost than ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ.

โ€ข We can then construct the EVPPI estimator

1

๐‘0

๐‘›=1

๐‘0

๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ0(๐‘›)+1

๐‘1

๐‘›=1

๐‘1

๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ(๐‘›) โˆ’ ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ0(๐‘›)

โ€ข We then need only estimate the (cheap) ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ0 and the difference ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ โˆ’ ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ0.

โ€ข So long as ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ and ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ0 are highly correlated the variance will be small and number of samples

๐‘1 for accurate estimation will be small.

โ€ข The variance of ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ0 is close to that of ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ so ๐‘0 is similar to number needed to estimate ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ

โ€ข This extends naturally via a sequence of estimators ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ0, ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ1, โ€ฆ, ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ๐ฟ to the estimator

1

๐‘0

๐‘›=1

๐‘0

๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ0(0,๐‘›)+

๐‘™=1

๐ฟ1

๐‘๐‘™ ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ(๐‘™,๐‘›) โˆ’ ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ0

(๐‘™,๐‘›)

Page 8: Value of information calculations in R

MLMC for EVPPIโ€ข In practice it is more efficient o estimate the quantity

๐ท๐ผ๐น๐น = ๐ธ๐‘‰๐‘ƒ๐ผ โˆ’ ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ

โ€ข The MLMC estimator using ๐‘๐‘™ outer samples for each level ๐‘™ is then

๐ท๐ผ๐น๐น =

๐‘™=1

๐ฟ1

๐‘๐‘™

๐‘›=1

๐‘๐‘™

๐ท๐ผ๐น๐น๐‘™(๐‘™,๐‘›)โˆ’ ๐ท๐ผ๐น๐น๐‘™โˆ’1

(๐‘™,๐‘›)

โ€ข Unlike NMC, MLMC provides an estimate of the estimation bias

๐ธ ๐ท๐ผ๐น๐น๐ฟ+1 โˆ’ ๐ท๐ผ๐น๐น๐ฟ ~

๐‘™=๐ฟ+1

โˆž

๐ธ ๐ท๐ผ๐น๐น๐‘™ โˆ’ ๐ท๐ผ๐น๐น๐‘™โˆ’1 = ๐ท๐ผ๐น๐น โˆ’ ๐ธ ๐ท๐ผ๐น๐น๐ฟ

โ€ข Number of levels ๐ฟ is chosen to achieve bias โ‰ค 0.5ํœ€ and ๐‘๐‘™ chosen to achieve variance โ‰ค 0.75ํœ€2.

โ€ข This achieves Mean Square Error (MSE) ํœ€2 at a cost which is only ๐‘‚ ํœ€โˆ’2

โ€ข Nested Monte-Carlo would require ๐‘‚ ํœ€โˆ’3

โ€ข Package โ€˜mlmcโ€™ exits in R and forthcoming publication will include example code.

Page 9: Value of information calculations in R

Quasi Monte Carlo

โ€ข Assuming ๐‘” is a real-valued function and ๐‘‹ is a random variable with cumulative distribution ๐น, we

estimate ๐ธ ๐‘”(๐‘‹) by

1

๐‘

๐‘›=1

๐‘

๐‘” ๐‘‹๐‘–

where ๐‘‹๐‘– = ๐นโˆ’1 ๐‘ˆ๐‘– and ๐‘ˆ๐‘– are uniformly distributed in 0,1 .

โ€ข Standard MC chooses ๐‘ˆ๐‘– for ๐‘‹๐‘– randomly.

โ€ข QMC chooses ๐‘ˆ๐‘– for ๐‘‹๐‘– systematically.

โ€ข QMC is deterministic and achieves a better convergence rate of the error than MC

โ€ข For EVPPI, only apply QMC to outer samples N as not many inner samples ๐‘€ are needed for

accuracy.

โ€ข A confidence interval for estimated EVPPI can be provided using randomized QMC.

โ€ข Randomized QMC is unbiased and has much lower variance than NMC.

Page 10: Value of information calculations in R

Quasi Monte Carlo

โ€ข Example of QMC uniform random number generation in 2-dimensions for 256 points using using rank-1

lattice points or a Sobol sequence.

Page 11: Value of information calculations in R

Depression toy example

โ€ข Artificial example comparing no-treatment with CBT and antidepressants.

โ€ข Decision tree model follows structure used in NICE CG90 guidelines

โ€ข Analysed network meta-analysis data using Markov Chain Monte Carlo (MCMC)

Page 12: Value of information calculations in R

Depression toy example - results

โ€ข MC, MLMC, and QMC based on 50,000 samples; GAM, GP, and INLA on 7500 to account for

additional computation time for regression.

โ€ข MLMC did not offer reliable computational savings over MC.

โ€ข QMC offered substantial computational savings on larger EVPPI values.

โ€ข GAM and INLA perform well on small EVPPI values.

ParametersMC reference

(RMSE)MC QMC MLMC GAM (SE) GP (SE) INLA

Probabilities

(6)275.71 (0.5) 273.62 (5.19) 290.20 (3.03) 274.84 (12.00) NA 332.84 (44.43) 293.44

Costs and

QALYs (6)287.29 (0.5) 286.86 (5.46) 286.93 (4.58) 285.13 (9.80) NA 281.50 (29.92) 547.42

CBT lor (2) 7.35 (0.5) 29.53 (20.47) 44.65 (20.44) 22.03 (19.44) 11.01 (6.46) NA 13.83

Antidepressan

t lor (2)1.78 (0.25) .28 (18.73) 5.12 (16.58) 4.10 (16.00) 2.26 (6.51) NA 4.81

Page 13: Value of information calculations in R

Diagnostic plots from INLA

โ€ข INLA gave unreliable estimates for the cost and utilities parameter set, but diagnostic plots alert us.

โ€ข These are generated using

diag.evppi(x=evppi.inla.lor.anti,y=he.depression)

diag.evppi(x=evppi.inla.lor.anti,y=he.depression,diag="qqplot")

โ€ข Not clear what the problem is: the model structure is a simple decision tree and these (log) cost and

utilities parameters follow independent normal distributions.

Page 14: Value of information calculations in R

DOACs for atrial fibrillation

โ€ข 17 health states plus two

transient events (TIA and

SE)

โ€ข 5 treatment options:

coumarin, apixaban,

dabigatran, rivaroxaban,

edoxaban.

โ€ข Competing risks NMA fit

using MCMC (35-dim)

โ€ข Baseline hazards (7-dim)

and hazard ratios relative to

no treatment (7-dim) also

used MCMC

โ€ข Impact of previous events on

future risks, cost and utility

parameters bring total to 99.

AF Well

MI

Stroke

Major Bleed

ICH

B+S

ICH+S

MI+S

B+MI

B+MI+S

B+ICH+S S+B

+MI+ICH De

ad

ICH+MI

B+ICH+MI

ICH+MI+S

B+ICH

Page 15: Value of information calculations in R

DOACs model results

โ€ข MC, MLMC, and QMC cost are 105 samples.

โ€ข INLA and GP based on only 7500 samples (max accepted by SAVI)

โ€ข GAM cannot be used as parameter sets too large.

โ€ข INLA and GP did not give accurate results with small number of simulations.

โ€ข Only (parallel computationally intensive) nested MC, MLMC and QMC provided reliable resultsโ€ฆ

Parameters

(N)

Reference

value (RMSE)MC cost MLMC cost QMC cost GP (SE) INLA

Simple trial

(14)196.69 (1.23) 2144 68.63 - 561.26 (68.22) 741.09

Complex trial

(79)273.33 (1.23) 157 33.78 89.54 869.79 (69.87) -

All MCMC

(41)348.23 (1.23) 139.9 24.47 31.72 782.38 (73.95) 256.56

Loghr MCMC

(28)286.48 (1.23) 317.1 31.85 21.21 978.03 (94.67) 551.98

Page 16: Value of information calculations in R

Conclusions

โ€ข Wealth of options for estimating EVPPI in R

โ€ข For simple models (decision trees, low-state Markov) and low dimensional

parameter sets, SAVI and BCEA can be efficient and reliable.

โ€ข In more complex situations, necessary to use parallel computing Monte Carlo

or advanced sampling schemes.

โ€ข However, these are more challenging to implement and there are no black-

box functions similar to BCEA or SAVI.

โ€ข Parallel computing and efficient sampling schemes are near impossible to

implement in Excel.

Page 17: Value of information calculations in R

Acknowledgementsโ€ข Hubs for Trials Methodology Research (HTMR), Network Grant N79, Efficient sample schemes for

estimation of value of information of future research.

โ€ข The HTMR Collaboration and innovation in Difficult and Complex randomised controlled Trials In

Invasive procedures (ConDuCT-II) hub provided support for this research.

โ€ข Funding for the DOACs model was provided by NIHR HTA grant 11/92/17

โ€ข This study was supported by the NIHR Biomedical Research Centre at the University Hospitals Bristol

NHS Foundation Trust and the University of Bristol. The views expressed in this presentation are those

of the author(s) and not necessarily those of the NHS, the National Institute for Health Research or

the Department of Health.

Page 18: Value of information calculations in R

MLMC for EVPPI

โ€ข To apply MLMC to EVPPI we instead estimate the quantity

๐ท๐ผ๐น๐น = ๐ธ๐‘‰๐‘ƒ๐ผ โˆ’ ๐ธ๐‘‰๐‘ƒ๐‘ƒ๐ผ = ๐ธ๐‘‹,๐‘Œ max๐‘‘โˆˆ๐ท๐‘“(๐‘‹, ๐‘Œ) โˆ’ ๐ธ๐‘‹ max

๐‘‘โˆˆ๐ท๐ธ๐‘Œ|๐‘‹ ๐‘“๐‘‘ ๐‘‹, ๐‘Œ

โ€ข The NMC estimator with 2๐‘™ inner samples based on ๐‘‹ ๐‘› is

๐ท๐ผ๐น๐น๐‘™ =1

2๐‘™

๐‘š=1

2๐‘™

max๐‘‘โˆˆ๐ท๐‘“๐‘‘ ๐‘‹(๐‘›), ๐‘Œ(๐‘›,๐‘š) โˆ’max

๐‘‘โˆˆ๐ท

1

2๐‘™

๐‘š=1

2๐‘™

๐‘“๐‘‘ ๐‘‹(๐‘›), ๐‘Œ(๐‘›,๐‘š)

โ€ข MLMC generates a sequence of differences ๐ท๐ผ๐น๐น๐‘™ โˆ’ ๐ท๐ผ๐น๐น๐‘™โˆ’1 and estimates the telescoping sum

๐ธ ๐ท๐ผ๐น๐น๐ฟ = ๐ธ ๐ท๐ผ๐น๐น0 +

๐‘™=1

๐ฟ

๐ธ ๐ท๐ผ๐น๐น๐‘™ โˆ’ ๐ท๐ผ๐น๐น๐‘™โˆ’1

โ€ข For low ๐‘™, ๐ท๐ผ๐น๐น๐‘™ โˆ’ ๐ท๐ผ๐น๐น๐‘™โˆ’1 is cheap to evaluate, for high ๐‘™ it has a low variance so few samples are

needed to estimate its expectation