Learn R Programming

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

BayesianTools (version 0.1.3)

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

1,156

Version

0.1.3

License

CC BY-SA 4.0

Issues

Pull Requests

Stars

Forks

Maintainer

Florian Hartig

Last Published

August 2nd, 2017

Functions in BayesianTools (0.1.3)

DE

Differential-Evolution MCMC
DEzs

Differential-Evolution MCMC zs
AM

The Adaptive Metropolis Algorithm
BayesianTools

BayesianTools
DIC

Deviance information criterion
DR

The Delayed Rejection Algorithm
DREAMzs

DREAMzs
GOF

Standard GOF metrics Startvalues for sampling with nrChains > 1 : if you want to provide different start values for the different chains, provide a list
DRAM

The Delayed Rejection Adaptive Metropolis Algorithm
DREAM

DREAM
WAIC

calculates the WAIC
applySettingsDefault

Provides the default settings for the different samplers in runMCMC
createLikelihood

Creates a standardized likelihood class#'
Metropolis

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

T-walk MCMC
createBayesianSetup

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

Convenience function to create a beta prior
createPriorDensity

Fits a density function to a multivariate sample
createProposalGenerator

Factory that creates a proposal generator
logSumExp

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

Calcluated the marginal likelihood from a set of MCMC samples
VSEM

Very simple ecosystem model
VSEMcreateLikelihood

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

Checks if an object is of class 'BayesianSetup'
convertCoda

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

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

Multivariate normal likelihood
getPredictiveDistribution

Calculates predictive distribution based on the parameters
getPredictiveIntervals

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

Convenience function to create a simple uniform prior distribution
gelmanDiagnostics

Runs Gelman Diagnotics over an BayesianOutput
likelihoodAR1

AR1 type likelihood function
likelihoodIidNormal

Normal / Gaussian Likelihood function
generateParallelExecuter

Factory to generate a parallel executer of an existing function
plotTimeSeriesResiduals

Plots residuals of a time series
plotTimeSeriesResults

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

3d Mutivariate Normal likelihood
VSEMcreatePAR

Create a random radiation (PAR) time series
VSEMgetDefaults

returns the default values for the VSEM
createPosterior

Creates a standardized posterior class
metropolisRatio

Function to calculate the metropolis ratio
createMixWithDefaults

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

SMC sampler
stopParallel

Function to close cluster in BayesianSetup
testDensityNormal

Normal likelihood
updateProposalGenerator

To update settings of an existing proposal genenerator
vsemC

C version of the VSEM model
runMCMC

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

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

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

Trace plot for MCMC class
createPrior

Creates a standardized prior class
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
getPanels

Calculates the panel combination for par(mfrow = )
getPossibleSamplerTypes

Returns possible sampler types
marginalPlot

Plot MCMC marginals
mcmcMultipleChains

Run multiple chains
sampleMetropolis

gets samples while adopting the MCMC proposal generator
setupStartProposal

Help function to find starvalues and proposalGenerator settings
M

The Metropolis Algorithm
MAP

calculates the Maxiumum APosteriori value (MAP)
correctThin

Checks if thin is conistent with nTotalSamples samples and if not corrects it.
correlationPlot

Flexible function to create correlation density plots
getCredibleIntervals

Calculate confidence region from an MCMC or similar sample
getDharmaResiduals

Creates a DHARMa object
getSample

Extracts the sample from a bayesianOutput
getVolume

Calculate posterior volume
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
testDensityBanana

Banana-shaped density function
testDensityInfinity

Test function infinity ragged