Power-scaling only top level prior in priorsense

I am just getting started with the new priorsense package (currently using version 1.0.3) to assess the sensitivity of my hierarchical model to the prior distribution assumptions. Based on the recommendation in the paper by Kallioinen et al (“Detecting and diagnosing prior and likelihood sensitivity with power-scaling”), I understand that only a top-level prior should be power-scaled. My question is, how should this actually implemented.

For example, if I have a vector of j cluster specific effects, and each one shares the same distribution, but the variation \sigma needs to be estimated, I want to test the sensitivity to the prior distribution assumption of \sigma only:

\mu_j \sim N(0, \sigma)
\sigma \sim t_{df=3}^+(0, 2.5)

Would I accomplish this through how I define lprior in the generated quantities block in my Stan code, perhaps by excluding \mu from the calculation of the log prior? Or is this accomplished somehow in the call to powerscale_sensitivity() in R? There are arguments prior_selection and likelihood_selection, but it is not exactly clear if that is the role those arguments take.

I’m happy to provide a clear example if that will help. Thanks in advance for any advice.

Hi, @kgoldfeld: I don’t know what they mean by power-scaling—can you say what that means in math?

This isn’t a Stan package, so we may not be the people to ask for help about it. For instance, I have no idea what powerscale_sensitivity() or prior_selection and likelihood_selection are.

You will have to put things that affect the prior in the model itself, because they affect the posterior log density. You can define some kind of scale as a data variable then set it to different values for different runs.

The generated quantities block is just for posterior predictive quantities that don’t affect parameter inference.

Thanks—it pretty much always helps with a forum like this—there are just way too many stats papers for us to know them all.

There are two ways to accomplish this, but both relate to the lprior variable in the Stan model.

Option 1: only include the priors you want to power-scale in the lprior calculation. e.g. in your case something like

lprior = student_t_lpdf(sigma | 3, 0, 2.5);

Option 2: Define lprior as an array. Then partition your priors into groups and add the density evaluations to elements in the array.
Then you can use prior_selection in the R functions to select elements in the array to include in the power-scaling. This option is more flexible as you can then look at sensitivity to changing only some of the priors. e.g. something along the lines of

array[2] real lprior;
lprior[1] = student_t_lpdf(sigma | 3, 0, 2.5);
lprior[2] = normal_lpdf(mu | 0, sigma);
powerscale_sensitivity(fit, prior_selection = 1)

Hope this helps @kgoldfeld!

Perfect - thanks so much for confirming my intuition.