Simulates a random Wishart-distributed matrix
Usage
rwish(S0, nu = dim(S0)[1] + 2)Examples
## 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
#> [,1] [,2] [,3]
#> [1,] 25.922913 -3.573378 -25.60499
#> [2,] -3.573378 43.624466 40.71695
#> [3,] -25.604995 40.716950 90.19836
S0*5
#> [,1] [,2] [,3]
#> [1,] 26.208841 -3.788052 -26.16013
#> [2,] -3.788052 43.362621 40.32510
#> [3,] -26.160129 40.325104 89.46212