conv_ function(model, theta.idx = 0, error.idx = 0) { if (is.null(model$Gibbs.iter)) stop("\nmodel input not from gibbs(...) with opt=1") Gibbs_ model$Gibbs.iter iterations_ c(1:length(model$Gibbs.iter$thit[,1])) ix1_ theta.idx[theta.idx > 0 & theta.idx <= length(Gibbs$thit[1,])] ix2_ error.idx[error.idx > 0 & error.idx <= length(Gibbs$hit[1,])] if ( length(ix1) != 0 || length(ix2) !=0) { par(mfrow=c(3,2)) for (i in 1:(length(ix1) + length(ix2))) { if (i != 1 && (i-1) %% 6 == 0) { cat("continue plotting (y/n) ?\t") ans_ scan(what = character(),n=1) if (ans != "Y" && ans != "y" && ans != "Yes" && ans != "yes") stop() par(mfrow=c(3,2),ask = F) } if (i <= length(ix1)) { plot(iterations,Gibbs$thit[,ix1[i]],xlab="iterations", ylab=paste("theta", ix1[i]),type="l",lty=1) } else { plot(iterations,Gibbs$hit[,ix2[i-length(ix1)]], xlab="iterations", ylab=paste("err.pr", ix2[i-length(ix1)]),type="n") points(iterations,Gibbs$hit[,ix2[i-length(ix1)]], type="l",lty=2) } } } }