{"id":15554895,"url":"https://github.com/gzt/cholwishart","last_synced_at":"2025-10-30T17:46:23.333Z","repository":{"id":56934537,"uuid":"122710951","full_name":"gzt/CholWishart","owner":"gzt","description":"Functions for Wishart distributions, including sampling from the inverse Wishart and sampling from the Cholesky factorization of a Wishart.","archived":false,"fork":false,"pushed_at":"2024-09-30T18:41:08.000Z","size":423,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T20:17:36.687Z","etag":null,"topics":["cholesky-decomposition","cholesky-factorization","cran","digamma-functions","gamma","multivariate","pseudo-wishart","r","wishart","wishart-distributions"],"latest_commit_sha":null,"homepage":"https://gzt.github.io/CholWishart","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gzt.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-24T06:30:25.000Z","updated_at":"2024-11-01T10:18:10.000Z","dependencies_parsed_at":"2024-10-02T15:04:18.973Z","dependency_job_id":"e5d08714-971b-4fa8-955c-04819b9923c0","html_url":"https://github.com/gzt/CholWishart","commit_stats":{"total_commits":223,"total_committers":7,"mean_commits":"31.857142857142858","dds":0.08071748878923768,"last_synced_commit":"c019b9eb4a6e1b847355fb51b7c5e4bb9c7273ce"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gzt%2FCholWishart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gzt%2FCholWishart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gzt%2FCholWishart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gzt%2FCholWishart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gzt","download_url":"https://codeload.github.com/gzt/CholWishart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250506147,"owners_count":21441723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cholesky-decomposition","cholesky-factorization","cran","digamma-functions","gamma","multivariate","pseudo-wishart","r","wishart","wishart-distributions"],"created_at":"2024-10-02T15:04:09.773Z","updated_at":"2025-10-30T17:46:18.309Z","avatar_url":"https://github.com/gzt.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n  \u003c!-- badges: start --\u003e\n  \n  [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/)\n  [![codecov](https://app.codecov.io/gh/gzt/CholWishart/branch/master/graph/badge.svg)](https://app.codecov.io/gh/gzt/CholWishart)\n  [![R build status](https://github.com/gzt/CholWishart/workflows/R-CMD-check/badge.svg)](https://github.com/gzt/CholWishart/actions)\n  [![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)\n  [![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)\n  [![](https://cranlogs.r-pkg.org/badges/CholWishart)](https://cran.r-project.org/package=CholWishart)\n\n---\n \n[![minimal R version](https://img.shields.io/badge/R%3E%3D-3.6.2-6666ff.svg)](https://cran.r-project.org/)\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/CholWishart)](https://cran.r-project.org/package=CholWishart)\n[![packageversion](https://img.shields.io/badge/Package%20version-1.1.4-orange.svg?style=flat-square)](https://github.com/gzt/CholWishart/releases)\n  \u003c!-- badges: end --\u003e\n\n---\n \n[![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-yellowgreen.svg)](https://github.com/gzt/CholWishart/)\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n# CholWishart\n\nThe most common use for this package is likely fast sampling from the \ninverse Wishart or use of the multivariate gamma or digamma functions. This is \na package for fast computation of various functions related to the Wishart distribution, \nsuch as sampling from the Cholesky factorization of the Wishart, \nsampling from the inverse Wishart, \nsampling from the Cholesky factorization of the inverse Wishart,\nsampling from the pseudo Wishart, \ncomputing densities for the Wishart and inverse Wishart, \nand computing a few auxiliary functions such as the multivariate gamma\nand digamma functions. Many of these functions are written in C to maximize \nefficiency. \n\nThe output of the sampling functions is in the same format as the output \nof `stats::rWishart()`.\n\nThe main idea: sampling for multivariate or matrix variate statistics often \nmakes use of distributions related to the Wishart. There are implementations \nin a few packages but they are often in R and much slower than the \nbasic `stats::rWishart()` or there is a lot of associated overhead in the \npackage. Here, then, is a small package with some of those distributions\nand related functions. As the name suggests, the initial purpose was \nsampling from the Cholesky factorization of a Wishart distribution.\n\n# Usage\n\nThe package offers the following distributions:\n\n* The inverse Wishart:\n\n```\nrInvWishart(n = 1,df = 5,Sigma = diag(4)))\n```\n\n* The Cholesky decomposition of the inverse Wishart:\n\n```\nrInvCholWishart(n = 1,df = 5,Sigma = diag(4)))\n```\n\n* The Cholesky decomposition of the Wishart\n\n```\nrCholWishart(n = 1,df = 5,Sigma = diag(4)))\n```\n\n* The pseudo Wishart and its pseudo-inverse, the generalized inverse Wishart (`df` less than \nthe dimension of `Sigma` minus 1):\n\n```\nrPseudoWishart(n = 1,df = 3,Sigma = diag(5)))\nrGenInvWishart(n = 1,df = 3,Sigma = diag(5)))\n```\n\n* The package also offers density functions for the Wishart and inverse Wishart distributions:\n\n```\ndInvWishart(x = diag(4), df = 5, Sigma = diag(4), log = TRUE)\ndWishart(x = diag(4), df = 5, Sigma = diag(4), log = TRUE)\n```\n\nIn addition to this, the package offers the multivariate gamma function and multivariate digamma function, the multivariate counterparts of the gamma and digamma (derivative of the log of the gamma) functions. \n\n```\nmvgamma(x = 5, p = 3)\nmvdigamma(x = 5, p = 3)\n```\n\nI suspect the most useful functions for most people will be the `mvgamma` and `rInvWishart` functions.\n\n\n# Installation \n\nNow available on CRAN, install it at:\n\n```\ninstall.packages('CholWishart')\n```\n\nInstall the latest development version at:\n\n```\n# install.packages('devtools')\ndevtools::install_github(\"gzt/CholWishart\")\n```\n# Calling from other packages\n\nThe header `inst/install/CholWishart.h` is available so that the exported functions \ncan be called in C from other packages. \n\n# Contributing\n\n  Please note that the 'CholWishart' project is released with a [Contributor Code of Conduct](https://gzt.github.io/CholWishart/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgzt%2Fcholwishart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgzt%2Fcholwishart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgzt%2Fcholwishart/lists"}