Open spinkney opened 2 years ago
Why can't we just sort_asc
on the unordered vector and then which ever density the user chooses will be ordered on that?
Because of the joint density of ordered statistics? Take $Z$ to be the vector of order statistics $X{(1)}, \ldots, X{(n)}$ then the joint density is
$$ f{Z}(z) = n! \prod{i = 1}^n f_{X}(z_i). $$
The Jacobian in this case is exactly the density chosen. We don't need to compute $n!$ unless the density is normalized _lpdf
.
I'm finding that using the absolute value to increment is more stable than $\exp(\cdot)$. The jacobian adjustment is constant.
I have to put a prior on x or else it's improper. When I compare to the built-in I notice the built-in has 1 or 2 divergences with a normal prior (N(0, 10)) and this one doesn't.