Variable selection (Sensu projpred) for beta regression

Hi friends!

I’m trying to do a cross validation of a beta regression model on a small data set. I want to follow the variable selection process that projpred allows, but it appears that the varsel() function does not appear to work for the objects returned by stan_betareg().

Does anyone know a way around this? My only thought so far is to code my own model and try to come at it that way. Or try transforming the response by applying the logit-link function before modeling and applying a straight stan glm model.

fullBetaModel_Age <- stan_betareg(  resp ~ x + y + z,
                                                                          data = realAgeData,
                                                                          link = "logit",
                                                                          prior = hs(),
                                                                          adapt_delta = 0.9 )

varsel <- cv_varsel(fullBetaModel_Age, method='forward', nloo = nrow(realAgeData))

Error in get(extend_family_specific, mode = "function") : 
  object 'extend_family_beta' of mode 'function' was not found


Tagging @jonah and @avehtari for a bit more insight.

My guess is that this is a bug and it is possible that there is some very easy quick fix…

Hope we can get this resolved soon…

Hmm yeah that could be a bug but I’m not sure. I’m not as familiar with projpred internals as I’d like to be so I’m tagging @AlejandroCatalina, who I think has been the most active projpred developer lately.

As you say in the OP, we have not implemented varsel() functions for beta regression models. We are currently implementing a feature that would enable this but it’s not yet in master.

You can work around this by solving a GLM on the latent space and doing varsel() there, as you mentioned in the original post. However take into account that you will need to transform every projections’ predictions to be able to go back to the original space.

One more idea: all of the features of your model (beta family, regularized horseshoe) is well supported by brms and brms fits should work with varsel out of the box (I’ve never used it myself, but manual suggests it works) so you might be able to use brms instead of rstanarm to use varsel directly (although `brms is a bit harder to install as you need fully working Stan enviornment)

1 Like

Thanks Martin, I will try that!