object 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.
- Alphabetic
- By Inheritance
- Mcmc
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
acf(x: Seq[Double], lm: Int): DenseVector[Double]
Autocorrelation function
Autocorrelation function
- x
Input data
- lm
Maximum lag required
- returns
A vector of autocorrelations
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
mhStream[P](init: P, logLik: (P) ⇒ LogLik, rprop: (P) ⇒ P, dprop: (P, P) ⇒ LogLik, dprior: (P) ⇒ LogLik, verb: Boolean = false): Stream[P]
Function to construct a generic Metropolis-Hastings MCMC algorithm for Bayesian inference.
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.
- init
The initial state of the MCMC algorithm
- logLik
The log-likelihood of the model
- rprop
A function to sample from a proposal distribution
- dprop
A function to evaluate the log-likelihood of the proposal transition kernel
- dprior
A function to evaluate the log of the prior density
- verb
Should the function print diagnostic information to the console at each iteration?
- 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).
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nextValue[P](logLik: (P) ⇒ LogLik, rprop: (P) ⇒ P, dprop: (P, P) ⇒ LogLik, dprior: (P) ⇒ LogLik, verb: Boolean = false)(current: (P, LogLik)): (P, LogLik)
Function for executing one step of a MH algorithm.
Function for executing one step of a MH algorithm. Called by
mhStream
. -
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
summary[P](s: GenSeq[P], plot: Boolean)(implicit arg0: CsvRow[P]): Unit
Wrapper around the other
summary
function which takes aStream
Wrapper around the other
summary
function which takes aStream
- s
A *finite* stream of MCMC iterations.
- plot
Generate plots?
-
def
summary(m: DenseMatrix[Double], plt: Boolean = true, lm: Int = 50): Unit
Generate some basic diagnostics associated with an MCMC run.
Generate some basic diagnostics associated with an MCMC run. Called purely for the side-effect of generating output on the console.
- m
A matrix, such as generated by
toDMD
containing MCMC output- plt
Generate plots?
- lm
Max lag for ACF plot
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toDMD[P](s: GenSeq[P])(implicit arg0: CsvRow[P]): DenseMatrix[Double]
Utility function to convert a *finite*
Stream
(or other collection) to a BreezeDenseMatrix[Double]
.Utility function to convert a *finite*
Stream
(or other collection) to a BreezeDenseMatrix[Double]
.- s
Input stream/collection, which must be *finite*.
- returns
A matrix with rows corresponding to iterations and columns corresponding to variables.
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )