Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndraws and nclusters revisited #291

Merged
merged 22 commits into from
Mar 26, 2022
Merged

Conversation

fweber144
Copy link
Collaborator

In a personal communication some weeks ago (@avehtari, @paul-buerkner, @yannmclatchie), we talked about how arguments ndraws and nclusters (and their *_pred variants) should be changed before the next CRAN release. This PR implements the discussed changes, in particular:

  • Move the ndraws default to nclusters.
  • Never pass ndraws to nclusters (and neither for their *_pred variants).
  • Throw an informational message if ndraws <= 20 (or ndraws_pred <= 20).

I moved most of the input-checking code for ndraws to nclusters (and their *_pred variants) to .get_refdist() because this allows for a lot of simplifications (thereby avoiding redundancies). It also seems like the most natural place. The updated .get_refdist() is also simplified at multiple places. Updating .get_refdist() required a few changes with regard to how post-processing functions like summary.vsel() can get information about the number of projected draws and whether clustering was used. However, this turned out to be quite straightforward and even safer (by using the output of .get_refdist()). So the changes with respect to the post-processing functions again seem like the most natural approach to me. The informational message mentioned above is now directly implemented in the updated .get_refdist() (this again shows how it can avoid redundant code).

So with this PR, we should be ready for the new CRAN release. Most of my statements from this PR comment apply again, slightly modified:


Note that automated checking via Travis or GitHub Actions still seems to be deactivated (see issue #236). I have run R CMD check locally on my available machines (Ubuntu 20.04.3 LTS and Windows 10) and it succeeded. I also checked with devtools::check_win_devel(), devtools::check_win_oldrelease(), and devtools::check_win_release():

  1. For the development R version (which is currently "R version 4.2.0 alpha (2022-03-24 r81978 ucrt)"), I got a strange test failure which I have never gotten locally before. Perhaps this is not related to projpred and will not occur anymore under R 4.2.0 beta or the final R 4.2.0, but I'm not sure. Sorry, I'm currently lacking the time to investigate this further.
  2. For the oldrelease R version (which is currently "R version 4.0.5 (2021-03-31)"), the check succeeds.
  3. For the release R version (which is currently "R version 4.1.3 (2022-03-10)"), the check succeeds.
  4. For all three win-builder R versions, I get NOTEs concerning inaccessible URLs and DOIs. Most of the URLs are URLs created from DOIs and they are in fact accessible, so I don't know what's going on there. One URL is indeed inaccessible, namely https://mc-stan.org/projpred/articles/projpred.html which is the link to the new vignette on the pkgdown site (which will only be available after branch gh-pages has been updated, see below).

Given these check results, I think it would be good if someone could double-check if everything is ready for a CRAN release, especially with regard to the test failure on R devel (4.2.0 alpha).

If possible, it would be great if the recommendations from this "R Packages" book section (in particular, the creation of a version tag) could be followed after the CRAN release. Furthermore, after the CRAN release, I can create a PR for updating branch gh-pages (I have already prepared that locally), so the pkgdown site is in sync with the CRAN version of the package.


clustering to be used, so it should be less confusing now).
the section for the most recent version. This should avoid a lot of confusion
and make the `NEWS` file easier to read when it is published on CRAN.
…usters`,

`ndraws_pred`, and `nclusters_pred`.
the section for the most recent version. This should avoid a lot of confusion
and make the `NEWS` file easier to read when it is published on CRAN."

Add another important commit which used to be included in v2.0.4.
…f `ndraws <= 20`.

Thereby, most of the related code is moved to `.get_refdist()` which is also
simplified at multiple places.
throw a warning if `ndraws <= 20`. Thereby, most of the related code is moved to
`.get_refdist()` and a corresponding change is also necessary for `summary()`
output.
avoid an inconsistency for `datafit`s, for example (but generally for all
situations where `nclusters == S == 1`). This also allows to remove the special
`S == 1` case in the `nclusters == 1` case.
init_refmodel()) works for rstanarm reference models" runs through.
@AlejandroCatalina AlejandroCatalina merged commit 4595003 into stan-dev:develop Mar 26, 2022
@fweber144 fweber144 deleted the ndr_ncl branch March 26, 2022 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants