Chris Jewell committed Nov 07, 2016 1 2 3 4 5 6 % Generated by roxygen2: do not edit by hand % Please edit documentation in R/mcmc.R \docType{class} \name{AdaptiveDirMRW} \alias{AdaptiveDirMRW} \title{AdaptiveDirMRW}  Chris Jewell committed Apr 24, 2020 7 8 \format{ Object of \code{\link{R6Class}} with methods for updating a \link{DirichletNode} instance.  Chris Jewell committed Nov 07, 2016 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 } \value{ Object of \code{\link{AdaptiveDirMRW}} } \description{ This class implements an Adaptive Multi-site Metropolis random walk algorithm, constrained so the parameter vector sums to 1. } \details{ An adaptive multivariate Gaussian proposal is used for $d-1$ elements of a $d$-dimensional parameter vector contained in \code{node}, with the $d$th element updated to ensure that the vector sums to 1. This makes the updater useful for Dirichlet distributed random variables. For details of the adaptive scheme, see Roberts and Rosenthal (2012) Examples of Adaptive MCMC. \emph{Journal of Computational and Graphical Statistics}. \bold{18}:349--367. Please note that no checks are performed as to the suitability of this algorithm for a particular \link{StochasticNode}. It is up to the user to use the correct update algorithm for the appropriate nodes. }  Chris Jewell committed Apr 24, 2020 29 \section{Methods}{  Chris Jewell committed Nov 07, 2016 30   Chris Jewell committed Apr 24, 2020 31 32 33 34 35 36 37 38 39 40 41 42 43 44 \describe{ \item{\code{new(node, toupdate = function() 1:length(node$getData()), tune = rep(0.1, length(node$getData())), burning = 100)}}{constructor takes an instance of a \link{StochasticNode} node, function to choose the indices of the elements to update (by default all elements), initial tuning vector (diagonal of adaptive tuning matrix), and the number of calls between adaptations.} \item{\code{update()}}{when called, updates \code{node}} \item{\code{acceptance()}}{return the acceptance rate} } } \keyword{DAG} \keyword{MCMC} \keyword{node} \section{Public fields}{ \if{html}{\out{
}}  Chris Jewell committed Nov 07, 2016 45 46 47 48 49 50 51 52 53 54 55 56 \describe{ \item{\code{cov}}{the current covariance} \item{\code{burnin}}{the number of updates to burn in} \item{\code{tune}}{the current tuning matrix} \item{\code{naccept}}{the number of accepted proposals} \item{\code{ncalls}}{the number of times \code{update} has been called} \item{\code{node}}{the node to which the updater is attached}  Chris Jewell committed Apr 24, 2020 57 58 59 60 61 62 63 } \if{html}{\out{
}} \describe{ \item{\code{cov}}{the current covariance}  Chris Jewell committed May 03, 2017 64   Chris Jewell committed Apr 24, 2020 65 66 67 68 \item{\code{burnin}}{the number of updates to burn in} } \if{html}{\out{
}} }  Chris Jewell committed Nov 07, 2016 69 \section{Methods}{  Chris Jewell committed Apr 24, 2020 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 \subsection{Public methods}{ \itemize{ \item \href{#method-new}{\code{AdaptiveDirMRW$new()}} \item \href{#method-update}{\code{AdaptiveDirMRW$update()}} \item \href{#method-acceptance}{\code{AdaptiveDirMRW$acceptance()}} \item \href{#method-clone}{\code{AdaptiveDirMRW$clone()}} } } \if{html}{\out{
}}\preformatted{AdaptiveDirMRW$new( node, toupdate = function() 1:length(node$getData()), tune = rep(0.1, length(node$getData())), batchsize = 50, name = "name" )}\if{html}{\out{ }} }  Chris Jewell committed Nov 07, 2016 91 92  }  Chris Jewell committed Apr 24, 2020 93 94 95 96 97 98 \if{html}{\out{ }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-update}{}}} \subsection{Method \code{update()}}{ \subsection{Usage}{ \if{html}{\out{ }}\preformatted{AdaptiveDirMRW$update()}\if{html}{\out{
}}  Chris Jewell committed Nov 07, 2016 99 }  Chris Jewell committed May 03, 2017 100   Chris Jewell committed Apr 24, 2020 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 } \if{html}{\out{
}}\preformatted{AdaptiveDirMRW$acceptance()}\if{html}{\out{ }} } } \if{html}{\out{ }} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-clone}{}}} \subsection{Method \code{clone()}}{ The objects of this class are cloneable with this method. \subsection{Usage}{ \if{html}{\out{ }}\preformatted{AdaptiveDirMRW$clone(deep = FALSE)}\if{html}{\out{
}} } } }