rust

Ratio-of-Uniforms Simulation with Transformation.

https://github.com/paulnorthrop/rust

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.5%) to scientific vocabulary

Keywords

1977 bayesian-inference cran kinderman monahan of posterior-samples r ratio ratio-of-uniforms ratio-of-uniforms-method rcpp simulation transformation uniforms
Last synced: 6 months ago · JSON representation

Repository

Ratio-of-Uniforms Simulation with Transformation.

Basic Info
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 19
Topics
1977 bayesian-inference cran kinderman monahan of posterior-samples r ratio ratio-of-uniforms ratio-of-uniforms-method rcpp simulation transformation uniforms
Created over 9 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
```

# rust 

[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/paulnorthrop/rust?branch=master&svg=true)](https://ci.appveyor.com/project/paulnorthrop/rust)
[![R-CMD-check](https://github.com/paulnorthrop/rust/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/paulnorthrop/rust/actions/workflows/R-CMD-check.yaml)
[![Coverage Status](https://codecov.io/github/paulnorthrop/rust/coverage.svg?branch=master)](https://app.codecov.io/github/paulnorthrop/rust?branch=master)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/rust)](https://cran.r-project.org/package=rust)
[![Downloads (monthly)](https://cranlogs.r-pkg.org/badges/rust?color=brightgreen)](https://cran.r-project.org/package=rust)
[![Downloads (total)](https://cranlogs.r-pkg.org/badges/grand-total/rust?color=brightgreen)](https://cran.r-project.org/package=rust)

## Ratio-of-uniforms simulation with transformation

### What does rust do?

The `rust` package implements the multivariate generalized ratio-of-uniforms method of simulating random variates from a d-dimensional continuous distribution.  The user specifies (the log of) a positive target function `f` that is proportional to the density function of the distribution.  

### A simple example

We use the function `ru` to simulate a sample of size 1000 from a two-dimensional standard normal distribution with strong positive correlation between the components.  Of course, this particular example is purely illustrative: there are better ways to simulate from a multivariate normal distribution.

```{r, eval = FALSE}
rho <- 0.9
covmat <- matrix(c(1, rho, rho, 1), 2, 2)
log_dmvnorm <- function(x, mean = rep(0, d), sigma = diag(d)) {
  x <- matrix(x, ncol = length(x))
  d <- ncol(x)
  - 0.5 * (x - mean) %*% solve(sigma) %*% t(x - mean)
}
x <- ru(logf = log_dmvnorm, sigma = covmat, d = 2, n = 1000, init = c(0, 0))
```

From version 1.2.0 onwards the faster function `ru_rcpp` can be used.  See the vignette "Rusting Faster: Simulation using Rcpp" for details.

```{r, eval = FALSE}
# Create an external pointer to a C++ function to evaluate the log-density.
ptr_bvn <- create_xptr("logdnorm2")
# Pass the external pointer to `ru_rcpp`.
x <- ru_rcpp(logf = ptr_bvn, rho = rho, d = 2, n = 1000, init = c(0, 0))
```

### Installation

To get the current released version from CRAN:

```{r installation, eval = FALSE}
install.packages("rust")
```

### Vignettes

See `vignette("rust-a-vignette", package = "rust")` for an overview of the package,
`vignette("rust-b-when-to-use-vignette", package = "rust")` for guidance on when `rust` can be used and `vignette("rust-c-using-rcpp-vignette", package = "rust")` for information on how to take advantage of the Rcpp package.

Owner

  • Name: Paul Northrop
  • Login: paulnorthrop
  • Kind: user

GitHub Events

Total
Last Year

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 535
  • Total Committers: 1
  • Avg Commits per committer: 535.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 20
  • Committers: 1
  • Avg Commits per committer: 20.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Paul Northrop p****p@u****k 535
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 2
  • Total pull requests: 2
  • Average time to close issues: about 17 hours
  • Average time to close pull requests: 2 months
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 3.0
  • Average comments per pull request: 1.5
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • lbelzile (1)
  • paulnorthrop (1)
Pull Request Authors
  • katrinleinweber (1)
  • lbelzile (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 722 last-month
  • Total docker downloads: 43,390
  • Total dependent packages: 4
  • Total dependent repositories: 7
  • Total versions: 21
  • Total maintainers: 1
cran.r-project.org: rust

Ratio-of-Uniforms Simulation with Transformation

  • Versions: 21
  • Dependent Packages: 4
  • Dependent Repositories: 7
  • Downloads: 722 Last month
  • Docker Downloads: 43,390
Rankings
Docker downloads count: 0.6%
Dependent packages count: 9.3%
Dependent repos count: 11.1%
Average: 15.4%
Downloads: 15.7%
Forks count: 21.0%
Stargazers count: 34.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • R >= 3.3.0 depends
  • Rcpp >= 0.12.10 imports
  • graphics * imports
  • stats * imports
  • bang * suggests
  • knitr * suggests
  • microbenchmark * suggests
  • revdbayes * suggests
  • rmarkdown * suggests
  • testthat * suggests