projpred-related seed fix and docs/NEWS #1502
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a minor bug in PRNG usage of
get_refmodel.brmsfit()
: The PRNG state should be reset upon exit only if the user-supplied seed is notNULL
. See theNEWS.md
entry from 8db0bbd for details.In principle, I would also recommend to replace
brms_seed = NULL
withbrms_seed = NA
(i.e., changing the default but also replacingis.null(brms_seed)
withis.na(brms_seed)
within the function—although length 1 would probably have to be asserted forNA
—and adapting the code forbrms_seed_k
accordingly) becauseNULL
has a special meaning forset.seed()
's argumentseed
, namely to generate completely unreproducible results (which might sometimes be desired by users). However, it seems like within brms,NA
has a special meaning for seed arguments, namely that a seed will be set randomly (seebrms::brm()
). So in that regard, it's probably better to stick withNULL
instead ofNA
(otherwise, all other seed arguments would have to be adapted for the sake of consistency).In commit 0c5c8a5, a
NEWS.md
entry for projpred's augmented-data projection is added at an older version (2.17.0). Back then, I didn't add aNEWS.md
entry because projpred's CRAN version didn't support the augmented-data projection at that time. Now, users might be searching for "augmented-data projection" across thisNEWS.md
file to see when support for it was added (similarly to the latent projection, for which aNEWS.md
entry was added at brms version 2.19.0). That's why I'm adding the augmented-data projection entry now.Furthermore, I would still recommend to remove argument
newdata
ofget_refmodel.brmsfit()
. The last state of our discussion on this was at #1292 (comment). There, I said I needed to think about whether a reference model where fit and data don't match complies with projpred's understanding of a reference model. I have come to the conclusion that such a reference model does not comply with projpred's understanding of a reference model: In projpred, the reference model is inseparable from its parameter estimates and the data they are based on (so in case of new data, the reference model would have to be refitted). The corresponding rstanarm method (get_refmodel.stanreg()
) also doesn't have anewdata
argument. So if you are ok with this, then I would push a commit here that deprecates this argument.