Description Usage Arguments Details Author(s) See Also Examples
An object of class aMTM contains the resulting chain X
as well as the selected proposal at each iteration and the resulting
proposal densities. This function produces various plots to inspect the output of an aMTM object.
1 2 |
aMTMobject |
An object of class |
vars |
A vector of indices of the variables to plot. A maximum of 10 variables is accepted and the default
is all variables of |
type |
Whether to plot points ( |
color |
Whether to plot the points/lines colored with the corresponding proposal density.
In the case of points, the color represent the density used to get to the point; in the case of lines,
the color represent the density used for the jump. Default is |
pairs |
Whether to plot the variables by pairs or not. Default is |
prop.density |
Whether to add the resulting densities to the plots or not. Default is |
... |
Additionnal graphical parameters. |
When pairs=TRUE
, the 2-D marginal plots of X
for each pair of variables in vars
are plotted. On the diagonal, the
1-D marginal densities are plotted. When pairs=FALSE
, the trace plot and the 1-D marginal plot are produced for each varaibles in
vars
.
Simon Fontaine, simfont@umich.edu
aMTM.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
library(aMTM)
# Banana log-density with parameter B and a
p <- function(x, p) apply(x,1,function(x) -x[1]^2/(2*p$a^2) - 1/2*(x[2]+p$B*x[1]^2-p$B*p$a^2)^2)
# setup
set.seed(1)
N<-1e5;K<-3
B<-0.04;a<-8
# aMTM sampling with ASWAM update
mcmc <- aMTM(target=p, N=N, K=K, x0=c(0,0), parms=list(a=a,B=B), burnin=0.1)
#plot the pairs showing color
plot.aMTM(mcmc, color=T)
#plot the pairs showing jumps and color
plot.aMTM(mcmc, type='l', color=T)
#plot the marginals with colors
plot.aMTM(mcmc, pairs=F, color=T)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.