I am trying to implement a multivariate logistic function into Stan and
figured I will need the following things in order to make the desired
likelihood function.

v Degrees of freedom
p Dimension of y T_{p,v} ~ Multivariate T g_v() Inverse CDF T \phi^{-1} ~ \Gamma^{-1} (v/2,v/2) z_{j} = log{\frac{F(\phi^{-1}e_j)}{(1-F(\phi^{-1}e_j))}} e_1..e_p ~ Multivariate Normal N(0,R) F(e_j) ~ Uniform distribution (0,1) L() ~ Logit
R Covariance matrix of e_1..e_p

Some of these are easily accessible by using predefined functions
in Stan. However I’m wondering if it is possible to obtain the
Inverse CDF of a T distribution in an efficient way. Also I do not quite
understand how to sample from a distribution that is undefined. The model
I want to use is build up like this for the p-dimensional case:

So the first part is a multivariate T distribution multiplied by scaling the
univariate logit model by a univariate T distribution. You can see that if
the number of dimensions is p=1, only L(z_1|\mu_1) remains, hence the univariate
logit distribution.

To summarize, does the inverse CDF of the T distribution exist in Stan?
Are there any alternative approaches to solve this. Would it be possible
to define a model in the way defined above and sample from this?
Is it likely that this would lead to efficient sampling?

That help at all? You can surround things with dollar signs to use \LaTeX math or double dollar signs to center. You can use tick marks to write preformatted code too.

Is the inverse multivariate T cdf needed or just the univariate? The univariate T inverse cdf, what will be called quantile functions with _qf suffix in the next release can be coded in Stan now using

student_t_qf(real u, real nu) {
real x = u < 0.5 ? 2 * u : 2 * (1 - u);
return sign(u - 0.5) * sqrt( nu * (1 / (inv_inc_beta(nu / 2, 0.5, x))) - 1);
}

Would it be possible to define multivariate ordered logistic model in Stan? Like in e.g. this paper?

For non-ordinal (binary) response one could use the method described in the manual for multivariate probit here and sample from the PDF of a multivariate logistic rather than multivariate normal.

However, for ordinal responses one would need to generalise the transformed data code - which sorts the data into +'ve and -'ve components whilst keeping track of the indexes - to sort the data into components according to which category each response falls into. Furthermore in the parameters block the latent variable z would need to be broken into components constrained by the thresholds. Would this be possible to code in Stan?

The transformed data component is no problem. I do that kind of thing all the time to avoid branching in the model code.

Im not sure what you mean by latent z being broken into components. Can you be more specific bout what you’re trying to do? I’m afraid I’m not going to have time to digest the paper you linked.

In the multivariate probit code in the Stan manual, z is truncated at 0 so its broken into positive-constrained and negative-constrained components. For ordinal regression it would need to be broken into components defined by cutpoint parameters, so the transformed data and transformed parameters blocks would need to be generalised.