Learn R Programming

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

BayesianTools (version 0.1.0)

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

898

Version

0.1.0

License

CC BY-SA 4.0

Issues

Pull Requests

Stars

Forks

Maintainer

Florian Hartig

Last Published

February 6th, 2017

Functions in BayesianTools (0.1.0)

AM

The Adaptive Metropolis Algorithm
createPrior

Creates a standardized prior class
createSmcSamplerList

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

Convenience function to create a beta prior
createMcmcSamplerList

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

Factory that creates a proposal generator
createPriorDensity

Fits a density function to a multivariate sample
createPosterior

Creates a standardized posterior class
createTruncatedNormalPrior

Convenience function to create a truncated normal prior
createLikelihood

Creates a standardized likelihood class
createMixWithDefaults

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

The Delayed Rejection Algorithm
gelmanDiagnostics

Runs Gelman Diagnotics over an Bayesianutput
DRAM

The Delayed Rejection Adaptive Metropolis Algorithm
createUniformPrior

Convenience function to create a simple uniform prior distribution
DE

Differential-Evolution MCMC
DIC

Deviance information criterion
DEzs

Differential-Evolution MCMC zs
DREAM

DREAM
DREAMzs

DREAMzs
factorMatrice

factorMatrice
getPredictiveIntervals

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

Calculates predictive distribution based on the parameters
generateParallelExecuter

Factory to generate a parallel executer of an existing function
generateCRvalues

Generates matrix of CR values based on pCR
MAP

calculates the Maxiumum APosteriori value (MAP)
marginalLikelihood

Calcluated the marginal likelihood from a set of MCMC samples
getBlockSettings

getblockSettings
getCredibleIntervals

Calculate confidence region from an MCMC or similar sample
getPossibleSamplerTypes

Returns possible sampler types
getPanels

Calculates the panel combination for par(mfrow = )
logSumExp

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

Normal / Gaussian Likelihood function
sumSquare

Helper function for sum of x*x
plotTimeSeriesResiduals

Plots residuals of a time series
plotTimeSeriesResults

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

Run multiple chains
generateTestDensityMultiNormal

Multivariate normal likelihood
getBlock

Determine the parameters in the block update
marginalPlot

Plot MCMC marginals
stopParallel

Function to close cluster in BayesianSetup
Twalksteps

Main function that is executing and evaluating the moves
M

The Metropolis Algorithm
updateGroups

Determine the groups of correlated parameters
setupStartProposal

Help function to find starvalues and proposalGenerator settings
updateProposalGenerator

To update settings of an existing proposal genenerator
TwalkMove

Wrapper for step function
propFun

Helper function to create proposal
runMCMC

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

Helper function to change an object to a coda mcmc class,
smcSampler

SMC sampler
getSample

Extracts the sample from a bayesianOutput
testDensityInfinity

Test function infinity ragged
VSEMcreatePAR

Create a random radiation (PAR) time series
VSEMgetDefaults

returns the default values for the VSEM
getRmvnorm

Produce multivariate normal proposal
testLinearModel

Fake model, returns a ax + b linear response to 2-param vector
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
thinMatrix

Function to thin matrices
testDensityBanana

Banana-shaped density function
vsemC

C version of the VSEM model
VSEMcreateLikelihood

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

Helper function for blow and hop moves
testDensityNormal

Normal likelihood
sampleMetropolis

gets samples while adopting the MCMC proposal generator
Metropolis

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

Funktion to calculate the metropolis ratio
testDensityMultiNormal

3d Mutivariate Normal likelihood
likelihoodAR1

AR1 type likelihood function
scaleMatrix

Function to scale matrices
Twalk

T-walk MCMC
tracePlot

Trace plot for MCMC class
combineChains

Function to combine chains
convertCoda

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

Checks if an object is of class 'BayesianSetup'
applySettingsDefault

Provides the default settings for the different samplers in runMCMC
betaFun

Helper function for calculating beta
AdaptpCR

Adapts pCR values
correlationPlot

Flexible function to create correlation density plots
BayesianTools

BayesianTools
createBayesianSetup

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

Very simple ecosystem model
WAIC

calculates the WAIC