Skip to content

Commit

Permalink
Modify the packaage to emphasize "Polya Gamma" and add URLs to papers…
Browse files Browse the repository at this point in the history
… in the DESCRIPTION file.
  • Loading branch information
coatless committed Jul 21, 2023
1 parent bdcedcd commit c0472b7
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 37 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
^docs$
^pkgdown$
^cran-comments\.md$
^CRAN-SUBMISSION$
Binary file modified .aspell/pg.rds
Binary file not shown.
5 changes: 3 additions & 2 deletions .aspell/words.pws
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
personal_ws-1.1 en 5 UTF-8
personal_ws-1.1 en 6 UTF-8
Balamuta
PG
Polya-Gamma
Polya
Gamma
performant
Polson
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: pg
Title: Pólya-Gamma Distribution Sampler
Title: Polya Gamma Distribution Sampler
Version: 0.2.4
Authors@R:
c(
Expand All @@ -10,9 +10,11 @@ Authors@R:
email = "balamut2@illinois.edu"
)
)
Description: Provides access to a high performant random distribution
sampler for the Pólya-Gamma Distribution using either 'C++' headers for
'Rcpp' or 'RcppArmadillo' and 'R'.
Description: Provides access to a series of highly performant random distribution
samplers for the Polya Gamma Distribution as described by
Polson, Scott, and Windle (2013) <arXiv:1205.0310> using either 'C++' headers
for 'Rcpp' or 'RcppArmadillo' and 'R'. The 'C++' header approach was developed
to enable computations in Balamuta (2021) <https://www.ideals.illinois.edu/items/121209>.
URL: https://tmsalab.github.io/pg/, https://github.com/tmsalab/pg
BugReports: https://github.com/tmsalab/pg/issues
License: GPL (>= 3)
Expand Down
4 changes: 2 additions & 2 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Sample from the Pólya-Gamma distribution PG(h, z)
#' Sample from the Polya Gamma distribution PG(h, z)
#'
#' Chooses the most efficient implemented method to sample from a Pólya-Gamma
#' Chooses the most efficient implemented method to sample from a Polya Gamma
#' distribution. Details on algorithm selection presented below.
#'
#' @param n The number of samples to taken from a PG(h, z). Used only by
Expand Down
6 changes: 3 additions & 3 deletions R/pg_theoretical.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' Theoretical Polya-Gamma Distribution's Mean and Variance
#' Theoretical Polya Gamma Distribution's Mean and Variance
#'
#' Compute the theoretical mean and variance for a Polya-Gamma variable.
#' Compute the theoretical mean and variance for a Polya Gamma variable.
#'
#' @param h A single `integer` value corresponding to the "shape" parameter.
#' @param z A single `numeric` value corresponding to the "scale" parameter.
#'
#' @return
#' Either the theoretical mean or theoretical variance for a Polya-Gamma
#' Either the theoretical mean or theoretical variance for a Polya Gamma
#' distribution.
#'
#' @export
Expand Down
14 changes: 7 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ knitr::opts_chunk$set(
[![Package-License](http://img.shields.io/badge/license-GPL%20(%3E=3)-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-3.0.html)
<!-- badges: end -->

The goal of pg is to provide both _R_ and _C++_ header access to the Pólya-Gamma
The goal of pg is to provide both _R_ and _C++_ header access to the Polya Gamma
distribution sampling routine.

## Installation
Expand All @@ -35,7 +35,7 @@ devtools::install_github("tmsalab/pg")

## Usage

Let `X` be a Pólya-Gamma Distribution denoted by `PG(h, z)`, where `h` is the
Let `X` be a Polya Gamma Distribution denoted by `PG(h, z)`, where `h` is the
"shape" parameter and `z` is the "scale" parameter. Presently, the following
sampling cases are enabled:

Expand Down Expand Up @@ -118,16 +118,16 @@ pg::rpg_vector(n, h, z)

## See also

The following are useful resources regarding the Pólya-Gamma distribution.
The following are useful resources regarding the Polya Gamma distribution.

- Papers
- "Bayesian Inference for Logistic Models Using Pólya–Gamma Latent Variables"
by Nicholas G. Polson, James G. Scott, and Jesse Windle (2013)
[doi:10.1080/01621459.2013.829001](https://doi.org/10.1080/01621459.2013.829001). Paper that invented the Pólya-Gamma
- "Sampling Pólya-Gamma random variates: alternate and approximate techniques"
[doi:10.1080/01621459.2013.829001](https://doi.org/10.1080/01621459.2013.829001). Paper that invented the Polya Gamma
- "Sampling Polya Gamma random variates: alternate and approximate techniques"
by Jesse Windle, Nicholas G. Polson, and James G. Scott (2014)
<https://arxiv.org/abs/1405.0506>. Provides an efficiency overview of the
different sampling approaches to sampling from a Pólya-Gamma distribution.
different sampling approaches to sampling from a Polya Gamma distribution.
- R Implementations:
- [`BayesLogit`](https://cran.r-project.org/package=BayesLogit) _R_ package by
Nicholas G. Polson, James G. Scott, and Jesse Windle. Provides the
Expand All @@ -142,7 +142,7 @@ The following are useful resources regarding the Pólya-Gamma distribution.
- Support in other languages:
- `Python` has the [`pypolyagamma`](https://github.com/slinderman/pypolyagamma)
package by Scott Linderman.
- `Stan` [lacks an implementation](https://discourse.mc-stan.org/t/sampling-from-a-polya-gamma-distribution/8067) for the Pólya-Gamma distribution since it relies on joint proposals
- `Stan` [lacks an implementation](https://discourse.mc-stan.org/t/sampling-from-a-polya-gamma-distribution/8067) for the Polya Gamma distribution since it relies on joint proposals
rather than full conditionals.

## Author
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- badges: end -->

The goal of pg is to provide both *R* and *C++* header access to the
Pólya-Gamma distribution sampling routine.
Polya Gamma distribution sampling routine.

## Installation

Expand All @@ -24,7 +24,7 @@ devtools::install_github("tmsalab/pg")

## Usage

Let `X` be a Pólya-Gamma Distribution denoted by `PG(h, z)`, where `h`
Let `X` be a Polya Gamma Distribution denoted by `PG(h, z)`, where `h`
is the “shape” parameter and `z` is the “scale” parameter. Presently,
the following sampling cases are enabled:

Expand Down Expand Up @@ -111,20 +111,20 @@ pg::rpg_vector(n, h, z)

## See also

The following are useful resources regarding the Pólya-Gamma
The following are useful resources regarding the Polya Gamma
distribution.

- Papers
- “Bayesian Inference for Logistic Models Using Pólya–Gamma Latent
Variables” by Nicholas G. Polson, James G. Scott, and Jesse
Windle (2013)
[doi:10.1080/01621459.2013.829001](https://doi.org/10.1080/01621459.2013.829001).
Paper that invented the Pólya-Gamma
- “Sampling Pólya-Gamma random variates: alternate and approximate
Paper that invented the Polya Gamma
- “Sampling Polya Gamma random variates: alternate and approximate
techniques” by Jesse Windle, Nicholas G. Polson, and James G.
Scott (2014) <https://arxiv.org/abs/1405.0506>. Provides an
efficiency overview of the different sampling approaches to sampling
from a Pólya-Gamma distribution.
from a Polya Gamma distribution.
- R Implementations:
- [`BayesLogit`](https://cran.r-project.org/package=BayesLogit) *R*
package by Nicholas G. Polson, James G. Scott, and Jesse Windle.
Expand All @@ -143,7 +143,7 @@ distribution.
by Scott Linderman.
- `Stan` [lacks an
implementation](https://discourse.mc-stan.org/t/sampling-from-a-polya-gamma-distribution/8067)
for the Pólya-Gamma distribution since it relies on joint proposals
for the Polya Gamma distribution since it relies on joint proposals
rather than full conditionals.

## Author
Expand Down
5 changes: 3 additions & 2 deletions data-raw/custom-dictionary.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ author = c(
)
other = c(
"PG",
"Polya-Gamma",
"Polya",
"performant"
"Gamma",
"performant",
"Polson"
)

custom_words = c(author, other)
Expand Down
3 changes: 2 additions & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Balamuta
PG
Polya-Gamma
Polya
Gamma
performant
Polson
4 changes: 2 additions & 2 deletions man/pg-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/rpg-sampler.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/theoretical-pg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/rpg.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "pg.h"

//' Sample from the Pólya-Gamma distribution PG(h, z)
//' Sample from the Polya Gamma distribution PG(h, z)
//'
//' Chooses the most efficient implemented method to sample from a Pólya-Gamma
//' Chooses the most efficient implemented method to sample from a Polya Gamma
//' distribution. Details on algorithm selection presented below.
//'
//' @param n The number of samples to taken from a PG(h, z). Used only by
Expand Down

0 comments on commit c0472b7

Please sign in to comment.