# rstanarm <img src="man/figures/stanlogo.png" align="right" width="120" />
<!-- badges: start -->
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/rstanarm?color=blue)](http://cran.r-project.org/package=rstanarm)
[![Downloads](http://cranlogs.r-pkg.org/badges/rstanarm?color=blue)](http://cran.rstudio.com/package=rstanarm)
[![R-CMD-check](https://github.com/stan-dev/rstanarm/workflows/R-CMD-check/badge.svg)](https://github.com/stan-dev/rstanarm/actions)
<!-- badges: end -->
### Bayesian applied regression modeling (arm) via Stan
This is an R package that emulates other R model-fitting functions but uses
[Stan](http://mc-stan.org) (via the **rstan** package) for the back-end
estimation. The primary target audience is people who would be open to Bayesian
inference if using Bayesian software were easier but would use frequentist
software otherwise.
Fitting models with **rstanarm** is also useful for experienced Bayesian
software users who want to take advantage the pre-compiled Stan programs that
are written by Stan developers and carefully implemented to prioritize numerical
stability and the avoidance of sampling problems.
Click the arrows for more details:
<details><summary>More detail</summary>
The **rstanarm** package is an appendage to the **rstan** package, the R
interface to [Stan](http://mc-stan.org/). **rstanarm** enables many of the most
common applied regression models to be estimated using Markov Chain Monte Carlo,
variational approximations to the posterior distribution, or optimization. The
package allows these models to be specified using the customary R modeling
syntax (e.g., like that of `glm` with a `formula` and `data.frame`).
Additional arguments are provided for specifying prior distributions.
The set of models supported by **rstanarm** is large (and will continue to
grow), but also limited enough so that it is possible to integrate them
tightly with the [`pp_check`](http://mc-stan.org/rstanarm/reference/pp_check.stanreg.html) function for graphical posterior predictive checks using [**bayesplot**](http://mc-stan.org/bayesplot) and the
[`posterior_predict`](http://mc-stan.org/rstanarm/reference/posterior_predict.stanreg.html)
function to easily estimate the effect of specific manipulations of predictor
variables or to predict the outcome in a training set.
The fitted model objects returned by the **rstanarm** modeling functions are
called _stanreg_ objects. In addition to all of the traditional
[methods](http://mc-stan.org/rstanarm/reference/stanreg-methods.html)
defined for fitted model objects, stanreg objects can also be used with the
[**loo**](http://mc-stan.org/rstanarm/reference/loo.stanreg.html) package for
leave-one-out cross-validation, model comparison, and model weighting/averaging
and the [**shinystan**](http://mc-stan.org/rstanarm/reference/shinystan.html)
package for exploring the posterior distribution and model diagnostics
with a graphical user interface.
Check out the **rstanarm** [vignettes](http://mc-stan.org/rstanarm/articles/)
for examples and more details about the entire process.
</details>
<details><summary>Modeling functions</summary>
The model estimating functions are described in greater detail in their
individual help pages and vignettes. Here we provide a very brief overview:
* [__`stan_lm`__, __`stan_aov`__,__`stan_biglm`__](https://mc-stan.org/rstanarm/reference/stan_lm.html)
Similar to `lm` and `aov` but with novel regularizing priors on the model
parameters that are driven by prior beliefs about R-squared, the proportion of
variance in the outcome attributable to the predictors in a linear model.
* [__`stan_glm`__, __`stan_glm.nb`__](https://mc-stan.org/rstanarm/reference/stan_glm.html)
Similar to `glm` but with various possible prior distributions for the
coefficients and, if applicable, a prior distribution for any auxiliary
parameter in a Generalized Linear Model (GLM) that is characterized by a
`family` object (e.g. the shape parameter in Gamma models). It is also possible
to estimate a negative binomial model similar to the `glm.nb` function
in the `MASS` package.
* [__`stan_glmer`__, __`stan_glmer.nb`__, __`stan_lmer`__](https://mc-stan.org/rstanarm/reference/stan_glmer.html)
Similar to the `glmer`, `glmer.nb`, and `lmer` functions (__lme4__ package) in
that GLMs are augmented to have group-specific terms that deviate from the
common coefficients according to a mean-zero multivariate normal distribution
with a highly-structured but unknown covariance matrix (for which **rstanarm**
introduces an innovative prior distribution). MCMC provides more appropriate
estimates of uncertainty for models that consist of a mix of common and
group-specific parameters.
* [__`stan_nlmer`__](https://mc-stan.org/rstanarm/reference/stan_nlmer.html)
Similar to `nlmer` (__lme4__ package) package for nonlinear "mixed-effects"
models, but flexible priors can be specified for all parameters in the model,
including the unknown covariance matrices for the varying
(group-specific) coefficients.
* [__`stan_gamm4`__](https://mc-stan.org/rstanarm/reference/stan_gamm4.html)
Similar to `gamm4` (__gamm4__ package), which augments a GLM (possibly with
group-specific terms) with nonlinear smooth functions of the predictors to
form a Generalized Additive Mixed Model (GAMM). Rather than calling
`lme4::glmer` like `gamm4` does, `stan_gamm4` essentially calls `stan_glmer`,
which avoids the optimization issues that often crop up with GAMMs and
provides better estimates for the uncertainty of the parameter estimates.
* [__`stan_polr`__](https://mc-stan.org/rstanarm/reference/stan_polr.html)
Similar to `polr` (__MASS__ package) in that it models an ordinal response,
but the Bayesian model also implies a prior distribution on the unknown
cutpoints. Can also be used to model binary outcomes, possibly while
estimating an unknown exponent governing the probability of success.
* [__`stan_betareg`__](https://mc-stan.org/rstanarm/reference/stan_betareg.html)
Similar to `betareg` (__betareg__ package) in that it models an outcome that
is a rate (proportion) but, rather than performing maximum likelihood
estimation, full Bayesian estimation is performed by default, with
customizable prior distributions for all parameters.
* [__`stan_clogit`__](https://mc-stan.org/rstanarm/reference/stan_clogit.html)
Similar to `clogit` (__survival__ package) in that it models an binary outcome
where the number of successes and failures is fixed within each stratum by
the research design. There are some minor syntactical differences relative
to `survival::clogit` that allow `stan_clogit` to accept
group-specific terms as in `stan_glmer`.
* [__`stan_mvmer`__](https://mc-stan.org/rstanarm/reference/stan_mvmer.html)
A multivariate form of `stan_glmer`, whereby the user can specify
one or more submodels each consisting of a GLM with group-specific terms. If
more than one submodel is specified (i.e. there is more than one outcome
variable) then a dependence is induced by assuming that the group-specific
terms for each grouping factor are correlated across submodels.
* [__`stan_jm`__](https://mc-stan.org/rstanarm/reference/stan_jm.html)
Estimates shared parameter joint models for longitudinal and time-to-event
(i.e. survival) data. The joint model can be univariate (i.e. one longitudinal
outcome) or multivariate (i.e. more than one longitudinal outcome). A variety
of parameterisations are available for linking the longitudinal and event
processes (i.e. a variety of association structures).
</details>
<details><summary>Estimation algorithms</summary>
The modeling functions in the **rstanarm** package take an `algorithm`
argument that can be one of the following:
* __Sampling__ (`algorithm="sampling"`):
Uses Markov Chain Monte Carlo (MCMC) --- in particular, Stan's implementation
of Hamiltonian Mont
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
rstanarm:用于贝叶斯应用回归建模的rstanarm R包 (278个子文件)
00Index 510B
configure.ac 2KB
mrp.bib 3KB
CITATION 2KB
cleanup 198B
init.cpp 1KB
tests.cpp 590B
frost.css 4KB
rstanarm-win.def 32B
DESCRIPTION 3KB
.gitignore 257B
.gitignore 7B
csr_matrix_times_vector2.hpp 2KB
meta_header.hpp 116B
rstanarm_dev_notes.html 22KB
include 19B
.install_extras 11B
LICENSE 34KB
Makevars 1KB
rstanarm_dev_notes.md 16KB
NEWS.md 13KB
README.md 13KB
ISSUE_TEMPLATE.md 535B
NAMESPACE 6KB
stanlogo.png 16KB
jm_data_block.R 87KB
misc.R 57KB
stan_jm.fit.R 45KB
posterior_survfit.R 40KB
stan_glm.fit.R 39KB
posterior_traj.R 39KB
stan_jm.R 36KB
test_methods.R 34KB
log_lik.R 33KB
priors.R 32KB
print-and-summary.R 30KB
loo.R 28KB
test_stan_jm.R 24KB
test_stan_functions.R 23KB
stan_betareg.fit.R 22KB
stanmvreg-methods.R 20KB
test_misc.R 20KB
posterior_predict.R 20KB
test_stan_glm.R 18KB
pp_data.R 18KB
prior_summary.R 18KB
stan_gamm4.R 18KB
stanreg-methods.R 17KB
plots.R 17KB
pp_check.R 14KB
jm_make_assoc_terms.R 14KB
stan_polr.R 12KB
test_stan_mvmer.R 12KB
test_stan_glmer.R 12KB
test_stan_betareg.R 12KB
stan_glm.R 12KB
test_loo.R 12KB
test_posterior_predict.R 11KB
loo-kfold.R 11KB
stan_biglm.fit.R 11KB
jm_make_assoc_parts.R 11KB
stan_betareg.R 10KB
stanreg_list.R 10KB
stan_glmer.R 10KB
predictive_error.R 10KB
stan_mvmer.R 10KB
stan_nlmer.R 9KB
pp_validate.R 9KB
simulate_b_pars.R 9KB
stan_clogit.R 8KB
stan_lm.R 8KB
posterior_vs_prior.R 8KB
stan_aov.R 8KB
doc-datasets.R 7KB
stan_polr.fit.R 7KB
stanreg-objects.R 7KB
test_plots.R 7KB
posterior_linpred.R 6KB
test_pp_check.R 6KB
launch_shinystan.R 6KB
test_predict.R 6KB
stanreg.R 6KB
test_stan_lm.R 5KB
as.matrix.stanreg.R 5KB
loo-prediction.R 5KB
posterior_interval.R 5KB
stanmvreg.R 5KB
ps_check.R 5KB
ARM_Ch04.R 5KB
doc-rstanarm-package.R 5KB
doc-modeling-functions.R 5KB
bayes_R2.R 5KB
data_block.R 5KB
stan_biglm.R 5KB
test_stan_polr.R 4KB
predictive_interval.R 4KB
ARM_Ch05.R 4KB
doc-rstanarm-deprecated.R 4KB
doc-algorithms.R 4KB
stan_lm.fit.R 3KB
共 278 条
- 1
- 2
- 3
火君
- 粉丝: 18
- 资源: 4608
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1