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

Add Exponential Distribution quantile function #2649

Closed
wants to merge 7 commits into from
Closed

Add Exponential Distribution quantile function #2649

wants to merge 7 commits into from

Conversation

andrjohns
Copy link
Collaborator

Summary

This PR introduces the quantile function of the exponential distribution.

I've used the _qf suffix, as suggested by @spinkney over in #2513

Tests

prim and mix tests have been added

Side Effects

Additional prob folders have been created in the fwd and rev folders so that the gradients for vector returns can be specified.

Release notes

Added quantile function for the exponential distribution

Checklist

  • Math issue Add distribution quantile functions (inverse CDFs) #2517

  • Copyright holder: Andrew Johnson

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

@andrjohns
Copy link
Collaborator Author

Note that the rest of the quantile functions to be added will follow the same naming _qf suffix and folder structure rev/prob and fwd/prob, so I'd encourage anyone interested to speak up if that clashes in any way

(Let me know if there's anyone I should tag to make sure this gets seen)

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.51 3.54 0.99 -0.83% slower
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.99 -0.88% slower
eight_schools/eight_schools.stan 0.09 0.08 1.02 1.89% faster
gp_regr/gp_regr.stan 0.15 0.15 0.98 -2.35% slower
irt_2pl/irt_2pl.stan 5.78 5.73 1.01 0.84% faster
performance.compilation 93.67 91.23 1.03 2.61% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.34 8.13 1.03 2.49% faster
pkpd/one_comp_mm_elim_abs.stan 32.95 31.6 1.04 4.1% faster
sir/sir.stan 117.98 117.05 1.01 0.79% faster
gp_regr/gen_gp_data.stan 0.04 0.04 0.97 -3.31% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.96 3.01 0.99 -1.45% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.4 0.39 1.02 2.16% faster
arK/arK.stan 2.08 2.05 1.01 1.43% faster
arma/arma.stan 0.27 0.27 1.0 0.25% faster
garch/garch.stan 0.61 0.61 1.0 -0.17% slower
Mean result: 1.0054449601

Jenkins Console Log
Blue Ocean
Commit hash: cf33e69


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@bob-carpenter
Copy link
Contributor

I've used the _qf suffix

The suffix should match whatever we did for the normal inverse cdf. But all I can find is inv_Phi. If this is the first general one, I'm OK with _qf.

@andrjohns
Copy link
Collaborator Author

Closing for now to clear PR backlog, will re-open once ready for review

@andrjohns andrjohns closed this May 1, 2022
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.

3 participants