Learn R Programming

RTMBdist (version 1.0.1)

wishart: Wishart distribution

Description

Density and random generation for the wishart distribution

Usage

dwishart(x, nu, Sigma, log = FALSE)

rwishart(n, nu, Sigma)

Value

dwishart gives the density, rwishart generates random deviates (matrix for n = 1, array for n > 1)

Arguments

x

positive definite p x p matrix of evaluation points

nu

degrees of freedom, needs to be greater than p - 1

Sigma

scale matrix, needs to be positive definite and match the dimension of x.

log

logical; if TRUE, densities \(p\) are returned as \(\log(p)\).

n

number of random deviates to return

Examples

Run this code
x <- rwishart(1, nu = 5, Sigma = diag(3))
d <- dwishart(x, nu = 5, Sigma = diag(3))

Run the code above in your browser using DataLab