rgw

A lightweight R-language implementation of the affine-invariant sampling method of Goodman & Weare (2010)

https://github.com/abmantz/rgw

Science Score: 33.0%

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

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
    2 of 2 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary

Keywords

markov-chain-monte-carlo statistics
Last synced: 10 months ago · JSON representation

Repository

A lightweight R-language implementation of the affine-invariant sampling method of Goodman & Weare (2010)

Basic Info
  • Host: GitHub
  • Owner: abmantz
  • License: mit
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 16.6 KB
Statistics
  • Stars: 2
  • Watchers: 4
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
markov-chain-monte-carlo statistics
Created almost 10 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License

README.md

ascl:1711.006 CRAN MIT License

rgw

This package implements in R the affine-invariant sampling method of Goodman & Weare (2010). This is a way of producing Monte-Carlo samples from a target distribution, which can be used for statistical inference.

This R implementation is based on the very clear description given by Foreman-Mackey et al. (2012), who provide an implementation in python.

Installation

From CRAN

In R, run install.packages("rgw"). Note that the version hosted on CRAN may lag behind this one (see VERSION.md).

Manually (Linux/Unix/Mac)

  1. Clone this repository.
  2. In a terminal, navigate to the <repository base>/R/.
  3. Run R CMD install rgw. Alternatively, in an R session, run install.packages("rgw", repos=NULL).

Use

Here's the simple example that appears in the documentation:

```R

In this example, we'll sample from a simple 2D Gaussian.

Define the log-posterior function

lnP = function(x) sum( dnorm(x, c(0,1), c(pi, exp(0.5)), log=TRUE) )

Initialize an ensemble of 100 walkers. We'll take 100 steps, saving the ensemble after each.

nwalk = 100 post = array(NA, dim=c(2, nwalk, 101)) post[1,,1] = rnorm(nwalk, 0, 0.1) post[2,,1] = rnorm(nwalk, 1, 0.1)

Run

post = GoodmanWeare.rem(post, lnP)

Plot the final ensemble

plot(post[1,,101], post[2,,101])

Look at the trace of each parameter for one of the walkers.

plot(post[1,1,]) plot(post[2,1,])

Go on to get confidence intervals, make niftier plots, etc.

```

Help

Open an issue.

Owner

  • Name: Adam Mantz
  • Login: abmantz
  • Kind: user

GitHub Events

Total
Last Year

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 15
  • Total Committers: 2
  • Avg Commits per committer: 7.5
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
Adam Mantz a****z@s****u 10
Adam Mantz a****z@x****u 5
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 10 days
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • 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
Pull Request Authors
  • abmantz (2)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 206 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: rgw

Goodman-Weare Affine-Invariant Sampling

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 206 Last month
Rankings
Stargazers count: 28.5%
Forks count: 28.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 38.1%
Downloads: 68.0%
Maintainers (1)
Last synced: 11 months ago

Dependencies

rgw/DESCRIPTION cran
  • parallel * imports