https://github.com/corymccartan/conformalbayes
Jackknife(+) Predictive Intervals for Bayesian Models
Science Score: 39.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 4 DOI reference(s) in README -
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.3%) to scientific vocabulary
Keywords
bayesian
conformal-prediction
prediction
r
Last synced: 6 months ago
·
JSON representation
Repository
Jackknife(+) Predictive Intervals for Bayesian Models
Basic Info
- Host: GitHub
- Owner: CoryMcCartan
- License: other
- Language: R
- Default Branch: main
- Homepage: http://corymccartan.com/conformalbayes/
- Size: 8.5 MB
Statistics
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
- Releases: 0
Topics
bayesian
conformal-prediction
prediction
r
Created almost 4 years ago
· Last pushed 7 months ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
set.seed(5118)
```
# **conformalbayes**
[](https://CRAN.R-project.org/package=conformalbayes)
[](https://lifecycle.r-lib.org/articles/stages.html#experimental) [](https://opensource.org/licenses/MIT)
[](https://github.com/CoryMcCartan/conformalbayes/actions/workflows/R-CMD-check.yaml)
**conformalbayes** provides functions to construct finite-sample calibrated
predictive intervals for Bayesian models, following the approach in
[Barber et al. (2021)](https://doi.org/10.1214/20-AOS1965).
These intervals are calculated efficiently using importance sampling for the
leave-one-out residuals.
By default, the intervals will also reflect the relative uncertainty in the
Bayesian model, using the locally-weighted conformal methods of
[Lei et al. (2018)](https://doi.org/10.1080/01621459.2017.1307116).
## Installation
You can install the development version of **conformalbayes** with:
``` r
# install.packages("devtools")
devtools::install_github("CoryMcCartan/conformalbayes")
```
## Example
```{r, message=F}
library(rstanarm)
library(conformalbayes)
data("Loblolly")
fit_idx = sample(nrow(Loblolly), 50)
d_fit = Loblolly[fit_idx, ]
d_test = Loblolly[-fit_idx, ]
# fit a simple linear regression
m = stan_glm(height ~ sqrt(age), data=d_fit,
chains=1, control=list(adapt_delta=0.999), refresh=0)
# prepare conformal predictions
m = loo_conformal(m)
# make predictive intervals
pred_ci = predictive_interval(m, newdata=d_test, prob=0.9)
print(head(pred_ci))
# are we covering?
mean(pred_ci[, "5%"] <= d_test$height &
d_test$height <= pred_ci[, "95%"])
```
Read more on the [Getting Started page](https://corymccartan.com/conformalbayes/articles/conformalbayes.html).
## Citations
Barber, R. F., Candes, E. J., Ramdas, A., & Tibshirani, R. J. (2021). Predictive inference with the jackknife+. *The Annals of Statistics, 49*(1), 486-507.
Lei, J., G’Sell, M., Rinaldo, A., Tibshirani, R. J., & Wasserman, L. (2018). Distribution-free predictive inference for regression. *Journal of the American Statistical Association, 113*(523), 1094-1111.
Owner
- Name: Cory McCartan
- Login: CoryMcCartan
- Kind: user
- Company: New York University
- Website: corymccartan.com
- Twitter: CoryMcCartan
- Repositories: 55
- Profile: https://github.com/CoryMcCartan
Faculty Fellow at NYU's Center for Data Science, working on computational social science problems and open-source R software.
GitHub Events
Total
- Push event: 6
Last Year
- Push event: 6
Committers
Last synced: 6 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Cory McCartan | c****n@g****m | 26 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: 1 day
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 2.0
- Average comments per pull request: 0
- 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
- pat-alt (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 378 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 3
- Total maintainers: 1
cran.r-project.org: conformalbayes
Jackknife(+) Predictive Intervals for Bayesian Models
- Homepage: https://github.com/CoryMcCartan/conformalbayes
- Documentation: http://cran.r-project.org/web/packages/conformalbayes/conformalbayes.pdf
- License: MIT + file LICENSE
-
Latest release: 0.1.4
published 7 months ago
Rankings
Forks count: 21.9%
Stargazers count: 22.5%
Dependent packages count: 29.8%
Average: 34.5%
Dependent repos count: 35.5%
Downloads: 63.0%
Maintainers (1)
Last synced:
6 months ago