Learn R Programming

oeli (version 0.5.2)

rwishart_cpp: Draw from Wishart distribution

Description

This function draws from a Wishart or Inverse-Wishart distribution.

Usage

rwishart_cpp(df, scale, inv = FALSE)

Value

A matrix, the random draw.

Arguments

df

An integer, the degrees of freedom. Must be greater or equal p.

scale

A matrix, the scale matrix of dimension p x p. Must be a covariance matrix.

inv

A logical, if TRUE the density of the Inverse-Wishart distribution is returned. By default, inv = FALSE.

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 df * scale, and its variance increases both in df and in the values of scale.

This function performs no input checks. See rwishart for the version with input checks.