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
## Downloading GitHub repo benbarnard/rWishart@master
## from URL https://api.github.com/repos/benbarnard/rWishart/zipball/master
## Installing rWishart
## '/home/travis/R-bin/lib/R/bin/R' --no-site-file --no-environ --no-save  \
##   --no-restore --quiet CMD INSTALL  \
##   '/tmp/RtmplGfSTB/devtools3e3a6ce18f34/BenBarnard-rWishart-bc1e450'  \
##   --library='/home/travis/R/Library' --install-tests
## 

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]
##  [1,]  0.55066687 -0.50910029  0.55721240 -0.8589895  0.52049792
##  [2,] -0.50910029  0.48737021 -0.57417422  0.7475932 -0.34318369
##  [3,]  0.55721240 -0.57417422  0.77245160 -0.7046462  0.03883371
##  [4,] -0.85898948  0.74759322 -0.70464621  1.4697423 -1.19673980
##  [5,]  0.52049792 -0.34318369  0.03883371 -1.1967398  1.63282851
##  [6,]  0.59329691 -0.60399074  0.79643805 -0.7708159  0.10223582
##  [7,]  1.17223494 -0.99043415  0.85634302 -2.0887409  1.87931476
##  [8,] -0.09575496  0.01607409  0.15919267  0.3513663 -0.68936921
##  [9,]  0.56782039 -0.47739454  0.40645258 -1.0183562  0.92985616
## [10,]  0.79377908 -0.64346513  0.48370747 -1.4902453  1.49746229
##             [,6]       [,7]        [,8]       [,9]      [,10]
##  [1,]  0.5932969  1.1722349 -0.09575496  0.5678204  0.7937791
##  [2,] -0.6039907 -0.9904342  0.01607409 -0.4773945 -0.6434651
##  [3,]  0.7964380  0.8563430  0.15919267  0.4064526  0.4837075
##  [4,] -0.7708159 -2.0887409  0.35136632 -1.0183562 -1.4902453
##  [5,]  0.1022358  1.8793148 -0.68936921  0.9298562  1.4974623
##  [6,]  0.8235413  0.9529635  0.13754050  0.4537563  0.5549086
##  [7,]  0.9529635  3.0168621 -0.60871555  1.4745472  2.1949079
##  [8,]  0.1375405 -0.6087155  0.33100819 -0.3051096 -0.5302393
##  [9,]  0.4537563  1.4745472 -0.30510961  0.7209888  1.0759866
## [10,]  0.5549086  2.1949079 -0.53023933  1.0759866  1.6335649