Mcmc
Functions for constucting generic Metropolis-Hastings MCMC algorithms, and associated utilities. Can be used in conjunction with an unbiased estimate of marginal model likelihood for constructing pseudo-marginal MCMC algorithms, such as PMMH pMCMC.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Mcmc.type
Members list
Value members
Concrete methods
Autocorrelation function
Autocorrelation function
Value parameters
- lm
-
Maximum lag required
- x
-
Input data
Attributes
- Returns
-
A vector of autocorrelations
Function to construct a generic Metropolis-Hastings MCMC algorithm for Bayesian inference. Note that this algorithm avoids re-computation of the log-likelihood associated with the current state, and is therefore suitable for use with the log of an unbiased estimate of likelihood for the constuction of pseudo-marginal "exact approximate" MCMC algorithms.
Function to construct a generic Metropolis-Hastings MCMC algorithm for Bayesian inference. Note that this algorithm avoids re-computation of the log-likelihood associated with the current state, and is therefore suitable for use with the log of an unbiased estimate of likelihood for the constuction of pseudo-marginal "exact approximate" MCMC algorithms.
Value parameters
- dprior
-
A function to evaluate the log of the prior density
- dprop
-
A function to evaluate the log-likelihood of the proposal transition kernel
- init
-
The initial state of the MCMC algorithm
- logLik
-
The log-likelihood of the model
- rprop
-
A function to sample from a proposal distribution
- verb
-
Should the function print diagnostic information to the console at each iteration?
Attributes
- Returns
-
An infinite
Stream
corresponding to the MCMC chain. Note that this can be processed with typical Scala combinators such asdrop
(for burn-in) andtake
(for run-length). IfTypes
are imported, there is also athin
method (which can be used for thinning the chain).
Function for executing one step of a MH algorithm. Called by mhStream
.
Function for executing one step of a MH algorithm. Called by mhStream
.
Attributes
Generate some basic diagnostics associated with an MCMC run. Called purely for the side-effect of generating output on the console.
Generate some basic diagnostics associated with an MCMC run. Called purely for the side-effect of generating output on the console.
Value parameters
- lm
-
Max lag for ACF plot
- m
-
A matrix, such as generated by
toDMD
containing MCMC output - plt
-
Generate plots?
Attributes
Wrapper around the other summary
function which takes a Stream
Wrapper around the other summary
function which takes a Stream
Value parameters
- plot
-
Generate plots?
- s
-
A finite stream of MCMC iterations.
Attributes
Utility function to convert a finite Stream
(or other collection) to a Breeze DenseMatrix[Double]
.
Utility function to convert a finite Stream
(or other collection) to a Breeze DenseMatrix[Double]
.
Value parameters
- s
-
Input stream/collection, which must be finite.
Attributes
- Returns
-
A matrix with rows corresponding to iterations and columns corresponding to variables.