Hello, I have a task for modeling ordered discrete response outcome but I struggled to make my prior ordered for ordered logistic model so theta[6] > theta[5] > theta[4] > theta[3] > theta[2] > theta[1]
. In Stan, I can declare parameters ordered[6] theta
so it’s constraint that way.
data{
int y[120];
}
parameters{
ordered[6] theta;
}
model{
theta ~ normal(0,1);
for (i in 1:120) {
y[i] ~ ordered_logistic(0,theta);
}
}
In Turing, how do I reproduce above?
y = [6, 5, 4, 3, 2, 1,
1, 2 ,3 ,4 ,5 ,6]
y = repeat(y, 10)
@model function gdemo(y)
theta ~ filldist(Normal(1, 2),6)
y .~ OrderedLogistic(0, theta)
end
chn = sample(gdemo(y), NUTS(), 1000)
julia> ERROR: TaskFailedException: cutpoints are not sorted