Skip to contents

Like posterior_Sigma but converts each posterior covariance draw to a correlation matrix before summarising.

Usage

posterior_cor(fit, x, summary = c("median", "mean", "none"))

Arguments

fit

A fitted "bcaia" object from bcaia.

x

A numeric covariance-covariate vector of length Pcov (matching the columns of Xcov, including the intercept).

summary

One of "median" (default), "mean", or "none". With "none" the full J x J x nsamp array of posterior draws is returned.

Value

A J x J correlation matrix, or a J x J x nsamp array when summary = "none".