AdaptiveDirMRW.Rd 4.02 KB
Newer Older
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}
7
8
\format{
Object of \code{\link{R6Class}} with methods for updating a \link{DirichletNode} instance.
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.
}
29
\section{Methods}{
30

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{<div class="r6-fields">}}
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}
57
58
59
60
61
62
63
}
\if{html}{\out{</div>}}
}
\section{Active bindings}{
\if{html}{\out{<div class="r6-active-bindings">}}
\describe{
\item{\code{cov}}{the current covariance}
64

65
66
67
68
\item{\code{burnin}}{the number of updates to burn in}
}
\if{html}{\out{</div>}}
}
69
\section{Methods}{
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{<hr>}}
\if{html}{\out{<a id="method-new"></a>}}
\if{latex}{\out{\hypertarget{method-new}{}}}
\subsection{Method \code{new()}}{
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{AdaptiveDirMRW$new(
  node,
  toupdate = function() 1:length(node$getData()),
  tune = rep(0.1, length(node$getData())),
  batchsize = 50,
  name = "name"
)}\if{html}{\out{</div>}}
}
91
92

}
93
94
95
96
97
98
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-update"></a>}}
\if{latex}{\out{\hypertarget{method-update}{}}}
\subsection{Method \code{update()}}{
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{AdaptiveDirMRW$update()}\if{html}{\out{</div>}}
99
}
100

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{<hr>}}
\if{html}{\out{<a id="method-acceptance"></a>}}
\if{latex}{\out{\hypertarget{method-acceptance}{}}}
\subsection{Method \code{acceptance()}}{
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{AdaptiveDirMRW$acceptance()}\if{html}{\out{</div>}}
}

}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-clone"></a>}}
\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{<div class="r">}}\preformatted{AdaptiveDirMRW$clone(deep = FALSE)}\if{html}{\out{</div>}}
}

\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{deep}}{Whether to make a deep clone.}
}
\if{html}{\out{</div>}}
}
}
}