https://github.com/arviz-devs/simuk

Simulation based calibration and generation of synthetic data.

https://github.com/arviz-devs/simuk

Science Score: 49.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
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    1 of 12 committers (8.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.1%) to scientific vocabulary

Keywords from Contributors

bayesian-inference statistical-analysis hut23 hut23-522 mcmc bayesian-statistics regression-models statistical-modeling
Last synced: 7 months ago · JSON representation

Repository

Simulation based calibration and generation of synthetic data.

Basic Info
Statistics
  • Stars: 55
  • Watchers: 4
  • Forks: 9
  • Open Issues: 6
  • Releases: 4
Created over 7 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

Simuk

Simuk is a Python library for simulation-based calibration (SBC) and the generation of synthetic data. Simulation-Based Calibration is a method for validating Bayesian inference by checking whether the posterior distributions align with the expected theoretical results derived from the prior.

Simuk works with PyMC, Bambi and NumPyro models.

Installation

May be pip installed from github:

bash pip install simuk

Quickstart

  1. Define a PyMC or Bambi model. For example, the centered eight schools model:

    ```python import numpy as np import pymc as pm from arvizplots import plotecdf_pit

    data = np.array([28.0, 8.0, -3.0, 7.0, -1.0, 1.0, 18.0, 12.0]) sigma = np.array([15.0, 10.0, 16.0, 11.0, 9.0, 11.0, 10.0, 18.0])

    with pm.Model() as centeredeight: mu = pm.Normal('mu', mu=0, sigma=5) tau = pm.HalfCauchy('tau', beta=5) theta = pm.Normal('theta', mu=mu, sigma=tau, shape=8) yobs = pm.Normal('y', mu=theta, sigma=sigma, observed=data) ```

  2. Pass the model to the SBC class, and run the simulations. This will take a while, as it is running the model many times. ```python sbc = SBC(centeredeight, numsimulations=100, # ideally this should be higher, like 1000 sample_kwargs={'draws': 25, 'tune': 50})

    sbc.run_simulations() python 79%|███████▉ | 79/100 [05:36<01:29, 4.27s/it] ```

  3. Plot the empirical CDF for the difference between prior and posterior. The lines should be close to uniform and within the oval envelope.

    python plot_ecdf_pit(sbc.simulations, visuals={"xlabel":False}, );

Simulation based calibration plots, ecdf

References

Owner

  • Name: ArviZ
  • Login: arviz-devs
  • Kind: organization

GitHub Events

Total
  • Create event: 13
  • Issues event: 11
  • Release event: 5
  • Watch event: 12
  • Delete event: 14
  • Issue comment event: 35
  • Push event: 33
  • Pull request review event: 19
  • Pull request review comment event: 23
  • Pull request event: 38
  • Fork event: 3
Last Year
  • Create event: 13
  • Issues event: 11
  • Release event: 5
  • Watch event: 12
  • Delete event: 14
  • Issue comment event: 35
  • Push event: 33
  • Pull request review event: 19
  • Pull request review comment event: 23
  • Pull request event: 38
  • Fork event: 3

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 83
  • Total Committers: 12
  • Avg Commits per committer: 6.917
  • Development Distribution Score (DDS): 0.53
Past Year
  • Commits: 73
  • Committers: 9
  • Avg Commits per committer: 8.111
  • Development Distribution Score (DDS): 0.534
Top Committers
Name Email Commits
aloctavodia a****a@g****m 39
rohanbabbar04 r****8@g****m 19
Curro Campuzano c****o@g****m 7
aloctavodia a****a@u****m 5
Advait Gaur b****4@i****n 4
Colin Carroll c****l@g****m 2
Colin C****l@u****m 2
Curro Campuzano 6****m@u****m 1
Juan Orduz j****z@g****m 1
Peter Steinbach p****h@h****e 1
rohanbabbar04 r****8@y****m 1
springcoil p****e@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 12
  • Total pull requests: 39
  • Average time to close issues: 11 days
  • Average time to close pull requests: 2 days
  • Total issue authors: 6
  • Total pull request authors: 7
  • Average comments per issue: 1.42
  • Average comments per pull request: 0.85
  • Merged pull requests: 38
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 12
  • Pull requests: 36
  • Average time to close issues: 11 days
  • Average time to close pull requests: about 20 hours
  • Issue authors: 6
  • Pull request authors: 5
  • Average comments per issue: 1.42
  • Average comments per pull request: 0.75
  • Merged pull requests: 35
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • aloctavodia (5)
  • juanitorduz (2)
  • GwangWooKim (2)
  • rohanbabbar04 (1)
  • TeemuSailynoja (1)
  • SamuelBrand1 (1)
Pull Request Authors
  • aloctavodia (26)
  • rohanbabbar04 (7)
  • Advaitgaur004 (2)
  • psteinb (1)
  • springcoil (1)
  • juanitorduz (1)
  • currocam (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 20 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 3
pypi.org: simuk

Simulation based calibration and generation of synthetic data.

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 20 Last month
Rankings
Dependent packages count: 9.6%
Average: 31.9%
Dependent repos count: 54.2%
Last synced: 7 months ago

Dependencies

setup.py pypi
  • pymc3 *