BayesianTools0.1.8 package

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

AdaptpCR

Adapts pCR values

AM

The Adaptive Metropolis Algorithm

applySettingsDefault

Provides the default settings for the different samplers in runMCMC

BayesianTools

BayesianTools

betaFun

Helper function for calculating beta

bridgesample

Calculates the marginal likelihood of a chain via bridge sampling

calibrationTest

Simulation-based calibration tests

checkBayesianSetup

Checks if an object is of class 'BayesianSetup'

combineChains

Function to combine chains

convertCoda

Convert coda::mcmc objects to BayesianTools::mcmcSampler

correctThin

Checks if thin is consistent with nTotalSamples samples and if not cor...

correlationPlot

Flexible function to create correlation density plots

createBayesianSetup

Creates a standardized collection of prior, likelihood and posterior f...

createBetaPrior

Convenience function to create a beta prior

createLikelihood

Creates a standardized likelihood class#'

createMcmcSamplerList

Convenience function to create an object of class mcmcSamplerList from...

createPosterior

Creates a standardized posterior class

createPrior

Creates a standardized prior class

createPriorDensity

Fits a density function to a multivariate sample

createProposalGenerator

Factory that creates a proposal generator

createSmcSamplerList

Convenience function to create an object of class SMCSamplerList from ...

createTruncatedNormalPrior

Convenience function to create a truncated normal prior

createUniformPrior

Convenience function to create a simple uniform prior distribution

DE

Differential-Evolution MCMC

DEzs

Differential-Evolution MCMC zs

DIC

Deviance information criterion

DR

The Delayed Rejection Algorithm

DRAM

The Delayed Rejection Adaptive Metropolis Algorithm

DREAM

DREAM

DREAMzs

DREAMzs

factorMatrice

factorMatrice

gelmanDiagnostics

Gelman Diagnostics

generateCRvalues

Generates matrix of CR values based on pCR

generateParallelExecuter

Factory to generate a parallel executor of an existing function

generateTestDensityMultiNormal

Multivariate normal likelihood

getBlock

Determine the parameters in the block update

getBlockSettings

getblockSettings

getCredibleIntervals

Calculate confidence region from an MCMC or similar sample

getDharmaResiduals

Creates a DHARMa object

getPanels

getPanels

getPossibleSamplerTypes

Returns possible sampler types

getPredictiveDistribution

Calculates predictive distribution based on the parameters

getPredictiveIntervals

Calculates Bayesian credible (confidence) and predictive intervals bas...

getRmvnorm

Produce multivariate normal proposal

getSample

Extracts the sample from a bayesianOutput

getSetup

Function to get the setup from a bayesianOutput

getVolume

Calculate posterior volume

Gfun

Helper function for blow and hop moves

GOF

Standard GOF metrics Startvalues for sampling with nrChains > 1 : if y...

likelihoodAR1

AR1 type likelihood function

likelihoodIidNormal

Normal / Gaussian Likelihood function

logSumExp

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

M

The Metropolis Algorithm

makeObjectClassCodaMCMC

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

MAP

calculates the Maxiumum APosteriori value (MAP)

marginalLikelihood

Calcluated the marginal likelihood from a set of MCMC samples

marginalPlot

Plot MCMC marginals

marginalPlotDensity

Plot marginals as densities

marginalPlotViolin

Plot marginals as violin plot

mcmcMultipleChains

Run multiple chains

mergeChains

Merge Chains

Metropolis

Creates a Metropolis-type MCMC with options for covariance adaptatin, ...

metropolisRatio

Function to calculate the metropolis ratio

package-deprecated

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

plotDiagnostic

Diagnostic Plot

plotSensitivity

Performs a one-factor-at-a-time sensitivity analysis for the posterior...

plotTimeSeries

Plots a time series, with the option to include confidence and predict...

plotTimeSeriesResiduals

Plots residuals of a time series

plotTimeSeriesResults

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

propFun

Helper function to create proposal

rescale

Rescale

runMCMC

Main wrapper function to start MCMCs, particle MCMCs and SMCs

sampleEquallySpaced

Gets n equally spaced samples (rows) from a matrix or vector

sampleMetropolis

gets samples while adopting the MCMC proposal generator

scaleMatrix

Function to scale matrices

setupStartProposal

Help function to find starvalues and proposalGenerator settings

smcSampler

SMC sampler

stopParallel

Function to close cluster in BayesianSetup

sumSquare

Helper function for sum of x*x

testDensityBanana

Banana-shaped density function

testDensityGelmanMeng

GelmanMeng test function

testDensityInfinity

Test function infinity ragged

testDensityMultiNormal

3d Mutivariate Normal likelihood

testDensityNormal

Normal likelihood

testLinearModel

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

thinMatrix

Function to thin matrices

tracePlot

Trace plot for MCMC class

Twalk

T-walk MCMC

TwalkMove

Wrapper for step function

Twalksteps

Main function that is executing and evaluating the moves

updateGroups

Determine the groups of correlated parameters

updateProposalGenerator

To update settings of an existing proposal genenerator

VSEM

Very simple ecosystem model

vsemC

C version of the VSEM model

VSEMcreateLikelihood

Create an example dataset, and from that a likelihood or posterior for...

VSEMcreatePAR

Create a random radiation (PAR) time series

VSEMgetDefaults

returns the default values for the VSEM

WAIC

calculates the WAIC

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.

  • Maintainer: Florian Hartig
  • License: GPL-3
  • Last published: 2023-01-30