Hello, Suppose X=(X_1,X_2,X_3) are dependent r.v.'s such that X_i\in\{1,2,3\}\,\forall i. Note that X can assume \mathcal{X}=\left[\{1,2,3\},\{1,3,2\},\{3,2,1\},\{3,1,2\},\{2,1,3\},\{2,3,1\}\right], Let I_j (j=1,\cdots,6) denote each combination in \mathcal{X}.
The probability mass function is assumes a different value for each combination I_j, that is
a and b are parameters present in all the expressions p_j.
I would like to define this distribution by using the “functions” environment in Stan, but I am sure how to do it efficiently, can we create conditional operations within the functions, so that Stan will consider only those expressions corresponding to the data points?
functions {
real new_lpmf(vector x, real a, real b) {
}
}
Thanks.