DOC PREVIEW
VCU HGEN 619 - Bayesian graphical models using MCMC

This preview shows page 1-2-3-4-5 out of 16 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

adaptcoda.samplescontroldic.samplesdiffdicjags.modeljags.modulejags.objectjags.sampleslinemcarray.objectread.dataupdateIndexPackage ‘rjags’March 22, 2011Version 2.2.0-4Date 2011-03-22Title Bayesian graphical models using MCMCAuthor Martyn PlummerMaintainer Martyn Plummer <[email protected]>Depends R (>= 2.9.0), coda (>= 0.13)SystemRequirements jags (== 2.2.0)Description Interface to the JAGS MCMC libraryLicense GPL (== 2)URL http://mcmc-jags.sourceforge.netRepository CRANDate/Publication 2011-03-22 14:21:13R topics documented:adapt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2coda.samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4dic.samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5diffdic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6jags.model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7jags.module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9jags.object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10jags.samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12mcarray.object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12read.data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Index 1612 adaptadapt Adaptive phase for JAGS modelsDescriptionA jags object represents a Bayesian graphical model described using the BUGS language.Usageadapt(object, n.iter, ...)Argumentsobject a jags model objectn.iter length of the adaptive phase... additional arguments to the update methodDetailsThis function is not normally called by the user.When a JAGS model is compiled, it may require an initial sampling phase during which the samplersadapt their parameters to maximize their efficiency. The sequence of samples generated during thisadaptive phase is not a Markov chain, and therefore may not be used for posterior inference on themodel. For this reason, the adapt function must be called before samples can be generated fromthe model using the update method. Normally, this is done by the jags.model function whenthe model object is created.The adapt function can only be called once on a jags model object since it turns off the adaptivephase. Subsequent calls to adapt do nothing.ValueThis function modifies the original object and returns NULLAuthor(s)Martyn Plummercoda.samples 3coda.samples Generate posterior samples in mcmc.list formatDescriptionThis is a wrapper function for jags.samples which sets a trace monitor for all requested nodes,updates the model, and coerces the output to a single mcmc.list object.Usagecoda.samples(model, variable.names, n.iter, thin = 1, ...)Argumentsmodel a jags model objectvariable.namesa character vector giving the names of variables to be monitoredn.iter number of iterations to monitorthin thinning interval for monitors... optional arguments that are passed to the update method for jags model objectsValueAn mcmc.list object.Author(s)Martyn PlummerSee Alsojags.samplesExamplesdata(LINE)LINE$recompile()LINE.out <- coda.samples(LINE, c("alpha","beta","sigma"), n.iter=1000)summary(LINE.out)4 controlcontrol Advanced control over JAGSDescriptionJAGS modules contain factory objects for samplers, monitors, and random number generators for aJAGS model. These functions allow fine-grained control over which factories are active.Usagelist.factories(type)set.factory(name, type, state)Argumentsname name of the factory to settype type of factory to query or set. Possible values are "sampler", "type", or"status"state a logical. If TRUE then the factory will be active, otherwise the factory willbecome inactive.Valuelist.factories returns a data frame with two columns, the first column shows the namesof the factory objects in the currently loaded modules, and the second column is a logical vectorindicating whether the corresponding factory is active or not.set.factory is called to change the future behaviour of factory objects. If a factory is set toinactive then it will be skipped.NoteWhen a module is loaded, all of its factory objects are active. This is also true if a module isunloaded and then reloaded.Author(s)Martyn PlummerExampleslist.factories("sampler")list.factories("monitor")list.factories("rng")set.factory("base::Slice", "sampler", FALSE)list.factories("sampler")set.factory("base::Slice", "sampler", TRUE)dic.samples 5dic.samples Generate penalized deviance samplesDescriptionFunction to extract random samples of the penalized deviance from a jags model.Usagedic.samples(model, n.iter, thin = 1, type, ...)Argumentsmodel a jags model objectn.iter number of iterations to monitorthin thinning interval for monitorstype type of penalty to use... optional arguments passed to the update method for jags model objectsDetailsThe dic.samples function generates penalized deviance statistics for use in model comparison.The two alternative penalized deviance statistics generated by dic.samples are the devianceinformation criterion (DIC) and the penalized expected deviance. These are chosen by giving thevalues “pD” and “popt” respectively as the type argument.DIC (Spiegelhalter et al 2002) is calculated by adding the “effective number of parameters” (pD)to the expected deviance. The definition of pD used by dic.samples is the one proposed byPlummer (2002) and requires two or more parallel chains in the model.DIC is an approximation to the penalized plug-in deviance, which is used when only a point esti-mate of the parameters is of interest. The DIC approximation only holds asymptotically when theeffective number of parameters is much smaller than the sample size, and the model parametershave a normal posterior distribution.The penalized expected deviance (Plummer 2008) is calculated by adding the optimism (popt) tothe expected deviance. The popt penalty is at least twice the …


View Full Document

VCU HGEN 619 - Bayesian graphical models using MCMC

Documents in this Course
Load more
Download Bayesian graphical models using MCMC
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Bayesian graphical models using MCMC and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Bayesian graphical models using MCMC 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?