I’ve got an ordered logistic regression with 5 categories for my outcome variable. I am wanting to specify a Horseshoe prior for regularization to 0 (it used to be a LASSO, but I’ve seen the discourse here suggesting to go with a Horseshoe instead). Would the following STAN code correctly fit this model? I am new to STAN so I did a combination of looking at examples for ordered logistic regressions on the STAN manual and looking through here when people specified a horseshoe prior. I just want to be extra sure that I didn’t cross my wires somewhere and mess something up.
data {
int<lower=0> N; // Number of observations
int<lower=5> K; // Number of outcomes
int<lower=1> D; // Number of predictors
array[N] int<lower=1, upper=K> y;
matrix[N, D] x; // Matrix for predictors
}
parameters {
vector[D] beta; // Coefficients for predictors
ordered[K-1] c; // Coefficients for each intercept
real<lower=0> lambda; // Global shrinkage parameter
vector<lower=0>[D] tau; // Local shrinkage parameters
real<lower=0> sigma; // Scale parameter
}
model {
// Horseshoe prior for Coefficients
lambda ~ cauchy(0, 1);
tau ~ cauchy(0, 1);
sigma ~ cauchy(0, 1);
beta ~ normal(0, lambda * tau * sigma);
// Specify the likelihood
Y ~ ordered_logistic(x * beta, c)
}