Doubly Stochastic Matrices in Stan

I needed to use Stan with an unknown but doubly stochastic matrix, so I implemented the transformation described in

in the attached Stan program (2.9 KB) . You have to do the transformation again outside of Stan due to the inability to call functions that modify the target keyword outside the model block.

4 Likes