mjhajharia / transforms

2 stars 1 forks source link

Add normalized exponential transform #62

Closed sethaxen closed 12 months ago

sethaxen commented 1 year ago

This PR adds the "Normalized Exponential" transform (name TBD). It's the special case of the "Normalized Gamma" (also TBD) proposed by @nsiccha on Slack for $\alpha=\mathbf{1}$. To support Normalized Gamma for arbitrary $\alpha$, Stan needs an implementation of the inverse incomplete gamma function.

sethaxen commented 12 months ago

For normalized gamma, I think the relevant issue to track is https://github.com/stan-dev/math/issues/2509.

nsiccha commented 10 months ago

@sethaxen I just realized that exponential_log_qf(std_normal_lcdf(x)) = -log1m_exp(std_normal_lcdf(x)) = -std_normal_lccdf(x), though I'm not sure how stable Stan's implementation is, see https://github.com/stan-dev/math/issues/1985

sethaxen commented 10 months ago

Indeed, it seems that not as much work has been put into stability of that function. I think what we're doing here is probably preferable for now.

nsiccha commented 10 months ago

Yeah, I had put this here mainly so that I don't forget about it :) (But forgot to mention that :sweat_smile:)