TransformVariables.jl icon indicating copy to clipboard operation
TransformVariables.jl copied to clipboard

UnitVector only transforms to positive hemisphere

Open sethaxen opened this issue 5 years ago • 2 comments

The current UnitVector transformation currently transforms an n-1 dimensional vector to an n dimensional unit vector. However, upon transformation, all resulting unit vectors lie on the "hemi-hypersphere", where the final dimension is strictly positive. This is a problem for any applications where the unit vectors across the whole sphere are needed (e.g. directional/orientational statistics)

Stan handles the unit vector transform with a simple trick. I've implemented a version of this with an explanation here and would be happy to adapt it for this package if you're willing.

sethaxen avatar Dec 06 '19 09:12 sethaxen

Thanks. Can you please help me with pointing out where this is in the Stan docs?

tpapp avatar Dec 06 '19 12:12 tpapp

Sure, you can find it at https://mc-stan.org/docs/2_21/reference-manual/unit-vector-section.html

sethaxen avatar Dec 06 '19 12:12 sethaxen