rwish: Simulation from a Wishart distribution

Description Usage Arguments Value Author(s) Examples

Description

Simulates a random Wishart-distributed matrix

Usage

1
rwish(S0, nu = dim(S0)[1] + 1)

Arguments

S0

a positive definite matrix

nu

a positive integer

Value

a positive definite matrix

Author(s)

Peter Hoff

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## The expectation is S0*nu

S0<-rwish(diag(3)) 

SS<-matrix(0,3,3) 
for(s in 1:1000) { SS<-SS+rwish(S0,5) }

SS/s 

S0*5

winnga/amen documentation built on May 17, 2019, 8:46 p.m.