Specify product bernouli prior for selecting covariates into the model

I want to specify a model in which product bernoulis are sampled and then specify which covariates are in the model: e.g.

logitprobs[p] ~ i.i.d. N(0, 10) // say
xi[p] ~ i.i.d. bernouli(invlogit(logitprobs))
beta[p] ~ i.i.d. N(0, 10)
beta = xi* beta

e.g. the beta’s corresponding to xi=0 are zero, and only the beta’s corresponding to xi=1 are non-zero

Hi, @izmirlig. I didn’t see a question in there. Is it just how to code this model in Stan? If so, we need to know what’s observed and what’s a parameter. I also didn’t understand how beta was being given a normal(0, 10) sampling distribution and then begin multiplied by xi. Can you write the model down in mathematical notation?

Discrete parameters are not allowed in Stan. For an in-depth treatment of sparsity-inducing coefficient priors in Stan, see Sparsity Blues