If it's this one:
https://en.wikipedia.org/wiki/Log-logistic_distribution
then you can define its log density yourself with a user-defined
function.
functions {
real loglogistic_log(real y, real a, real b) {
return log(b) - log(a) + (b - 1) * (log(y) - log(a))
- 2 * log1p_exp(b * (log(y) - log(a));
}
}
For more efficiency, you want to store and reuse repeated
subexpressions like log(b) and (log(y) - log(a)).
For example, I think that top term reduces to:
log(b) - log(y) + b * (log(y) - log(a))
and then you can share the product term with the log1p_exp.
Oh, and log1p_exp(u) is log(1 + exp(u)), which allows us to
work on the log scale with u.
Once you know it works, you can put the functions block
in front of a Stan program and use
y ~ loglogistic(a, b);
in the model block. It won't be vectorized.
- Bob
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
stan-users+...@googlegroups.com.
> To post to this group, send email to
stan-...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.