Overview

rWishart is a wishart distribution suite. In creating other packages we found it useful to separate out our wishart generation functions and maintain them somewhere else. This package works well with slidR, EqualCov and covEst.

In developing covEst we found it useful to have it play nice with the “tidyverse.” At this point we have not thought of all the uses and combinations with these packages so if you think of something not currently implemented please file a minimal reproducible example on github.

Installation

You can install the latest development version from github with

if (packageVersion("devtools") < 1.6) {
  install.packages("devtools")
}
devtools::install_github("benbarnard/rWishart")
## Using GitHub PAT from envvar GITHUB_PAT
## Skipping install of 'rWishart' from a github remote, the SHA1 (8fb5e3ae) has not changed since last install.
##   Use `force = TRUE` to force installation

If you encounter a clear bug, please file a minimal reproducible example on github.

Example

This is a basic example which shows you how to solve a common problem:

library(rWishart)
## 
## Attaching package: 'rWishart'
## The following object is masked from 'package:stats':
## 
##     rWishart
rWishart(n = 1, df = 2, Sigma = diag(1, 10), covariance = TRUE)
## , , 1
## 
##              [,1]       [,2]       [,3]       [,4]       [,5]        [,6]
##  [1,]  0.12842517  0.1840336  0.2933059  0.3535551  0.2593443  0.07155073
##  [2,]  0.18403362  1.9099732 -0.3537786 -0.1808996 -0.1122526 -0.13371773
##  [3,]  0.29330591 -0.3537786  1.0338560  1.1307641  0.8198402  0.27449983
##  [4,]  0.35355507 -0.1808996  1.1307641  1.2604867  0.9160708  0.29564760
##  [5,]  0.25934435 -0.1122526  0.8198402  0.9160708  0.6659592  0.21393353
##  [6,]  0.07155073 -0.1337177  0.2744998  0.2956476  0.2139335  0.07376749
##  [7,] -0.03491223 -1.7330562  0.7116437  0.6067901  0.4242006  0.22207656
##  [8,] -0.08432233  0.8177998 -0.6339373 -0.6241532 -0.4461810 -0.18168062
##  [9,]  0.32466818 -0.2487581  1.0772337  1.1920133  0.8655146  0.28335129
## [10,]  0.04684867 -1.4020350  0.7978164  0.7425622  0.5264497  0.23693855
##              [,7]        [,8]       [,9]       [,10]
##  [1,] -0.03491223 -0.08432233  0.3246682  0.04684867
##  [2,] -1.73305624  0.81779978 -0.2487581 -1.40203503
##  [3,]  0.71164367 -0.63393734  1.0772337  0.79781636
##  [4,]  0.60679005 -0.62415317  1.1920133  0.74256217
##  [5,]  0.42420064 -0.44618099  0.8655146  0.52644969
##  [6,]  0.22207656 -0.18168062  0.2833513  0.23693855
##  [7,]  1.73011365 -0.93667842  0.6416975  1.48925223
##  [8,] -0.93667842  0.59054022 -0.6202749 -0.86842769
##  [9,]  0.64169753 -0.62027493  1.1304628  0.75564128
## [10,]  1.48925223 -0.86842769  0.7556413  1.32822459