rwishart: Draw from Wishart distribution

View source: R/RcppExports.R

rwishartR Documentation

Draw from Wishart distribution

Description

This function draws from a Wishart and inverted Wishart distribution.

Usage

rwishart(nu, V)

Arguments

nu

A numeric, the degrees of freedom. Must be at least the number of dimensions.

V

A matrix, the scale matrix.

Details

The Wishart distribution is a generalization to multiple dimensions of the gamma distributions and draws from the space of covariance matrices. Its expectation is nu*V and its variance increases both in nu and in the values of V. The Wishart distribution is the conjugate prior to the precision matrix of a multivariate normal distribution and proper if nu is greater than the number of dimensions.

Value

A list, the draws from the Wishart (W), inverted Wishart (IW), and corresponding Choleski decomposition (C and CI).

Examples

rwishart(nu = 2, V = diag(2))

RprobitB documentation built on May 29, 2024, 7:59 a.m.