All Projects → stan-dev → Projpred

stan-dev / Projpred

Projection predictive variable selection

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Projpred

Shinystan
shinystan R package and ShinyStan GUI
Stars: ✭ 172 (+126.32%)
Mutual labels:  bayesian-inference, bayesian, stan, r-package
geostan
Bayesian spatial analysis
Stars: ✭ 40 (-47.37%)
Mutual labels:  bayesian, bayesian-inference, stan, r-package
Rstanarm
rstanarm R package for Bayesian applied regression modeling
Stars: ✭ 285 (+275%)
Mutual labels:  bayesian-inference, bayesian, stan, r-package
Rstan
RStan, the R interface to Stan
Stars: ✭ 760 (+900%)
Mutual labels:  bayesian-inference, stan, r-package
Bda r demos
Bayesian Data Analysis demos for R
Stars: ✭ 409 (+438.16%)
Mutual labels:  bayesian-inference, bayesian, stan
Stan
Stan development repository. The master branch contains the current release. The develop branch contains the latest stable development. See the Developer Process Wiki for details.
Stars: ✭ 2,177 (+2764.47%)
Mutual labels:  bayesian-inference, bayesian, stan
Brms
brms R package for Bayesian generalized multivariate non-linear multilevel models using Stan
Stars: ✭ 825 (+985.53%)
Mutual labels:  bayesian-inference, stan, r-package
Bda py demos
Bayesian Data Analysis demos for Python
Stars: ✭ 781 (+927.63%)
Mutual labels:  bayesian-inference, bayesian, stan
Bayadera
High-performance Bayesian Data Analysis on the GPU in Clojure
Stars: ✭ 342 (+350%)
Mutual labels:  statistics, bayesian-inference, bayesian
cmdstanr
CmdStanR: the R interface to CmdStan
Stars: ✭ 82 (+7.89%)
Mutual labels:  bayesian, stan, r-package
BayesHMM
Full Bayesian Inference for Hidden Markov Models
Stars: ✭ 35 (-53.95%)
Mutual labels:  statistics, bayesian, bayesian-inference
Elfi
ELFI - Engine for Likelihood-Free Inference
Stars: ✭ 208 (+173.68%)
Mutual labels:  statistics, bayesian-inference, bayesian
Bayesplot
bayesplot R package for plotting Bayesian models
Stars: ✭ 276 (+263.16%)
Mutual labels:  bayesian, stan, r-package
Matlabstan
Matlab interface to Stan, a package for Bayesian inference
Stars: ✭ 59 (-22.37%)
Mutual labels:  statistics, bayesian, stan
Pydlm
A python library for Bayesian time series modeling
Stars: ✭ 375 (+393.42%)
Mutual labels:  statistics, bayesian
Gtsummary
Presentation-Ready Data Summary and Analytic Result Tables
Stars: ✭ 450 (+492.11%)
Mutual labels:  statistics, r-package
Orbit
A Python package for Bayesian forecasting with object-oriented design and probabilistic models under the hood.
Stars: ✭ 346 (+355.26%)
Mutual labels:  bayesian, stan
Bayesian Analysis Recipes
A collection of Bayesian data analysis recipes using PyMC3
Stars: ✭ 479 (+530.26%)
Mutual labels:  bayesian-inference, bayesian
Posterior
The posterior R package
Stars: ✭ 75 (-1.32%)
Mutual labels:  bayesian, r-package
Bayesian Stats Modelling Tutorial
How to do Bayesian statistical modelling using numpy and PyMC3
Stars: ✭ 480 (+531.58%)
Mutual labels:  bayesian-inference, bayesian

Stan Logo

projpred

Build Status CRAN_Status_Badge

An R package to perform projection predictive variable selection for generalized linear models. Compatible with rstanarm and brms but other reference models can also be used.

The method is described in detail in Piironen et al. (2020) and evaluated in comparison to many other methods in Piironen and Vehtari (2017).

Currently, the supported models (family objects in R) include Gaussian, Binomial and Poisson families. See the quickstart-vignette for examples.

Resources

Installation

  • Install the latest release from CRAN:
install.packages('projpred')
  • Install latest development version from GitHub (requires devtools package):
if (!require(devtools)) {
  install.packages("devtools")
  library(devtools)
}
devtools::install_github('stan-dev/projpred', build_vignettes = TRUE)

Example

rm(list=ls())
library(projpred)
library(rstanarm)
options(mc.cores = parallel::detectCores())
set.seed(1)

# Gaussian and Binomial examples from the glmnet-package
data('df_gaussian', package = 'projpred')
#data('df_binom', package = 'projpred')

# fit the full model with a sparsifying prior
fit <- stan_glm(y ~ x, family = gaussian(), data = df_gaussian,
                prior = hs(df = 1, global_scale=0.01), iter = 500, seed = 1)
#fit <- stan_glm(y ~ x, family = binomial(), data = df_binom
#                prior = hs(df = 1, global_scale=0.01), iter = 500, seed = 1)


# perform the variable selection
vs <- varsel(fit)

# print the results
summary(vs)

# project the parameters for model sizes nterms = 3,5 variables 
projs <- project(vs, nterms = c(3, 5))

# predict using only the 5 most relevant variables
pred <- proj_linpred(vs, newdata=df_gaussian, nterms=5, integrated=TRUE)

# perform cross-validation for the variable selection
cvs <- cv_varsel(fit, cv_method='LOO')

# plot the validation results 
plot(cvs)

References

Dupuis, J. A. and Robert, C. P. (2003). Variable selection in qualitative models via an entropic explanatory power. Journal of Statistical Planning and Inference, 111(1-2):77–94.

Goutis, C. and Robert, C. P. (1998). Model choice in generalised linear models: a Bayesian approach via Kullback–Leibler projections. Biometrika, 85(1):29–37.

Piironen, Juho and Vehtari, Aki (2017). Comparison of Bayesian predictive methods for model selection. Statistics and Computing, 27(3):711-735. doi:10.1007/s11222-016-9649-y. (online).

Piironen, Juho, Paasiniemi, Markus and Vehtari, Aki (2020). Projective inference in high-dimensional problems: prediction and feature selection. Electronic Journal of Statistics, 14(1): 2155-2197 (Online).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].