rwishart {oeli}R Documentation

Draw from Wishart distribution

Description

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

Usage

rwishart(df, scale, inv = FALSE)

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.

Value

A matrix, the random draw.

Examples

df <- 4
scale <- diag(2)
rwishart(df = df, scale = scale)
rwishart(df = df, scale = scale, inv = TRUE)


[Package oeli version 0.4.1 Index]