BMS (version 0.3.4)

plotConv: Plot Convergence of BMA Sampler

Description

Plots the posterior model probabilites based on 1) marginal likelihoods and 2) MCMC frequencies for the best models in a 'bma' object and details the sampler's convergence by their correlation

Usage

plotConv(bmao, include.legend = TRUE, add.grid=TRUE, ...)

Arguments

bmao
an object of class 'bma' - see bms
include.legend
whether to include a legend in the plot
add.grid
whether to include a grid in the plot
...
other parameters for matplot

Details

A call to bms with a MCMC sampler (e.g. bms(datafls,mcmc="bd",nmodel=100) uses a Metropolis-Hastings algorithm to sample through the model space: the frequency of how often models are drawn converges to the distribution of their posterior marginal likelihoods. While sampling, each 'bma' object stores the best models encountered by its sampling chain with their marginal likelihood and their MCMC frequencies. plotConv compares the MCMC frequencies to marginal likelihoods, and thus visualizes how well the sampler has converged.

See Also

pmp.bma for posterior model probabilites based on the two concepts, bms for creating objects of class 'bma'

Check http://bms.zeugner.eu for additional help.

Examples

Run this code

data(datafls)
mm=bms(datafls[,1:12],user.int=FALSE)

plotConv(mm)

#is similar to
matplot(pmp.bma(mm),type="l")

Run the code above in your browser using DataLab