Skip to content

Generalize double exponential - #2022

Merged
bbbales2 merged 26 commits into
stan-dev:developfrom
bstatcomp:generalize_double_exponential
Sep 11, 2020
Merged

bbbales2 merged 26 commits into
stan-dev:developfrom
bstatcomp:generalize_double_exponential

Conversation

@t4c1

@t4c1 t4c1 commented Aug 18, 2020 •

Copy link
Copy Markdown
Contributor

Summary

Generalizes double exponential distribution related function to accept Eigen expressions.

Tests

Tested using expression testing framework

Side Effects

None.

Release notes

Generalized double exponential distribution related function to accept Eigen expressions.

Checklist

  • Math issue Generalize matrix function signatures #1470

  • Copyright holder: Tadej Ciglarič

    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

@t4c1

t4c1 commented Aug 20, 2020

Copy link
Copy Markdown
Contributor Author

@SteveBronder @andrjohns Do you any experiance making Eigen worked with mixed scalar types? Most operations work fine, but in this PR I have a problem with comparisons. I could wrap both sides of comparison int value_of_rec, but solving this on Eigen level would be more elegant.

@andrjohns

Copy link
Copy Markdown
Collaborator

Can you point me to the comparison? What are the two types? I might have an idea, but will see!

Comment thread stan/math/prim/prob/double_exponential_cdf.hpp
@stan-buildbot

Copy link
Copy Markdown
Contributor

Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 4.18 4.27 0.98 -2.3% slower
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.98 -2.41% slower
eight_schools/eight_schools.stan 0.09 0.09 1.0 -0.24% slower
gp_regr/gp_regr.stan 0.2 0.21 0.94 -5.84% slower
irt_2pl/irt_2pl.stan 5.27 5.19 1.01 1.36% faster
performance.compilation 89.79 87.28 1.03 2.79% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.31 8.28 1.0 0.39% faster
pkpd/one_comp_mm_elim_abs.stan 28.0 28.56 0.98 -1.98% slower
sir/sir.stan 130.05 137.92 0.94 -6.05% slower
gp_regr/gen_gp_data.stan 0.04 0.05 0.99 -1.21% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.33 3.34 1.0 -0.21% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.39 0.4 0.98 -2.03% slower
arK/arK.stan 2.57 2.55 1.01 0.53% faster
arma/arma.stan 0.73 0.72 1.01 1.16% faster
garch/garch.stan 0.73 0.72 1.01 1.23% faster
Mean result: 0.990786363211

Jenkins Console Log
Blue Ocean
Commit hash: 159d1df


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

@bbbales2 bbbales2 mentioned this pull request Aug 30, 2020
1 of 6 tasks

@bbbales2 bbbales2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review!

Comment thread stan/math/prim/fun/sign.hpp
Comment thread stan/math/prim/prob/double_exponential_lpdf.hpp Outdated
Comment thread stan/math/prim/prob/double_exponential_lpdf.hpp
Comment thread stan/math/prim/prob/double_exponential_cdf.hpp Outdated
Comment thread stan/math/prim/fun/eigen_comparisons.hpp
@stan-buildbot

Copy link
Copy Markdown
Contributor

Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 4.17 4.27 0.98 -2.45% slower
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.99 -1.31% slower
eight_schools/eight_schools.stan 0.09 0.1 0.96 -4.57% slower
gp_regr/gp_regr.stan 0.2 0.19 1.02 1.92% faster
irt_2pl/irt_2pl.stan 5.23 5.24 1.0 -0.15% slower
performance.compilation 88.51 87.45 1.01 1.2% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.25 8.22 1.0 0.31% faster
pkpd/one_comp_mm_elim_abs.stan 27.95 28.45 0.98 -1.78% slower
sir/sir.stan 130.96 142.1 0.92 -8.51% slower
gp_regr/gen_gp_data.stan 0.04 0.05 0.99 -1.33% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.44 3.32 1.04 3.41% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.39 0.4 0.98 -2.08% slower
arK/arK.stan 2.54 2.55 1.0 -0.42% slower
arma/arma.stan 0.74 0.74 1.01 0.54% faster
garch/garch.stan 0.72 0.73 0.99 -1.16% slower
Mean result: 0.98989223068

Jenkins Console Log
Blue Ocean
Commit hash: 809d391


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

@bbbales2 bbbales2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ack I failed to submit the review twice sorry

Comment thread test/unit/util.hpp Outdated
Comment thread test/unit/math/mix/fun/eigen_comparisons_test.cpp Outdated
t4c1 added 2 commits September 9, 2020 08:28
# Conflicts:
#	test/expressions/stan_math_sigs_exceptions.expected
@stan-buildbot

Copy link
Copy Markdown
Contributor

Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 4.41 4.41 1.0 0.2% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.99 -0.79% slower
eight_schools/eight_schools.stan 0.09 0.09 0.95 -5.16% slower
gp_regr/gp_regr.stan 0.2 0.2 1.0 -0.25% slower
irt_2pl/irt_2pl.stan 5.21 5.27 0.99 -1.18% slower
performance.compilation 90.49 87.55 1.03 3.24% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.21 8.26 0.99 -0.58% slower
pkpd/one_comp_mm_elim_abs.stan 27.33 27.67 0.99 -1.24% slower
sir/sir.stan 129.23 137.77 0.94 -6.61% slower
gp_regr/gen_gp_data.stan 0.05 0.05 1.0 0.31% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.35 3.33 1.01 0.63% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.39 0.39 0.99 -1.03% slower
arK/arK.stan 2.55 2.56 1.0 -0.32% slower
arma/arma.stan 0.74 0.74 1.0 -0.19% slower
garch/garch.stan 0.73 0.73 0.99 -0.66% slower
Mean result: 0.991470843379

Jenkins Console Log
Blue Ocean
Commit hash: 8821e13


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

@bbbales2 bbbales2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Question

Comment thread test/unit/math/mix/fun/eigen_comparisons_test.cpp
@bbbales2
bbbales2 merged commit 8a3f008 into stan-dev:develop Sep 11, 2020
@t4c1
t4c1 deleted the generalize_double_exponential branch January 18, 2021 12:27
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.

5 participants