Vectorising user-defined multivariate lpdf/lpmf functions

Thanks @wds15. I’ve rewritten the code to slice over u (it is a parameter) and it’s currently running. Why is it better to slice over a parameter?

Great catch on the temporary variable, feel a bit silly for putting that in now!

I think to vectorise I’ll need to overhaul the code quite a lot (if indeed it’s possible). I’ll post here with the results of slicing over u and vectorising if I manage to!