Packages

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Mcmc
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. 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

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. def mhStream[P](init: P, logLik: (P) => LogLik, rprop: (P) => P, dprop: (P, P) => LogLik, dprior: (P) => LogLik, verb: Boolean = false): LazyList[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 as drop (for burn-in) and take (for run-length). If Types are imported, there is also a thin method (which can be used for thinning the chain).

  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. 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.

  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  17. def summary[P](s: Seq[P], plot: Boolean)(implicit arg0: CsvRow[P]): Unit

    Wrapper around the other summary function which takes a Stream

    Wrapper around the other summary function which takes a Stream

    s

    A *finite* stream of MCMC iterations.

    plot

    Generate plots?

  18. 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

  19. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  20. def toDMD[P](s: Seq[P])(implicit arg0: CsvRow[P]): DenseMatrix[Double]

    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].

    s

    Input stream/collection, which must be *finite*.

    returns

    A matrix with rows corresponding to iterations and columns corresponding to variables.

  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped