Skip to content

Commit

Permalink
Update vignette indexes/titles, add GHA workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed May 20, 2024
1 parent e979876 commit 7ee88be
Show file tree
Hide file tree
Showing 19 changed files with 996 additions and 1,024 deletions.
43 changes: 11 additions & 32 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
branches:
- master
- survival-rstantools
pull_request:
branches:
- master
- survival-rstantools

name: R-CMD-check

Expand All @@ -20,16 +22,15 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'devel', rstan: 'CRAN'}
- {os: macOS-latest, r: 'release', rstan: 'CRAN'}
- {os: windows-latest, r: 'devel', rstan: 'CRAN'}
- {os: windows-latest, r: 'release', rstan: 'CRAN'}
- {os: ubuntu-latest, r: 'devel', rstan: 'CRAN'}
- {os: ubuntu-latest, r: 'release', rstan: 'CRAN'}
- {os: ubuntu-latest, r: 'oldrel', rstan: 'CRAN'}

- {os: macOS-latest, r: 'release', rstan: 'Preview'}
- {os: windows-latest, r: 'release', rstan: 'Preview'}
- { os: macOS-latest, r: 'devel' }
- { os: macOS-latest, r: 'release' }
- { os: macOS-latest, r: 'oldrel' }
- { os: windows-latest, r: 'devel' }
- { os: windows-latest, r: 'release' }
- { os: windows-latest, r: 'oldrel' }
- { os: ubuntu-latest, r: 'devel' }
- { os: ubuntu-latest, r: 'release' }
- { os: ubuntu-latest, r: 'oldrel' }
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
Expand All @@ -39,7 +40,6 @@ jobs:
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
workflow: R-CMD-check.yaml
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

- uses: actions/checkout@v3
Expand All @@ -50,25 +50,4 @@ jobs:

- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
extra-packages: any::rcmdcheck any::betareg any::HSAUR3 any::biglm any::gamm4 any::V8

- name: Install RStan Preview if Needed
run: |
if ("${{ matrix.config.rstan }}" == "Preview") {
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
}
shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual", "--as-cran", "--ignore-vignettes")'
build_args: '"--no-build-vignettes"'

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rstanarm
Type: Package
Title: Bayesian Applied Regression Modeling via Stan
Version: 2.32.1
Version: 2.35.0.9000
Date: 2024-01-15
Encoding: UTF-8
Authors@R: c(person("Jonah", "Gabry", email = "[email protected]", role = "aut"),
Expand Down Expand Up @@ -42,7 +42,7 @@ Imports:
loo (>= 2.1.0),
Matrix (>= 1.2-13),
nlme (>= 3.1-124),
posterior,
posterior,
rstan (>= 2.32.0),
rstantools (>= 2.1.0),
shinystan (>= 2.3.0),
Expand Down
48 changes: 24 additions & 24 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ models fit with `stan_polr()`. (#450)

* Fix bug where `stan_glmer()` would error if `prior_aux=NULL`. (#482)

* `posterior_predict()` and `posterior_epred()` don't error with `newdata` for
* `posterior_predict()` and `posterior_epred()` don't error with `newdata` for
intercept only models by allowing data frames with 0 columns and multiple rows. (#492)

### New features
Expand All @@ -30,23 +30,23 @@ intercept only models by allowing data frames with 0 columns and multiple rows.
# rstanarm 2.21.1

* Compatible with rstan v2.21.1
* Consistent with new book [Regression and Other Stories](https://statmodeling.stat.columbia.edu/2020/07/08/regression-and-other-stories-is-available/)
* Consistent with new book [Regression and Other Stories](https://statmodeling.stat.columbia.edu/2020/07/08/regression-and-other-stories-is-available)

### Backwards incompatible changes

* `stan_jm()` is not available for 32bit Windows

* Some improvements to prior distributions, as described in detail in the
vignette *Prior Distributions for rstanarm Models* and book
vignette *Prior Distributions for rstanarm Models* and book
*Regression and Other Stories*. These changes shouldn't cause any existing code
to error, but default priors have changed in some cases:
- default prior on intercept is still Gaussian but the way the location and
- default prior on intercept is still Gaussian but the way the location and
scale are determined has been updated (#432)
- `autoscale` argument to functions like `normal()`, `student_t()`, etc.,
- `autoscale` argument to functions like `normal()`, `student_t()`, etc.,
now defaults to `FALSE` except when used by default priors (default
priors still do autoscalinng). This makes it simpler to specify non-default
priors. (#432)

### Bug fixes

* Fixed error in `kfold()` for `stan_gamm4()` models that used `random` argument (#435)
Expand Down Expand Up @@ -77,11 +77,11 @@ package. (#432)

* src/Makevars{.win} now uses a more robust way to find StanHeaders

* Fixed bug where `ranef()` and `coef()` methods for `glmer`-style models
* Fixed bug where `ranef()` and `coef()` methods for `glmer`-style models
printed the wrong output for certain combinations of varying intercepts
and slopes.

* Fixed a bug where `posterior_predict()` failed for `stan_glmer()` models
* Fixed a bug where `posterior_predict()` failed for `stan_glmer()` models
estimated with `family = mgcv::betar`.

* Fixed bug in `bayes_R2()` for bernoulli models. (Thanks to @mcol)
Expand All @@ -96,10 +96,10 @@ with identical (not just up to rng noise) results. (Thanks to @mcol)
* 4x speedup for most GLMs (`stan_glm()`) and GAMs (`stan_gamm4()` without
`random` argument). This comes from using Stan's new compound `_glm` functions
(`normal_id_glm`, `bernoulli_logit_glm`, `poisson_log_glm`,
`neg_binomial_2_log_glm`) under the hood whenever possible. (Thanks
`neg_binomial_2_log_glm`) under the hood whenever possible. (Thanks
to @avehtari and @VMatthijs)

* `compare_models()` is deprecated in favor of `loo_compare()` to keep up
* `compare_models()` is deprecated in favor of `loo_compare()` to keep up
with the loo package ([loo::loo_compare()](https://mc-stan.org/loo/reference/loo_compare))

* The `kfold()` method now has a `cores` argument and parallelizes by fold
Expand All @@ -111,7 +111,7 @@ sampling ([arxiv.org/abs/1507.02646](https://arxiv.org/abs/1507.02646),
[mc-stan.org/loo/reference/psis.html](https://mc-stan.org/loo/reference/psis.html))
is now used to diagnose and improve inference (see
https://avehtari.github.io/RAOS-Examples/BigData/bigdata.html). This also now
means that we can use PSIS-LOO also when `algorithm='optimizing'`. (Thanks
means that we can use PSIS-LOO also when `algorithm='optimizing'`. (Thanks
to @avehtari)

* For `stan_glm()` the `"meanfield"` and `"fullrank"` ADVI algorithms also
Expand Down Expand Up @@ -150,13 +150,13 @@ longitudinal submodel

* `posterior_linpred()` now has a draws argument like for `posterior_predict()`

* Dynamic predictions are now supported in `posterior_traj()` for
* Dynamic predictions are now supported in `posterior_traj()` for
`stan_jm` models.

* More options for K-fold CV, including manually specifying the folds or using helper functions to create them for particular model/data combinations.


# rstanarm 2.17.3
# rstanarm 2.17.3

Minor release for build fixes for Solaris and avoiding a test failure

Expand Down Expand Up @@ -186,7 +186,7 @@ normal variate

* The build system is more conventional now. It should require less RAM to build
from source but it is slower unless you utilize parallel make and LTO

### Big new features

* `stan_jm()` and `stan_mvmer()` contributed by Sam Brilleman
Expand Down Expand Up @@ -229,7 +229,7 @@ prior is specified for their standard deviation

* Fix for off-by-one error in some lme4-style models with multiple grouping
terms

### New features

* New methods `loo_linpred()`, `loo_pit()`, `loo_predict()`, and `loo_predictive_interval()`
Expand All @@ -245,11 +245,11 @@ terms
### Bug fixes

* `VarCorr()` could return duplicates in cases where a `stan_{g}lmer` model used grouping factor level names with spaces

* `The pairs()` function now works with group-specific parameters

* The `stan_gamm4()` function works better now

* Fix a problem with factor levels after estimating a model via `stan_lm()`

### New features
Expand Down Expand Up @@ -287,14 +287,14 @@ parameter of various GLM-like models

* Fix bug in `reloo()` if data was not specified
* Fix bug in `pp_validate()` that was only introduced on GitHub

### New features

* Uses the new **bayesplot** and **rstantools** R packages

* The new `prior_summary()` function can be used to figure out what priors were actually used

* `stan_gamm4()` is better implemented, can be followed by `plot_nonlinear()`,
* `stan_gamm4()` is better implemented, can be followed by `plot_nonlinear()`,
`posterior_predict()` (with newdata), etc.

* Hyperparameters (i.e. covariance matrices in general) for lme4 style models
Expand All @@ -321,7 +321,7 @@ inference was used to estimate the original model
### Bug fixes

* Requiring manually specifying offsets when model has an offset and newdata is not NULL

### New features

* `stan_biglm()` function that somewhat supports `biglm::biglm`
Expand All @@ -336,15 +336,15 @@ inference was used to estimate the original model

### New features

* `k_threshold` argument to `loo()` to do PSIS-LOO+
* `k_threshold` argument to `loo()` to do PSIS-LOO+

* `kfold()` for K-fold CV

* Ability to use sparse X matrices (slowly) for many models if memory is an issue

### rstanarm 2.9.0-4

### Bug fixes
### Bug fixes

* `posterior_predict()` with newdata now works correctly for ordinal models

Expand Down Expand Up @@ -392,7 +392,7 @@ problem out on stan-users.
* The `log_lik()` function now has a `newdata` argument

* New vignette on hierarchical partial pooling


# rstanarm 2.9.0-1

Expand Down
14 changes: 4 additions & 10 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
# Part of the rstanarm package for estimating model parameters
# Copyright (C) 2015 Trustees of Columbia University
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

library(testthat)
suppressPackageStartupMessages(library(rstanarm))
Sys.unsetenv("R_TESTS")
o <- utils::capture.output(example(example_model, echo = FALSE))
if (.Platform$OS.type != "windows") { # || .Platform$r_arch != "i386"
test_check("rstanarm", invert = FALSE,
filter = if (Sys.getenv("NOT_CRAN") != "true") "stan_functions")
}

test_check("rstanarm")
1 change: 0 additions & 1 deletion tests/testthat/include

This file was deleted.

1 change: 0 additions & 1 deletion tests/testthat/stan_files

This file was deleted.

4 changes: 2 additions & 2 deletions tests/testthat/test_stan_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
Sys.setenv(USE_CXX17 = 1)
set.seed(12345)

MODELS_HOME <- "stan_files"
INCLUDE_DIR <- "include"
MODELS_HOME <- "../../inst/stan"
INCLUDE_DIR <- "../../inst/include"

context("setup")
test_that("Stan programs are available", {
Expand Down
Loading

0 comments on commit 7ee88be

Please sign in to comment.