stan-dev / projpred

Projection predictive variable selection
https://mc-stan.org/projpred/
Other
109 stars 25 forks source link

Prepare brms warnings if `wrhs` or `orhs` are specified #486

Closed fweber144 closed 11 months ago

fweber144 commented 11 months ago

This PR allows brms:::.extract_model_data() to throw warnings if wrhs or orhs are specified (brms:::.extract_model_data() ignores these, which is so far only documented but not warned about). In fact, such warnings could be thrown also without this PR, but then we would have a lot of false positive alarms. The key to avoiding such false positives is to avoid the projpred-internal specification of wrhs and orhs inside of init_refmodel() and to pass arguments weightsnew and offsetnew from proj_linpred(), proj_predict(), and predict.refmodel() to the extract_model_data() function as they are.

The init_refmodel() adjustment is performed by commits 61c4c8c1b0ca54659bcc99e2a0b1e56c7b9f77c7 and 70cc5466ed394a3823cfe61ef3a554acf93768a1. The proj_linpred() and proj_predict() adjustment (predict.refmodel() did not require an adjustment; here, we only perform some simplifications for it) is performed by commits 0cf096ccb1643ff9ea4316c2ee5815b7c008d9e1, 392578647d43033f21df60ee037d5e8f7fc9873f, and fa12c484429cc36faf46540c3ac083d2a15099c2.