https://github.com/cran/HLSM
Tip revision: afc6a064bff28609a373b20d7fb0cca9197ea0f1 authored by Aditya Bhat on 30 April 2019, 20:00:34 UTC
version 0.8.1
version 0.8.1
Tip revision: afc6a06
plotDiagnostic.R
##get diagnostic plot of the chain of interest
##chains can be extracted from get' ' funcions and passed to plot.HLSM
plotDiagnostic = function(chain){
par(mfrow = c(2,2))
draws = length(chain)
plot(1:draws,chain,type='l', xlab = 'Iterations', ylab = 'Parameter', main = 'Trace plot')
###Running Means####
rmean = runningmeans(chain, 1)
m=0.5
plot(c(1:draws), rmean, type="l", xlab="", ylab="Mean", main = 'Running means')
##Autcorr plot##
bozo=autocorr(mcmc(chain), lags=seq(1,draws/2,50))
plot(seq(1,draws/2,50), bozo, type="h", ylim=c(-1,1), xlab="", ylab="", main = 'Autocorrelation')
}