Learn R Programming

⚠️There's a newer version (0.1.8) of this package.Take me there.

BayesianTools (version 0.1.1)

General-Purpose MCMC and SMC Samplers and Tools for Bayesian Statistics

Description

General-purpose MCMC and SMC samplers, as well as plot and diagnostic functions for Bayesian statistics, with a particular focus on calibrating complex system models. Implemented samplers include various Metropolis MCMC variants (including adaptive and/or delayed rejection MH), the T-walk, two differential evolution MCMCs, two DREAM MCMCs, and a sequential Monte Carlo (SMC) particle filter.

Copy Link

Version

Install

install.packages('BayesianTools')

Monthly Downloads

791

Version

0.1.1

License

CC BY-SA 4.0

Issues

Pull Requests

Stars

Forks

Maintainer

Florian Hartig

Last Published

April 5th, 2017

Functions in BayesianTools (0.1.1)

DREAMzs

DREAMzs
GOF

Standard GOF metrics
DRAM

The Delayed Rejection Adaptive Metropolis Algorithm
DREAM

DREAM
DE

Differential-Evolution MCMC
DEzs

Differential-Evolution MCMC zs
DIC

Deviance information criterion
DR

The Delayed Rejection Algorithm
Metropolis

Creates a Metropolis-type MCMC with options for covariance adaptatin, delayed rejection, Metropolis-within-Gibbs, and tempering
Twalk

T-walk MCMC
VSEM

Very simple ecosystem model
VSEMcreateLikelihood

Create an example dataset, and from that a likelihood or posterior for the VSEM model
createPosterior

Creates a standardized posterior class
createPrior

Creates a standardized prior class
createUniformPrior

Convenience function to create a simple uniform prior distribution
gelmanDiagnostics

Runs Gelman Diagnotics over an BayesianOutput
likelihoodIidNormal

Normal / Gaussian Likelihood function
createMcmcSamplerList

Convenience function to create an object of class mcmcSamplerList from a list of mcmc samplers
createMixWithDefaults

Allows to mix a given parameter vector with a default parameter vector
createSmcSamplerList

Convenience function to create an object of class SMCSamplerList from a list of mcmc samplers
createTruncatedNormalPrior

Convenience function to create a truncated normal prior
logSumExp

Funktion to compute log(sum(exp(x))
runMCMC

Main wrapper function to start MCMCs, particle MCMCs and SMCs
sampleMetropolis

gets samples while adopting the MCMC proposal generator
testDensityInfinity

Test function infinity ragged
AM

The Adaptive Metropolis Algorithm
BayesianTools

BayesianTools
VSEMcreatePAR

Create a random radiation (PAR) time series
VSEMgetDefaults

returns the default values for the VSEM
M

The Metropolis Algorithm
MAP

calculates the Maxiumum APosteriori value (MAP)
mcmcMultipleChains

Run multiple chains
metropolisRatio

Funktion to calculate the metropolis ratio
createBetaPrior

Convenience function to create a beta prior
createLikelihood

Creates a standardized likelihood class
generateParallelExecuter

Factory to generate a parallel executer of an existing function
generateTestDensityMultiNormal

Multivariate normal likelihood
getPossibleSamplerTypes

Returns possible sampler types
getPredictiveDistribution

Calculates predictive distribution based on the parameters
setupStartProposal

Help function to find starvalues and proposalGenerator settings
smcSampler

SMC sampler
testDensityNormal

Normal likelihood
tracePlot

Trace plot for MCMC class
updateProposalGenerator

To update settings of an existing proposal genenerator
checkBayesianSetup

Checks if an object is of class 'BayesianSetup'
convertCoda

Convert coda::mcmc objects to BayesianTools::mcmcSampler
createPriorDensity

Fits a density function to a multivariate sample
createProposalGenerator

Factory that creates a proposal generator
getPredictiveIntervals

Calculates Bayesian credible (confidence) and predictive intervals based on parameter sample
getSample

Extracts the sample from a bayesianOutput
WAIC

calculates the WAIC
applySettingsDefault

Provides the default settings for the different samplers in runMCMC
correlationPlot

Flexible function to create correlation density plots
createBayesianSetup

Creates a standardized collection of prior, likelihood and posterior functions, including error checks etc.
getVolume

Calculate posterior volume
likelihoodAR1

AR1 type likelihood function
plotSensitivity

Performs a one-factor-at-a-time sensitivity analysis for the posterior of a given bayesianSetup within the prior range.
plotTimeSeries

Plots a time series, with the option to include confidence and prediction band
testLinearModel

Fake model, returns a ax + b linear response to 2-param vector
stopParallel

Function to close cluster in BayesianSetup
testDensityBanana

Banana-shaped density function
testDensityMultiNormal

3d Mutivariate Normal likelihood
getCredibleIntervals

Calculate confidence region from an MCMC or similar sample
getPanels

Calculates the panel combination for par(mfrow = )
marginalLikelihood

Calcluated the marginal likelihood from a set of MCMC samples
marginalPlot

Plot MCMC marginals
plotTimeSeriesResiduals

Plots residuals of a time series
plotTimeSeriesResults

Creates a time series plot typical for an MCMC / SMC fit
vsemC

C version of the VSEM model