Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ChangesOfVariables and InverseFunctions #85

Merged
merged 1 commit into from
Nov 13, 2021
Merged

Support ChangesOfVariables and InverseFunctions #85

merged 1 commit into from
Nov 13, 2021

Conversation

oschulz
Copy link
Contributor

@oschulz oschulz commented Nov 13, 2021

This PR adds support for JuliaMath/ChangesOfVariables and JuliaMath/InverseFunctions. Both are very lightweight, dependency-free, low-bias packages designed to enable composability of packages that provide/implement or use variable transformation capabilities.

Specifically, this PR adds support for ChangesOfVariables.test_with_logabsdet_jacobian and InverseFunctions.inverse. Package like StatsFuns and LogExpFunctions already support one or both of them (JuliaStats/LogExpFunctions.jl#29, JuliaStats/LogExpFunctions.jl#30, JuliaStats/StatsFuns.jl#130). I think it would be awesome if TransformVariables would join the club.

This PR has no impact on the load time of TransformVariables

# Current master branch:
julia> @time using TransformVariables
  1.104098 seconds (3.20 M allocations: 229.310 MiB, 2.51% gc time, 39.71% compilation time)
# This PR:
julia> @time using TransformVariables
1.105833 seconds (3.20 M allocations: 229.336 MiB, 2.15% gc time, 37.48% compilation time)

CC @devmotion

Copy link
Owner

@tpapp tpapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tpapp tpapp merged commit 7e76757 into tpapp:master Nov 13, 2021
@tpapp
Copy link
Owner

tpapp commented Nov 13, 2021

@oschulz: Thanks for the nice PR. Should I tag a release, or are you planning more additions?

@oschulz
Copy link
Contributor Author

oschulz commented Nov 13, 2021

Should I tag a release

That would be great, thanks!

or are you planning more additions?

No, I think this is complete (as far as I can see for now :-) ).

I thought about proposing that TransformVariables just adopts InverseFunctions.inverse as it's own inverse, but the semantics are a bit different - InverseFunctions.inverse is more restrictive, it expects that it's argument is a function (not a Function but callable).

Btw., input on ChangesOfVariables and InverseFunctions is very welcome of course - me and @devmotion created them, but they're really intended to be standards for and carried/evolved by the whole community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants