BFUpdatePosterior: Updates posteriors for testing nested models that differ by...

View source: R/BFUpdatePosterior.R

BFUpdatePosteriorR Documentation

Updates posteriors for testing nested models that differ by more than one variable or simply extracts all posteriors for one particular parameter

Description

Updates posteriors from output by ShrinkSeq or ShrinkGauss. Useful for testing nested models or for simply extracting posteriors for a particular parameter after applying FitAllShrink.

Usage

BFUpdatePosterior(fitall, updateoutput,fitall0=NULL, modus="fixed", shrinkpara=NULL, shrinklc=NULL, ncpus=1,only0=FALSE)

Arguments

fitall

A 2-component list object resulting from FitAllShrink or from CombinePosteriors.

fitall0

An optional 2-component list object resulting from FitAllShrink containing the fits under the null-model.

updateoutput

A list object resulting from ShrinkSeq or ShrinkGauss.

modus

Character string. Either "fixed", "random" or "logdisp". Type of variable for which the posterior is desired.

shrinkpara

Character or character vector. Name(s) of the variable(s) for which the posterior is desired. Corresponding variable can be a factor.

shrinklc

Character string. Name of the linear combination for which the posterior is desired.

ncpus

Integer. The number of cpus to use for parallel computations.

only0

Boolean. If TRUE, the function only computes the posterior probability of the null-model.

Details

This function is mostly useful for testing nested models that differ by more than one variable.

Value

A list object with the same number of components as the first component of fitall (number of fits), each containing 3-component lists which contain

postbetanon0

Continuous component of the posterior (as matrix)

postbeta0

Point mass (often zero) mixture proportion. Zero if fitall0=NULL

loglik

Marginal log-likelihood

Author(s)

Mark A. van de Wiel


markvdwiel/ShrinkBayes documentation built on March 27, 2022, 7:47 p.m.