Home
Using the runjags package
Contents
1. which allows one or more statistics calculated by a user supplied function to be appended to the summary statistics Note that summary options may also be passed to run jags in order to control the summary statistics calculated and appended to the runjags object The plot method produces a series of relevant plots for the selected variables including trace plots empirical cumulative distribution function plots histograms and a cross correlation plot with additional options allowing auto correlation plots and density plots if desired Fur ther plot parameters can be specified using the col and separate chains arguments as well as a named list for each plot type which will be passed to the underlying lattice functions The primary intention with these plots is to provide rapid access to commonly used convergence diagnostics and plot methods associated with mcmc or mcmc list objects may be more flexible and intuitive for producing more specific graphical output from converged MCMC chains The coda package Plummer Best Cowles and Vines 2006 provides such plotting methods as well as many of the underlying functions that calculate the summaries given by runjags A typical examination of a simulation output the default print method and a plot output for variable names partially matching the letter c could be obtained as follows Matthew J Denwood R gt results JAGS model summary statistics from 30000
2. 10 592 601 Yin Z Conti S Desai S Stafford M Slater W Gill ON Simms I 2013 The Geographic Relationship Between Sexual Health Deprivation and the Index of Multiple Deprivation 2010 a Comparison of two Indices Serual Health 10 2 102 11 ISSN 1448 5028 URL http dx doi org 10 1071 SH12057 25 26 runjags JAGS interface utilities and additional distributions A Formulation of the negative binomial as a gamma Poisson The compound probability mass function of a Poisson distribution with mean A integrated over a gamma distribution with shape and scale parameters a and 8 respectively is given in Equation 1 oN 1 f x a 8 f L eT B a le PA dA 1 Substituting a r and 6 1P into Equation 1 gives Equation 2 which can be re written and simplified to Equation 4 f z r p ve z yate F d 2 p V r 1 p ga _ p a U P f artr le e edd 3 z p T r Jo 1 p f ets d 4 z p P r Jo Substituting the gamma function rot ie the dt for a z b z r landt A into Equation 4 gives Equation 5 l p T a r 1 1 f z r p x r 1 1 5 x p T r co eas p 1 p z r ETAD T x r p t 6 TER a Equation 7 is the probability mass function of the negative binomial distribution defining the number of successes x before r failures with a probability of success p which is therefore exactly equivalent to a gamma Poisson compo
3. Gelman and Rubin 1992 has been achieved for all monitored variables and will then extend the simulation further to compensate for any observed autocorrelation The automated assessment of convergence should be verified graphically before making inference from models fit to real data but a fully automated analysis is useful for simulated data and for reinforcing the importance of convergence assessment for novice users The following code will run the same model as above extending the model as necessary up to a maximum total elapsed time of one hour R gt results lt autorun jags model n chains 2 max time 1hr Alternatively an existing model may be extended by the user in order to increase the sample size of the MCMC chains using either the extend jags or autoextend jags function For these functions the arguments add monitor drop monitor and drop chain are provided in order to change the monitored variables and number of chains being run The combine argument controls whether the old MCMC chains should be discarded or combined with the new chains For example the following code will manually extend the existing simulation by 5000 iterations and then extend the simulation again with automatic control of convergence and sample size diagnostics R gt results lt extend jags results sample 5000 R gt results lt autoextend jags results In the second function call the automated diagnos
4. Markov Chain Monte Carlo in Practice Chapman and Hall Boca Raton Fla ISBN 0412055511 URL http www loc gov catdir enhancements fy0646 98033429 d html Hastings WK 1970 Monte Carlo Sampling Methods Using Markov Chains and Their Applications Biometrika 57 1 97 109 URL http dx doi org 10 1093 biomet 5f 19T 24 runjags JAGS interface utilities and additional distributions Kass RE Carlin BP Gelman A Neal RM 1998 Markov Chain Monte Carlo in Practice a Roundtable Discussion The American Statistician 52 2 93 100 Lele SR Dennis B 2009 Bayesian Methods for Hierarchical Models are Ecologists Making a Faustian Bargain Ecological Applications a Publication of the Ecological Society of America 19 3 581 4 ISSN 1051 0761 URL http www ncbi nlm nih gov pubmed 19425420 Lunn D Jackson C Best N Thomas A Spiegelhalter D 2012 The BUGS book A practical introduction to Bayesian analysis CRC press Lunn DJ Thomas A Best N Spiegelhalter D 2000 WinBUGS a Bayesian Modelling Framework Concepts Structure and Extensibility Statistics and Computing 10 4 325 337 ISSN 0960 3174 URL http dx doi org 10 1023 A 1008929526011 Phillips G Tam CC Conti S Rodrigues LC Brown D Iturriza Gomara M Gray J Lopman B 2010 Community Incidence of Norovirus Associated Infectious Intestinal Disease in England Improved Estimates Using Viral Load for Norovirus Diagnosis American
5. Journal of Epidemiology 171 9 1014 22 ISSN 1476 6256 URL http dx doi org 10 1093 aje kwq021 Plummer M 2003 JAGS A Program for Analysis of Bayesian Graphical Models Us ing Gibbs Sampling JAGS Just Another Gibbs Sampler In Proceedings of the 8rd In ternational Workshop on Distributed Statistical Computing DSC 2003 pp March 20 22 Vienna Austria ISSN 1609 395X ISSN 1609395X doi 10 1 1 13 3406 URL http www ci tuwien ac at Conferences DSC 2003 Drafts Plummer pdf Plummer M 2008 Penalized loss functions for Bayesian model comparison Biostatistics 9 523 539 ISSN 14654644 doi 10 1093 biostatistics kxm049 Plummer M 2013 rjags Bayesian Graphical Models Using Mcmc URL http cran r project org package rjags Plummer M Best N Cowles K Vines K 2006 CODA Convergence Diagnosis and Out put Analysis for MCMC R News 6 1 7 11 URL http cran r project org doc Rnews Polson NG Scott JG 2011 On the Half Cauchy Prior for a Global Scale Parameter Cornell University Library arXiv org URL http arxiv org abs 1104 4937 R Core Team 2014 R A Language and Environment for Statistical Computing R Foun dation for Statistical Computing Vienna Austria URL http www R project org Shaw DJ Grenfell BT Dobson AP 1998 Patterns of Macroparasite Aggregation in Wildlife Host Populations Parasitology 117 597 610 ISSN 0031 1820 Spiegelhalter DJ Best NG Carli
6. and S4 R package version 1 1 7 http cran r project org package lme4 Bolker BM Brooks ME Clark CJ Geange SW Poulsen JR Stevens MHH White JSS 2009 Generalized Linear Mixed Models a Practical Guide for Ecology and Evolution Trends in Ecology amp Evolution 24 3 127 35 ISSN 0169 5347 URL http dx doi org 10 1016 j tree 2008 10 008 Matthew J Denwood 23 Brooks SP Roberts GO 1998 Assessing Convergence of Markov Chain Monte Carlo Algo rithms Statistics and Computing 8 319 333 Christiansen CL Morris CN 1997 Hierarchical Poisson Regression Modeling Jour nal of the American Statistical Association 92 618 632 ISSN 0162 1459 doi 10 1080 01621459 1997 10474013 URL http www tandfonline com doi abs 10 1080 01621459 1997 10474013 Conti S Presanis AM van Veen MG Xiridou M Donoghoe MC Rinder Stengaard A De Angelis D 2011 Modeling of the HIV Infection Epidemic in the Netherlands a Multi Parameter Evidence Synthesis Approach The Annals of Applied Statistics 5 4 2359 2384 ISSN 1932 6157 URL http dx doi org 10 1214 11 AQAS488 Daniels M 1999 A prior for the variance in hierarchical models The Canadian Journal of Statistics 27 567 578 ISSN 03195724 doi doi 10 2307 3316112 URL http onlinelibrary wiley com doi 10 2307 3316112 abstract Denwood MJ In Review runjags An R Package Providing Interface utilities model templates parallel computing
7. colours as indicated by the key plot Matthew J Denwood Your model template was created at JAGSmodel txt it is highly advisable to examine the model syntax to be sure it is as intended You can then run the model using run jags JAGSmodel txt jags D93 lt run jags JAGSmodel txt The results of these comparisons are not displayed here but show how the same inference is presented slightly differently in a Bayesian framework The template jags function supports Gaussian zero inflated binomial zero inflated Poisson and zero inflated negative bino mial distributions as well as linear and fixed effects 2 way interactions and random intercept terms specified using the same syntax as lme4 Additional distributions and link functions can be introduced by manually editing the template model file All necessary data initial values monitored variables and modules are saved to the model file using the previously described comment syntax and the template function also saves information about the response vari able fitted estimates and residuals to the model file allowing residuals and fitted methods to be used with the objects returned by run jags 2 7 JAGS module In addition to the R code used to facilitate running JAGS models and summarising results the runjags package also provides a modular extension to the JAGS language providing additional distributions The module can be loaded using the followi
8. methods and additional distributions for MCMC models in JAGS Journal of Statistical Software Denwood MJ 2010 A Quantitative Approach to Improving the Analysis of Faecal Worm egg Count Data Doctoral thesis University of Glasgow URL http www gla ac uk media media 5C_1493387 5C_en pdf Denwood MJ Reid SWJ Love S Nielsen MK Matthews L McKendrick IJ Innocent GT 2010 Comparison of Three Alternative Methods for Analysis of Equine Faecal egg Count Reduction Test Data Preventive Veterinary Medicine 93 4 316 23 ISSN 1873 1716 URL http dx doi org 10 1016 j prevetmed 2009 11 009 Denwood MJ Stear MJ Matthews L Reid SWJ Toft N Innocent GT 2008 The Distri bution of the Pathogenic Nematode Nematodirus battus in Lambs is Zero Inflated Para sitology 135 10 1225 1235 ISSN 1469 8161 Electronic URL http dx doi org 10 1017 S0031182008004708 DuMouchel W 1994 Hierarchical Bayes Linear Models for Meta Analysis Technical Report 27 National Institute of Statistical Sciences URL http www niss org sites default files pdfs technicalreports tr27 pdf Gelman A 2006 Prior Distributions for Variance Parameters in Hierarchical Models Bayesian Analysis 1 3 515 533 Gelman A Rubin DB 1992 Inference from Iterative Simulation Using Multiple Sequences Statistical Science 7 4 457 472 URL http www jstor org stable 2246093 Gilks WR Richardson S Spiegelhalter DJ 1998
9. results will be written once the JAGS process has completed For example the following code will allow a JAGS simulation to be run in the background using two processors in parallel and saving the results in a folder called my simulation in the current working directory R gt info lt run jags model n chains 2 method bgparallel keep jags files mysimulation n sims 2 Starting the simulations in the background The JAGS processes are now running in the background This returns the control of the terminal to the user who can then carry on working in R while waiting for the simulation to complete The default behaviour on completion of the simulations is to alert the user by emitting a beep from the speakers but configuration using runjags options allows a shell script file to be executed instead The info variable contains the name and directory of the simulation which is given to the user if the object is printed The results can be retrieved using either the folder name or the variable returned by the function that started the simulation R gt background results lt results jags mysimulation If the simulation has not yet completed the results jags function will display the JAGS output so that the user can gauge how much longer the simulation will take Further options for the results jags function include recover chains which allows the results of successful simulations to be re
10. the number of data points to drop for each simulation In this case a drop 1 study is run with the number of simulations equal to the number of data points All individual simulations are run using the underlying autorun jags function additional arguments for autorun jags can be passed through drop k as required The initial values for each simulation are taken from the parent simulation including the observed values of the removed data points to ensure that the model will compile The drop 1 study is run and the results displayed using the following syntax limited to the first five data points for brevity R gt assessment lt drop k results drop Y 1 5 k 1 R gt assessment Values obtained from a drop k study with a total of 5 simulations Target Median Mean Lower95 CI Upper95 CI Range95 CI Within95 CI Y 1 11 374 12 149 12 14 10 34 13 985 3 6443 1 Y 2 14 184 14 121 14 115 12 256 15 954 3 6985 1 Y 3 15 164 16 175 16 167 14 431 18 098 3 6673 1 Y 4 19 595 18 078 18 069 16 276 19 898 3 6213 1 Y 5 20 33 20 124 20 116 18 261 21 932 3 6708 1 AutoCorr Lag10 Y 1 0 00059858 y 2 0 004172 Y 3 0 011319 Y 4 0 00099754 Y 5 0 0044123 Average time taken 2 9 seconds range 2 7 seconds 3 1 seconds Average adapttburnin required 5000 range 5000 5000 Average samples required 10685 range 10000 11229 The results show the 95 confidence interval CI for each datapoint obtained from the co
11. to generate these In addition to data and inits a number of optional inline comments are supported as follows e monitors a comma separated list of monitored variables to use which may include the special variables DIC Spiegelhalter Best Carlin and van der Linde 2002 and PED Plummer 2008 which can be used to assess model fit e modules a comma separated list of any JAGS extension modules required optionally also specifying the status e g modules glm on dic on e factories a comma separated list of any JAGS factories and types required op tionally also specifying the status e g factories mix TemperedMix sampler on e response a single variable name specifying the response variable e residual a single variable name specifying a variable that represents the residuals e fitted a single variable name specifying a variable that represents the fitted value Each of these options can also be supplied directly to the relevant function call in R An example of running a model using this style of model specification is as follows R gt model lt model for i in 1 N data N Y i dnorm true y i precision data Y true y i lt coef X i int data X coef dunif 1000 1000 int dunif 1000 1000 precision dexp 1 inits coef int precision RNG seed RNG name monitor coef int precision tttttttet Simulate the data R gt set seed 1 R g
12. 0 00024311 0 00096497 MCerr MCZofSD SSeff AC 10 psrf alpha 0 022911 10 6 89 0 80773 beta 0 0059595 10 5 90 0 83451 gamma 0 000023138 9 5 110 0 6069 Total time taken 0 6 seconds The results show similar inference to that provided by Lunn et al 2012 although with additional information regarding the effective sample size SSeff autocorrelation at a lag of 10 AC 10 and the potential scale reduction factor psrf of the Gelman Rubin statistic Gelman and Rubin 1992 for models with multiple chains In this case an insufficient number of samples have been taken for this highly autocorrelated model although it is important to note that the autocorrelation is markedly reduced if the glm module is loaded in JAGS Displaying the effective sample size with the summary information will alert the user to the fact that additional steps should be taken before sensible inference can be made The data can also be specified to run jags using the data argument in which case it should take the format of a named list data frame character string as produced by dump format or a function with no arguments returning one of these Similarly the initial values can be specified using the inits argument as a list with length equal to the number of chains with each element specifying a named list data frame or character string for the initial values for that chain The initial values may also be specified as a function taking ei
13. Monte Carlo error The runjags package attempts to partially safeguard against some of these difficulties by calculating and automatically reporting convergence and sample length diagnostics every time a JAGS model is run and provides a more user friendly way to access commonly used visual convergence diagnostics and summary statistics Implementations of common GLMM are provided using a standard formula style interface in order to encourage new users to explore the potential of MCMC inference without having to generate the full code for the model themselves A further application of the runjags package is in implementing simulation studies so that model formulations and prior specifications can be validated using techniques such as drop k cross validation studies Given that the inference made using JAGS and BUGS can be sensitive to subtly different model specifications and prior distributions a user friendly mechanism to perform these types of analyses is potentially very useful Acknowledgments The author is grateful to the anonymous referees for their very useful comments and sug gestions to Stefano Conti for useful discussions regarding the Pareto family of distributions to Vaetta Editing for proofreading this manuscript and to the authors of The BUGS book Lunn et al 2012 for kind permission to use the Salmonella example References Bates D Maechler M Bolker B Walker S 2014 Ime4 Linear mixed effects models using Eigen
14. S book example chapter 6 5 2 The following example has been modified only to include curly brackets around the Data and Inits specifications 4 runjags JAGS interface utilities and additional distributions Poisson model model for i in 1 6 for j in 1 3 yli j dpois mu i log mu i lt alpha beta log x i 10 gamma x i for i in 1 6 y pred i dpois mu i alpha dnorm 0 0 0001 beta dnorm 0 0 0001 gamma dnorm 0 0 0001 Data list y structure Data c 15 21 29 16 18 21 16 26 33 27 41 60 33 38 41 20 27 42 Dim c 6 3 x c 0 10 33 100 333 1000 Inits list alpha 0 beta 0 gamma 0 Fete ttt eet tee t eet tee tee ttete est R gt results lt run jags filestring monitor c alpha beta gamma Warning message Convergence cannot be assessed with only 1 chain A single chain was used for this model because only one set of initial values was found in the example file resulting in the warning message regarding convergence assessment The results of the simulation can be examined using the default print method as follows Matthew J Denwood R gt results JAGS model summary statistics from 10000 samples adapt burnin 5000 Lower95 Median Upper95 Mean SD Mode alpha 1 8076 2 2279 2 6521 2 2323 0 21633 2 2334 beta 0 18809 0 30563 0 40928 0 30348 0 056648 0 31601 gamma 0 0014336 0 00096171 0 00048151 0 00095585
15. ach observation from the explanatory variables so that any unusual observations can be identified While it is possible to repeatedly use the autorun jags function to analyse multiple datasets the higher level run jags study and drop k functions are provided to automate much of Matthew J Denwood this process Large simulation studies are likely to be computationally intensive but are ideal candidates for parallelisation For this reason parallel computation is built directly into these functions using the parallel package This can be used to parallelise the simulation locally or to run the simulation on any cluster set up using the snow package Tierney Rossini Li and Sevcikova 2013 This allows for the maximisation of the available computing power without requiring the end user to write any additional code and includes an initial check to ensure that the model compiles and runs locally before beginning the parallelised study A drop k study is implemented in runjags using the drop k function as follows The runjags class object on which the drop k analysis will be performed must first be obtained using the run jags function Here we will use the simple linear regression model obtained in Section 2 3 with the result of run jags contained in the variable results The drop k function takes arguments drop indicating the data variables to remove between simulations and k indicating
16. ack from runjags and simulation updates from JAGS to be suppressed for future model runs in this R session Matthew J Denwood R gt testjags You are using R version 3 1 2 2014 10 31 on a unix machine with the X11 GUI The rjags package is installed JAGS version 3 4 0 found successfully using the command usr local bin jags R gt runjags options silent runjags TRUE silent jags TRUE The help file for the runjags options function gives a list of other possible global options and instructions on how to set these in the R profile file for permanent use 2 2 Basic usage The run jags function requires a valid model definition to the model argument and a char acter string of monitored variables to the monitor argument before a model can be run The model can be specified in an external text file or as a character string within R The former is likely to be preferable for more complex model formulations but the latter eliminates the need for multiple text files Data will be necessary for most models and it is highly recom mended to provide over dispersed starting values for multiple chains the default settings give a warning if no initial values are provided There are a number of ways to provide data and initial values depending on the preferences of the user It is possible for the text file containing the model to also contain data and initial value blocks in which case these will be automatic
17. ad even if other parallel simulations did not produce output and read monitor which allows only a chosen subset of the monitored variables to be read from the MCMC output For all methods except rjags and rjparallel any calls to run jags where the keep jags files argument is specified will result in a folder being created in the working directory that can be reimported using results jags Any failed simulations created are also kept using the same mechanism and a message is displayed detailing how the user can attempt to recover these simulations These failed simulation folders are automatically cleaned up when the R session is terminated The failed jags function returns any output captured from JAGS in such cases and is helpful to debug model code 2 9 Simulation studies One of the principle motivations behind the development of the runjags package is to automate the analysis of simulated datasets for the purposes of model validation A common motivation for this type of analysis is a drop k validation study also known as a leave one out cross validation where k 1 This procedure re fits the same model to a single dataset multiple times with one or more of the observed data points removed from each re fit of the model This can either be a randomly selected group of a fixed number k of data points or each individual datapoint in turn The goal is to evaluate the ability of the model to predict e
18. ally imported with the model by run jags and the number of chains inferred from the number of initial value lists found This is also compatible with standard WinBUGS or OpenBUGS text files although the addition of curly brackets is necessary to demarcate the data and initial value blocks in the same way as for the model block It is also necessary to convert any BUGS arrays from row major order to column major order which is done automatically if the variables are specified inside a list as is the case for BUGS but not for R To over ride this setting within a specific data or initial value block the user can include BUGSdata to ensure all arrays are converted from row to column major order Rdata to ensure none of the arrays are converted and modeldata to pass the data block directly to JAGS for data transformation see section 7 0 4 of the JAGS user manual As a basic example we can use the BUGS Salmonella example from chapter 6 5 2 of the BUGS book with thanks to Lunn Jackson Best Thomas and Spiegelhalter 2012 for permission to reproduce their model Simulation specific options can be provided to the run jags function which may include the required burn in period sampling length and thinning interval A basic model run with a fixed burn in period default 4 000 iterations after 1 000 adaptive iterations and sampling period default 10 000 iterations can be obtained as follows R gt filestring lt The BUG
19. any of these less experienced users may not be aware of the potential issues with MCMC analysis hence the prominent warning that MCMC sampling can be dangerous in the WinBUGS user manual Lunn et al 2000 Some of this potential risk for inexperienced users can be reduced using a wrapper for the model fitting software that analyses the model output for common problems such as failure to converge parameter auto correlation and effective sample size which may otherwise be overlooked by the end user Bayesian statistical methods such as those used by BUGS and JAGS also require prior belief to be incorporated into the model There are a number of different recommendations for an appropriate choice of prior distribution under various different circumstances for example the half Cauchy distribution has been recommended as a reasonable choice for standard deviation parameters within hierarchical models Gelman 2006 Polson and Scott 2011 and DuMouchel 1994 gives an argument for the use of rT mr as a prior for a variance parameter T in meta analysis models However these are not available as built in distributions in BUGS or JAGS This paper describes the runjags package for R R Core Team 2014 which can be used to automate MCMC fitting and summarisation procedures for JAGS models The functions are designed to be user friendly particularly for those less experienced with MCMC analysis and provide a number of features to make the reco
20. ations In this situation the extra Poisson coefficient of variation cv is a useful measure of the variability of the underlying gamma distribution and is a simple function of the shape parameter cv Vi A candidate JAGS Model A using inline data and monitor statements to be detected by runjags is as follows R gt ModelA lt model for i in 1 N Count i dpois lambda i lambda i dgamma shape rate shape dmouch 1 mean dmouch 1 rate lt shape mean data N modules runjags tettetetetetetett monitor mean shape This model allows each observed Count to follow a Poisson distribution with lambda drawn from a gamma distribution with shape parameter to be estimated and rate parameter calcu 17 18 runjags JAGS interface utilities and additional distributions lated from the shape parameter and the mean of the distribution which is also to be estimated The prior distribution used for the mean and shape parameters is the DuMouchel prior distri bution as shown in Table 2 7 this distribution is provided by the runjags extension module which can be loaded using the modules tag Here we use the same minimally informative prior distribution for both shape and mean parameters The data statement is used to include N as data that does not change between simulations The Count variable is also observed but will vary between simulations so is not retrieved from R memory using data An alt
21. calculate the cu parameter in JAGS this can be calculated more efficiently in R using a mutate function R gt getcv lt function x f return list cv sqrt 1 x shape The model performance assessment can be automated using run jags study by creating a function to return a pre generated simulated dataset for each simulation Matthew J Denwood 19 R gt N lt 20 R gt S lt 1000 R gt truemean lt 2 R gt truecv lt 1 1 R gt trueshape lt 1 truecv 2 R gt truerate lt trueshape truemean R gt set seed 1 R gt alldata lt lapply 1 S function x return rpois N rgamma N trueshape rate truerate R gt datafunction lt function i return list Count alldata i In this case we specify the initial values as a function illustrating the potential to make use of the stochastically generated data while creating the initial values within the function R gt initsfunction lt function chain stopifnot data N 20 stopifnot chain ink c 1 2 shape lt c 0 1 10 chain mean lt c 10 0 1 chain RNG seed lt c 1 2 chain RNG name lt c base Super Duper base Wichmann Hil1 chain return list shape shape mean mean RNG seed RNG seed RNG name RNG name t tttet tttet Finally a parallel cluster with 10 nodes is set up on the local machine before the two simu lation studies are run on this cluster usi
22. ce of priors between this gamma prior and the DuMouchel prior can Matthew J Denwood Parameter Priors mean shape Mean CI Range Within CI AC10 Simulations mean dmouch dmouch 2 070 2 332 0 927 0 016 1000 mean dmouch dgamma 2 072 2 342 0 916 0 021 1000 mean dgamma dmouch 2 149 2 523 0 932 0 035 1000 mean dgamma dgamma 2 158 2 562 0 926 0 042 1000 cu dmouch dmouch 1 089 1 168 0 932 0 039 1000 cv dmouch dgamma 1 067 1 271 0 880 0 092 1000 cu dgamma dmouch 1 093 1 173 0 929 0 041 1000 cu dgamma dgamma 1 073 1 279 0 883 0 090 1000 Table 3 Average values for the inference on the mean parameter true value 2 and cv parameter true value 1 1 obtained from a negative binomial MCMC model formulation using DuMouchel and gamma priors for the mean and shape parameters be evaluated using the run jags study function with a total of four candidate sets of priors using each combination of DuMouchel and gamma distributions for the mean and shape parameters These were applied to the same 1 000 simulated datasets using Model B and very similar R code to that given above The results of these four simulation studies are shown in Table 3 There were small but noticeable differences between the inference made for both parameters using these prior distributions The bias and autocorrelation were both approximately doubled for the mean parameter between DuMouchel and gamma priors and more substantial changes in bias and autocorrelation
23. e 6 6 seconds 12 6 seconds Average adapt burnin required 5000 range 5000 5000 Average samples required 10486 range 10000 11571 In the latter case inference was made on each datapoint in several different datasets so the results present the mean values of each summary statistic obtained from the multiple simulations The drop k function is a wrapper for the run jags study function which can be used to perform various different types of simulation study This function takes the following argu ments the number of datasets to analyse the model to use a function to produce data that will be provided to each simulation and a named list of target variables with true values representing parameters to be monitored and used to summarise the output of the simulation Inline monitor statements can be used as with run jags and any target variables are also automatically monitored Any variables specified using the inline data statement will be retrieved from the working environment as usual and will be common to all simulations data which is intended to change between simulations must therefore be provided using the data function argument instead Initial variables can be specified using inits in the model file but it is also necessary to pass a character string of all variable names required to the export cluster argument to ensure these variables are visible on the cluster nodes It may be Matt
24. ernative formulation of this same model could be provided using a negative binomial distribution rather than a gamma mixture of Poisson distributions as represented in Model B R gt ModelB lt model for i in 1 N Count i dnegbin prob shape shape dmouch 1 mean dmouch 1 prob lt shape shape mean data N modules runjags monitor mean shape ttt tetettetetet Ww In this model the same priors are placed on the parameters shape and mean but the neg ative binomial distribution is parameterised by a probability p in place of the parameter mean However the gamma Poisson and negative binomial distributions are equivalent see Appendix A and these models share the same prior distributions for the two parameters of interest The two might therefore be expected to give equivalent inference The posterior coverage and autocorrelation of these models can be assessed using simulation studies with data generated from a distribution with a mean of 2 cv of 1 1 and sample size of 20 These values are chosen to exaggerate any model performance issues by providing a comparatively small dataset with a large number of zero observations and are similar to those typically found in veterinary parasitological datasets Denwood 2010 The two parameters of interest are the mean parameter which is directly monitored in the model and the cv parameter which is a function of the monitored shape parameter Rather than
25. hew J Denwood preferable to specify initial values as a function to which the data will be made available by run jags at run time this may be required in cases where the choice of appropriate initial values depends on the values in the data An illustration of the run jags study function is provided in Section 3 3 Illustration of usage with a simulation study Here we will consider a worked example of a simulation study analysis using runjags in order to assess the performance of two equivalent model formulations with two different minimally informative priors The application is an over dispersed count model the use of which is widespread in many biological fields Bolker Brooks Clark Geange Poulsen Stevens and White 2009 including parasitology Wilson Grenfell and Shaw 1996 Wilson and Grenfell 1997 Shaw Grenfell and Dobson 1998 where Bayesian methods of analysis have been shown to provide more robust inference than traditional methods Denwood Stear Matthews Reid Toft and Innocent 2008 Denwood Reid Love Nielsen Matthews McKendrick and Innocent 2010 3 1 Model formulation and assessment The gamma distribution is parameterised in JAGS and BUGS by the shape a and rate 8 parameters with the expectation given by 3 and variance given by BE This distribution can be used to describe underlying variability in a Poisson observation representing an unknown amount of over dispersion between observ
26. llow a vars argument giving a subset of monitored nodes using partial matching as well as a mutate argument This should specify a function or a list with first element a function and remaining elements arguments to this function and can be used to add new variables to the posterior chains that are derived from the directly monitored variables in JAGS This allows the variables to be summarised or extracted as part of the MCMC objects as if they had been calculated in JAGS but without the computational or storage overheads associated with calculating them directly in JAGS One possible appli cation for this is for pair wise comparisons of different levels within fixed effects using the supplied contrasts mcmc function The print method displays relevant overview information including summary statistics for monitored variables calculated and stored by the run jags function The summary method returns a summary table for the monitored variables which is taken from the stored values created by run jags if available otherwise it will be recalculated during the function call Alternatively summary statistics can be recalculated and stored in the runjags object using the add summary function There are a series of options available to these summary func tions including vars and mutate as outlined above confidence which specifies a numeric vector of confidence intervals to calculate and custom
27. mmended convergence and sample size checks more obvious to the end user The runjags package also provides additional distri butions to extend the core functionality of JAGS including the half Cauchy and DuMouchel distributions as well as functions implementing different types of simulation studies to as sess the performance of JAGS models Section 3 gives a worked example of usage to assess the sensitivity of an over dispersed count observation model to various minimally informative prior distributions Some prior familiarity with the BUGS programming language and the underlying MCMC algorithms is assumed All code shown below is also included in an R file accompanying the manuscript 2 Package functions 2 1 Preparation The core functionality of the runjags package allows a model specified by the user to be run in JAGS using the run jags function The help file for this function gives an overview of the core functionality of the runjags package and provides links to other relevant functions All functions require installation of JAGS which is open source software available from http mcmc jags sourceforge net Before running a model for the first time it is advisable to check the installation of JAGS and set any desired global settings such as installation locations and warning message prefer ences using the runjags options function For example the following will first test the JAGS installation and then set function feedb
28. n Av Lower95 CI Av Upper95 CI Av Range95 CI mean 2 1 9634 2 0695 0 99998 3 3317 2 3317 cv 1 1 1 0624 1 0892 0 52329 1 6909 1 1676 Prop Within95 CI Av AutoCorr Lagi0 Simulations mean 0 927 0 016397 1000 cv 0 932 0 039312 1000 Average time taken 2 9 seconds range 1 4 seconds 5 7 seconds Average adaptt tburnin required 5220 range 5000 16000 Average samples required 10000 range 10000 10000 The inference made from the two models was generally similar except that the autocorrela tion for both parameters was reduced for Model B meaning that on average fewer samples were required for this model As would be expected the 95 confidence intervals for both parameters identified the true value approximately 95 of the time 3 2 Sensitivity to prior distributions The ability to incorporate prior information is an advantage of Bayesian methods but there is often a variety of potential distributions that could be equally justifiable in a given situation The choice between these possibilities is known to affect the shape of the posterior in some situations Lele and Dennis 2009 particularly when the information in the data is relatively sparse In particular there are various different minimally informative priors advocated for use with variance parameters in hierarchical models including the Gamma 0 001 0 001 dis tribution which is characterised by a mean of one and a very large variance The sensitivity of a model to the choi
29. n BP van der Linde A 2002 Bayesian Measures of Model Complexity and Fit Journal of the Royal Statistical Society Series B Statistical Method ology 64 4 583 639 ISSN 13697412 URL http www jstor org stable 3088806 Tierney L Rossini AJ Li N Sevcikova H 2013 snow Simple Network of Workstations URL http cran r project org package snow Matthew J Denwood Toft N Innocent GT Gettinby G Reid SWJ 2007 Assessing the Convergence of Markov Chain Monte Carlo Methods an Example from Evaluation of Diagnostic Tests in Absence of a Gold Standard Preventive Veterinary Medicine 79 2 4 244 256 ISSN 0167 5877 URL http dx doi org 10 1016 j prevetmed 2007 01 003 Van Hauwermeiren M Vose D 2009 A Compendium of Distributions Vose Software Ghent Belgium URL http www vosesoftware com content ebook pdf Wabersich D Vandekerckhove J 2014 Extending JAGS a tutorial on adding custom distributions to JAGS with a diffusion model example Behavior research methods 46 1 15 28 ISSN 1554 3528 doi 10 3758 s13428 013 0369 3 URL http www ncbi nlm nih gov pubmed 23959766 Wilson K Grenfell BT 1997 Generalized Linear Modelling for Parasitologists Par asitology Today 13 1 33 38 ISSN 0169 4758 URL http dx doi org 10 1016 50169 4758 96 40009 6 Wilson K Grenfell BT Shaw DJ 1996 Analysis of Aggregated Parasite Distributions a Comparison of Methods Functional Ecology
30. ng command R gt load runjagsmodule module runjags loaded This makes the module available to any JAGS model including those run using the rjags package The available distributions extend the Pareto Type I distribution provided within JAGS to Pareto Types II III and IV as well as providing the generalised Pareto distribution the Lomax distribution a special case of the Pareto Type II distribution with u 0 and two distributions advocated for use as minimally informative priors for variance parameters the DuMouchel distribution DuMouchel 1994 and the half Cauchy distribution Gelman 2006 The usage probability density function PDF and lower bound for the support of each of the distributions provided by the module is shown in Table 2 7 and an example of how to use the distributions in this module is given in Section 3 One limitation of the module provided within runjags is that it is only made available for the rjags and rjparallel methods when loaded within R However a standalone JAGS module containing the same functions for use with any JAGS installation independently of R is available from http runjags sourceforge net This module is named paretoprior to avoid naming conflicts with the internal runjags module and should install on a variety of platforms using the standard configure make make install convention Binary installers are also provided for some platforms 2 8 Me
31. ng the same data The run jags study function will check each of the models locally using a single randomly chosen dataset to ensure that the model is valid before it is passed to the cluster R gt library parallel R gt cl lt makeCluster 10 R gt resultsA lt run jags study S ModelA datafunction targets list mean truemean cv truecv cl cl inits initsfunction n chains 2 mutate getcv R gt resultsB lt run jags study S ModelB datafunction targets list mean truemean cv truecv cl cl inits initsfunction n chains 2 mutate getcv Each function call returns an object of class runjagsstudy with a default print method that summarises the results as for drop k 20 runjags JAGS interface utilities and additional distributions R gt resultsA Average values obtained from a JAGS study with a total of 1000 simulations Target Av Median Av Mean Av Lower95 CI Av Upper95 CI Av Range95 CI mean 2 1 9682 2 0758 0 99781 3 3554 2 3576 cv 1 1 1 0626 1 0908 0 52571 1 6986 1 1729 Prop Within95 CI Av AutoCorr Lag10 Simulations mean 0 928 0 04491 1000 cv 0 928 0 1904 1000 Average time taken 3 seconds range 2 1 seconds 8 6 seconds Average adaptt tburnin required 5484 range 5000 49000 Average samples required 10038 range 10000 15638 R gt resultsB Average values obtained from a JAGS study with a total of 1000 simulations Target Av Median Av Mea
32. ntroduction Over the last decade the increased availability of computing power has led to a substan tial increase in the availability and use of Markov chain Monte Carlo MCMC methods for Bayesian estimation Gilks Richardson and Spiegelhalter 1998 However such methods have potential drawbacks if used inappropriately including difficulties identifying convergence Toft Innocent Gettinby and Reid 2007 Brooks and Roberts 1998 and the potential for au tocorrelation to decrease the effective sample size of the numerical integration process Kass Carlin Gelman and Neal 1998 Although writing MCMC sampling algorithms such as the Metropolis Hastings algorithm Hastings 1970 is relatively straightforward many users em ploy software such as the Bayesian analysis Using Gibbs Sampling BUGS software variants WinBUGS and OpenBUGS Lunn Thomas Best and Spiegelhalter 2000 Just Another Gibbs Sampler JAGS Plummer 2003 is a cross platform alternative with a direct interface to R using rjags Plummer 2013 which can be easily extended with user specified modules supporting additional distributions and random number generators Wabersich and Vandek 2 runjags JAGS interface utilities and additional distributions erckhove 2014 Each of these uses the BUGS syntax to allow the user to define arbitrary models more easily which is attractive and attainable for researchers who are more familiar with traditional modelling techniques However m
33. ons JAGS called using a shell with output monitored and displayed within R interruptible JAGS called using the rjags package by and progress bar as for the rjags package rjags 1 2 JAGS called as a background process with the R prompt returned to the user background simple t JAGS called directly using a shell parallel 3 Multiple JAGS instances called using n sims the number of paral separate shells to allow chain paralleli lel simulations sation bgparallel 3 Multiple JAGS instances called using n sims the number of paral rjparallel 3 4 snow 1 separate background processes to allow chain parallelisation Multiple rjags models run within R us ing a parallel cluster Multiple JAGS instances called using separate shells set up using a parallel cluster lel simulations cl a pre created cluster to be used and n sims the num ber of parallel simulations cl and n sims as above and remote jags the JAGS path on the cluster nodes Availability of JAGS modules 1 Installed in JAGS Loadable in the R session Installed in JAGS except DIC 4 Loadable in R code run on the cluster nodes except DIC These methods are not compatible with autorun jags amp autoextend jags 14 runjags JAGS interface utilities and additional distributions The two background methods do not return a completed simulation but instead create a folder in the working environment where the simulation
34. rectly by DuMouchel 1994 the distribution is equivalent to a Lomax distribution with T x so o and a 1 and therefore to a Pareto type II distribution with T z so 0 a 1 and p 0 Table 2 7 The choice of o dictates the median a value of 1 is advocated since this also ensures invariance to the inverse transformation of T so this prior is 21 22 runjags JAGS interface utilities and additional distributions equivalent in terms of variance and precision The half Cauchy distribution has a similar form to the DuMouchel distribution and has also been suggested for use as a prior for variance parameters Gelman 2006 Polson and Scott 2011 Although it is also possible to extend other variants of BUGS JAGS is fully open source and written in C making extension modules such as the one provided by runjags much easier to implement A very useful tutorial on writing and installing a standalone JAGS module is provided by Wabersich and Vandekerckhove 2014 but it is arguably more straightforward to implement a shared JAGS library inside an R package The configure script provided inside the runjags package sets up the necessary environmental variables for compilation on any platform and can be used as a template for creating additional extension modules within R packages 4 Summary There are several advantages to using MCMC but also some potential disadvantages asso ciated with failure to identify poor convergence and high
35. rresponding simulation where this datapoint was removed which in this case indicates that the first five data points were predicted reasonably well For drop k cross validation 15 16 runjags JAGS interface utilities and additional distributions with k greater than 1 the indicated number of data points will be randomly removed from each simulation and the average values for the corresponding summary statistics from each data point will be shown In this case an argument for simulations must also be provided Additional arguments to autorun jags can also be provided to the drop k function For example the following syntax will run 100 simulations with a random selection of 2 of the 5 first five data points removed from each R gt assessment lt drop k results drop Y 1 5 k 2 simulations 100 method simple psrf target 1 1 R gt assessment Average values obtained from a drop k study with a total of 100 simulations Target Av Median Av Mean Av Lower95 CI Av Upper95 CI Av Range95 CI Y 1 11 374 12 163 12 16 10 319 13 975 3 6557 Y 2 14 184 14 138 14 134 12 29 15 971 3 6818 Y 3 15 164 16 161 16 157 14 323 17 969 3 6464 Y 4 19 595 18 089 18 088 16 27 19 903 3 6329 Y 5 20 33 20 134 20 129 18 315 21 965 3 6507 Prop Within95 CI Av AutoCorr Lag10 Simulations Y 1 1 0 0040714 42 Y 2 1 0 0037887 37 Y 3 1 0 0039891 48 Y 4 1 0 00040502 34 Y 5 1 0 0019401 39 Average time taken 11 seconds rang
36. runjags An R Package Providing Interface Utilities Model Templates Parallel Computing Methods and Additional Distributions For MCMC Models in JAGS Matthew J Denwood University of Copenhagen Abstract The runjags package provides a set of interface functions to facilitate running Markov chain Monte Carlo models in JAGS from within R Automated calculation of appropri ate convergence and sample length diagnostics user friendly access to commonly used graphical outputs and summary statistics and parallelised methods of running JAGS are provided Template model specifications can be generated using a standard lme4 style for mula interface to assist users less familiar with the BUGS syntax Automated simulation study functions are implemented to facilitate model performance assessment as well as drop k type cross validation studies using high performance computing clusters such as those provided by parallel A module extension for JAGS is also included within runjags providing the Pareto family of distributions and a series of minimally informative priors including the DuMouchel and half Cauchy priors This vignette is taken from the publi cation for the runjags package Denwood In Review It outlines the primary functions of this package and gives an illustration of a simulation study to assess the performance of equivalent model specifications Keywords MCMC Bayesian graphical models interface utilities JAGS BUGS R 1 I
37. s encouraged to examine the model file and make whatever changes are necessary before running the model using run jags For example a basic linear model from the help file for Im can be compared to the output of JAGS as follows R gt counts lt c 18 17 15 20 10 20 25 13 12 R gt outcome lt g1 3 1 9 R gt treatment lt g1 3 3 R gt d AD lt data frame treatment outcome counts R gt glm D93 lt glm counts family poisson R gt template jags counts data d AD family poisson outcome treatment outcome treatment 10 runjags JAGS interface utilities and additional distributions ECDF of total ll 1 0 25 L 0 8 20 L 0 6 H 1 5 L 0 4 1 0 L 0 2 0 5 L T T T T on z ee E coef 1 990 2 000 2 010 i 5000 10000 15000 20000 1 990 2 000 2 010 1 985 1 995 2 005 Iteration coef coef l 7 l 1 0 5 Ei o eS 0 8 w 4 7 O a1 A 06 t 8 34 2 Q 0 4 L 5 24 L a 0 2 L soi L oO 0 0 0 T T T T T T T T 5000 10000 15000 20000 10 15 20 10 15 20 Iteration precision precision li Chain 1 J coef 4 n L Chain 2 7 precisn 4 Combined 4 i coef precisn Figure 1 A series of plots displayed by the plot method for the runjags class showing only parameters partially matched using the letter c with plots shown in a 3x3 layout Multiple chains are shown using different
38. samples chains 2 adaptt tburnin 5000 Lower95 Median Upper95 Mean SD Mode MCerr MCZofSD coef 1 9935 1 9995 2 006 1 9996 0 0031642 1 9997 0 000076913 2 4 int 9 7534 10 13 10 48 10 131 0 18577 10 13 0 0045395 2 4 precision 0 89024 1 2131 1 5533 1 2213 0 17145 1 1985 0 0012334 0 7 SSeff AC 10 psrf coef 1692 0 18952 1 0003 int 1675 0 19662 1 0002 precision 19323 0 0053642 1 Total time taken 4 5 seconds R gt plot results vars c layout c 3 3 The standard plot method presents the commonly required information in an easily readable format including model fit statistics where available but the same information can be re turned in the form of a numeric matrix using the summary method To extract additional information from the runjags object not covered by these summary statistics see the extract method 2 6 GLMM templates There are many available frameworks for fitting standard generalised linear mixed models GLMM in R but new users to MCMC may find that running relatively simple models in JAGS and comparing the results to those obtained through other software allows them to better understand the flexibility and syntax of BUGS models To this end the runjags package provides a template jags function which generates model specification files based on a formula syntax similar to that employed by the well known Ime4 package Bates Maechler Bolker and Walker 2014 After generating the template model the user i
39. t N lt 100 R gt X lt seq 1 N by 1 R gt Y lt rnorm N 2 X 10 1 The following code specifies functions that return initial values including RNG seeds for each chain The use of switch within these functions allows different initial values to be chosen for chains one and two ensuring that initial values are over dispersed R gt coef lt function chain return switch chain 1 10 2 10 R gt int lt function chain return switch chain 1 10 2 10 Matthew J Denwood R gt precision lt function chain return switch chain 1 0 01 2 100 R gt RNG seed lt function chain return switch chain 1 1 2 2 R gt RNG name lt function chain return switch chain 1 base Super Duper 2 base Wichmann Hill It is then possible to run the simulation specifying only the model and the number of chains to use the monitored variables data and initial values are specified in the model file and will be retrieved form our R working environment R gt results lt run jags model n chains 2 2 4 Extending models The autorun jags function can be used in the same way as run jags but the burn in period and sample length are calculated automatically rather than being directly controlled by the user The autorun jags function will continually extend a simulation until convergence as assessed by the Gelman Rubin statistic
40. ther no arguments as for the data or one argument specifying the chain number in which case an additional n chains argument will be required by run jags to determine the number of chains required 2 3 Alternative usage To facilitate a more streamlined function call within R an alternative method of specifying data and initial values is provided The model formulation may contain special inline com ments including data which indicates that the comma separated variable names to the right of the statement are to be included in the simulation as data and inits which indi cates variables for which initial values are to be provided Any variables specified by data and inits will be automatically retrieved from a named list data frame or environment passed to the data and inits argument or function returning one of these or from the global environment Any variable names specified in this way may also match a function returning an appropriate vector and in the case of initial values this function may accept a single argu ment indicating the chain for which the initial values are to be used Note that any variables specified by data or inits will be ignored if a character string is provided to the data or inits arguments which may be useful for temporarily over riding the values specified in the 6 runjags JAGS interface utilities and additional distributions model file See the dump format function for a way
41. thod options There are a number of different methods for calling JAGS from within R using runjags which can be controlled using the method argument or by changing the global option using the 11 12 Table 1 Distributions provided by the JAGS module included with runjags runjags JAGS interface utilities and additional distributions The name JAGS code with parameterisation PDF and lower bound of the distributions is shown All distributions have an upper bound of oo unless otherwise stated Name Usage in JAGS Density Lower Pareto I dpar1 alpha sigma agt get o a gt 0 o gt 0 afo xr pu kort Pareto II dpar2 alpha sigma mu z H a gt 0 o gt 0 iy 1 2 A 258 Pareto III dpar3 sigma mu gamma o T H a gt 0 y gt 0 yo ei i fa ee Pareto IV dpar4 alpha sigma mu gamma o F g E 1 u a gt 0 o gt 0 y gt 0 yo a zy a 1 Lomax dlomax alpha sigma 1 0 a gt 0 0 gt 0 4 1 Gen Par dgenpar sigma mu xi 1 1 622 ue a gt 0 ve q For 0 Lewe o DuMouchel dmouch sigma 2 o 0 a gt 0 20 Half Cauchy dhalfcauchy sigma n x2 02 0 a gt 0 This is equivalent to the dpar alpha c distribution and provided for naming consistency 2 This is referred to as the 2 kind Pareto distribution by Van Hauwermeiren and Vose 2009 an alternative form for the PDF of this distribution is given by 2 gt x o 3 The Generalised Pare
42. tics run by autoextend jags determine that the simulation has converged and already has an adequate sample size so no additional sam ples are taken For more details on these functions including detailed descriptions of the other arguments and additional examples consult the help pages for run jags and autorun jags Once a valid runjags class object has been obtained the full representation of the model data and current status of the random number generators can be saved to a file using the 8 runjags JAGS interface utilities and additional distributions write jagsfile function This allows a model to be run from the last sampled values using the run jags function at a later date and it may also be instructive to use this function to examine the format of a syntactically valid and complete model file that can be read directly using the run jags function It is also possible to specify sample 0 to the original run jags function call and then subsequently use write jagsfile to produce a model file with the initial values specified 2 5 Visualisation methods The output of these functions is an object of class runjags This class is associated with a number of 3 methods as well as utility functions for combining multiple runjags ob jects combine jags and for conversion to amp from objects produced by the rjags package as runjags amp as jags Many of these a
43. to distribution has an upper bound of x lt u Z for lt 0 Matthew J Denwood runjags options function The main difference between these is that some allow multiple chains to be run in parallel using separate JAGS models with automatic pseudo random number generation handled by runjags where necessary The interruptible rjags parallel or bgparallel methods are recommended for most situations but all possible methods and their advantages amp disadvantages are summarised in Table 2 Note that a pre existing cluster created using the parallel package can be used by specifying a cl argument and a maximum number of parallel simulations for these methods can optionally be specified using a n sims argument to the main function call the default will use a separate simulation per chain but it is possible to specify fewer simulations than chains The model fit statistics are not available with parallel methods because multiple chains within the same model are required for calculation of DIC and PED but these can be obtained using the extract method which will extend the simulation using a single simulation The adaptation phase is always explicitly controlled to allow MCMC simulations with the same pseudo random number seed to be reproducible regardless of the method used to call JAGS Table 2 Methods provided by the runjags package to run simulations in JAGS Method Name Description Method Opti
44. und distribution with mean 3 ip and shape parameter a r Affiliation Matthew J Denwood Department of Large Animal Sciences Section for Animal Welfare and Disease Control Faculty of Health and Medical Sciences University of Copenhagen Denmark E mail md sund ku dk URL http iph ku dk english employees pure en persons 487288
45. were seen between priors for the cv parameter In addition the 95 confidence intervals for the cv parameter have less than 90 coverage when using the gamma prior despite a slightly larger average range of these confidence intervals relative to the DuMouchel prior 3 3 Discussion The results presented here demonstrate the utility of simulation studies facilitated by the runjags package to evaluate the relative performance of alternative model formulations and the effect of prior distribution choices In this case the DuMouchel prior out performed the more standard gamma prior and it also possesses properties that are theoretically desirable for a minimally informative distribution such as invariance to inverse transformation infinite variance and a mode of 0 DuMouchel 1994 proposed this prior for use with variance parameters in hierarchical models but it has also been used in situations outside the meta analysis application for which it was originally devised for example Phillips Tam Conti Rodrigues Brown Iturriza Gomara Gray and Lopman 2010 Conti Presanis van Veen Xiridou Donoghoe Rinder Stengaard and De Angelis 2011 Yin Conti Desai Stafford Slater Gill and Simms 2013 Christiansen and Morris 1997 also used the same distribution as a prior for a hierarchical regression model and Daniels 1999 uses a uniform shrinkage prior which is equivalent to the DuMouchel distribution Although this connection is not stated di
Download Pdf Manuals
Related Search
Related Contents
Philips TX2BTBK Pavestone Rumblestone RSK52769 Instructions / Assembly 2 - Sony GBC SureBind System 2 Student Guide - Inside Scripps Mise en page 1 - Ville de Meyzieu Acme Made LED T8 S009 18W 80h G13 WEB-MCAP USER MANUAL - KIT Solutions Support Site Philips 530 Cell Phone User Manual Copyright © All rights reserved.
Failed to retrieve file