Description Usage Arguments Examples
Trace plot of the log-likelihood (the x-axis is MCMC
iteration, and the y-axis is the log-likelihood). The MCMC
algorithm has converged when this plot levels out and the
log-likelihood time series plot looks like white noise. If
the log-likelihood is still increasing at the last
iteration, you should go back and run the algorithm longer
(using fitLDA
.)
1 | plotLoglik(data = matrix(), zoom = FALSE, prop = 0.5, start = 0)
|
data |
a matrix with log-likelihood values. Each column of the matrix refers to a different MCMC chain. |
zoom |
should a second plot of the latter iterations be output. |
prop |
If |
start |
number of iterations (if any) performed before these chains. |
1 2 3 4 5 6 7 | one.chain <- matrix(rnorm(1000, mean=-500, sd=100), ncol=1) #hopefully our logliklihood is essentially random noise!
plotLoglik(one.chain)
par(mfrow=c(1,2))
plotLoglik(one.chain, zoom=TRUE)
three.chains <- matrix(rnorm(3000, mean=-500, sd=100), ncol=3)
plotLoglik(three.chains)
plotLoglik(three.chains, zoom=TRUE, prop=.1, start=5000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.