plotConv: Plot Convergence of BMA Sampler

View source: R/aux_outer.R

plotConvR Documentation

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.

Note

plotConv is also used by plot.bma

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



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

plotConv(mm)

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


BMS documentation built on Aug. 9, 2022, 5:08 p.m.