Learn R Programming

BMS (version 0.3.4)

post.var: Posterior Variance and Deviance

Description

Returns posterior residual variance, deviance, or pseudo R-squared, according to the chosen prior structure

Usage

post.var(object, exact = FALSE) post.pr2(object, exact = FALSE) "deviance"(object, exact = FALSE, ...) "deviance"(object, ...)

Arguments

object
A bma object (as produced by bms) or a zlm object.
exact
When exact=FALSE, then deviance will be based on MCMC frequencies, if exact=TRUE then it will be based on analytical posterior model probabilities - cf. argument exact in coef.bma.
...
further arguments passed to or from other methods

Details

post.var: Posterior residual variance as according to the prior definitions contained in object post.pr2: A pseudo-R-squared corresponding to unity minus posterior variance over dependent variance. deviance.bma: returns the deviance of a bma model as returned from bms. deviance.zlm: returns the deviance of a zlm model.

See Also

bms for creating bma objects and priors, zlm object.

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

Examples

Run this code
 data(datafls)
  
 mm=bms(datafls[,1:10])
 deviance(mm)/nrow(datafls) # is equivalent to
 post.var(mm)
 
 post.pr2(mm) # is equivalent to
 1 - post.var(mm) / ( var(datafls[,1])*(1-1/nrow(datafls)) )
 

Run the code above in your browser using DataLab