mitchelloharawild / distributional

Vectorised distributions for R
https://pkg.mitchelloharawild.com/distributional
GNU General Public License v3.0
94 stars 15 forks source link

Allow unary negation to work with all distributions #96

Closed venpopov closed 3 months ago

venpopov commented 3 months ago

Summary

Fixed #95. I added a test showing that -dist_wrap('norm') and -dist_student_t(3) fail before the fix and pass afterwards.

Not sure if this is the optimal approach, but I just copy pasted the part from Ops.dist_normal that handled the unary negation to the code for Ops.dist_default and Ops.dist_transformed

mitchelloharawild commented 3 months ago

Looks great, thanks!