Sbc for linear regression

Hello everyone,

I have just a quick question regarding sbc for Linear regression with regularizing priors. Say for example I wish to verify the correct sampling of the posterior using stan for a model with the horseshoe prior. The whole data generating process is not modeled, as the predictor variables are not modeled.

Is sbc still applicable? if so, which considerations or assumptions would be needed?

Thank you and best regards

You can either run SBC using the fixed covariates – i.e. you sample model configurations and then variates from the fixed covariates and sampled model configurations – or you explicitly model the covariates. Each analysis answers different questions, in particular the first validates your implementation/algorithm only for the fixed covariates while the latter offers a much more extensive guarantee.

Personally I recommend attempting to model the covariates as it will not only offer a better test but also force you to think more carefully about the covariates which will facilitate principled prior choices on the slopes.

1 Like

Thank you very much for you reply.

I have it very clear why of the former option. For the latter I have not so clear how it proceeds. If I am only interested in looking at the performance of the algorithm for inferring the slopes, if I add a generative model for the covariates, is it also necessary to include posterior estimates for the covariates hyper parameters?, thus increasing the overall complexity. Or is it correct to just generate covariates and only evaluate the “slopes” algorithm?

so it goes, for each sbc iteration to:

  • simulate covariates
  • simulate linear model
  • evaluate posterior for the slopes part of the model
  • compute rank statistics.

OR can I have a set of generated covariates and then run sbc in each one of them?

I hope I expressed my questions correctly and thank you again for your answer.

You have to sample from everything, but if you only care about certain slopes then you only need to evaluate the SBC histograms corresponding to those parameters. Treat the covariates just as you would the variates – their distributions (formally marginals of the prior predictive distribution) are super helpful for understanding the consequences of your prior in the context of the observational model – but you don’t need to consider them for SBC.