trace_ACF_plot: Trace and/or ACF plots of elements of a variable in 'bmrm'...

Description Usage Arguments Examples

View source: R/trace_ACF_plot.R

Description

Produce trace and Auto-Correlation Function plots (along with Effective sample size) of MCMC samples of elements of A, nonzero elements of P, elements of Sigma.

Usage

1
trace_ACF_plot(x,var="P", ACF=FALSE, nplot=0,irow=1, icol=1, saveFile=FALSE,...)

Arguments

x

an object of class bmrm, the output of the bmrm function

var

name of a variable to which the plots apply. It should be one of "A" (source contribution matrix), "P" (source composition matrix), "Sigma" (error variance).

ACF

TRUE/FALSE if TRUE ACF plots will be provided along with effective sample sizes(dafault: FALSE)

nplot

number of elements of 'var' for trace and/or ACF plots. If 'nplot' is smaller than the total number of elements of 'var' then plots of 'nplot' selected elements will be drawn. Otherwise, trace and/or ACF plots of all elements will be drawn. (default=0 implies that all elements will be selected if var="P" or "Sigma", and the first 12 elements will be selected if var="A")

irow

row index of A/P matrix or index of element of Sigma vector. Plots of 'nplot' elements starting from (irow, icol) element of A/P or elements starting from irow element of Sigma will be drawn (default=1).

icol

column number of A/P matrix. Plots of 'nplot' elements starting from (irow, icol) element of A/P will be drawn (default=1).

saveFile

TRUE/FALSE, save the plots in file 'var'-trace.pdf (default=FALSE)

...

arguments to be passed to methods

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
data(Elpaso); Y=Elpaso$Y ; muP=Elpaso$muP ; q=nrow(muP)
out.Elpaso <- bmrm(Y,q,muP, nAdapt=1000,nBurnIn=5000,nIter=5000,nThin=1)
trace_ACF_plot(out.Elpaso,"Sigma", ACF=T)
trace_ACF_plot(out.Elpaso,"P", ACF=T)
trace_ACF_plot(out.Elpaso,"P", ACF=T,saveFile=T )
trace_ACF_plot(out.Elpaso,"A",ACF=T, nplot=12, irow=2, icol=3)

## End(Not run)

mansukoh/bayesMRM documentation built on March 19, 2021, 3:50 p.m.