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

allow glm functions to accept var matrix types #2655

Merged
merged 2 commits into from
Jan 14, 2022

Conversation

SteveBronder
Copy link
Collaborator

Summary

Updates the glm functions and their tests to use var<Matrix> types. This also has a small bugfix for assigning row vectors to var<Vector> types. 99% of the PR here is actually just updating the glm tests to use TYPED_TESTS() for checking both normal matrices and var matrices.

Tests

The glm tests have all been modified to be a TYPED_TEST_SUITE() with each test using TYPED_TEST() instead of just TEST() so that it will check if the functions work for both Eigen::Matrix<var> and var_value<Eigen::Matrix<double>> types.

Side Effects

Nope

Release notes

Have glm functions work for the new matrix type

Checklist

  • Math issue How to add static matrix? #1805

  • Copyright holder: Steve Bronder

    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

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.57 3.5 1.02 1.82% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.96 -4.65% slower
eight_schools/eight_schools.stan 0.09 0.09 1.07 6.22% faster
gp_regr/gp_regr.stan 0.15 0.15 1.04 3.9% faster
irt_2pl/irt_2pl.stan 5.68 5.74 0.99 -1.0% slower
performance.compilation 93.21 91.16 1.02 2.2% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.64 8.08 1.07 6.46% faster
pkpd/one_comp_mm_elim_abs.stan 31.38 32.53 0.96 -3.67% slower
sir/sir.stan 123.14 123.96 0.99 -0.67% slower
gp_regr/gen_gp_data.stan 0.03 0.03 1.0 0.48% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.03 3.0 1.01 1.2% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.39 0.42 0.95 -5.39% slower
arK/arK.stan 2.07 2.03 1.02 1.79% faster
arma/arma.stan 0.28 0.28 1.01 0.62% faster
garch/garch.stan 0.62 0.61 1.03 2.68% faster
Mean result: 1.00922372923

Jenkins Console Log
Blue Ocean
Commit hash: 1d82931


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

@rok-cesnovar rok-cesnovar merged commit 9c12790 into develop Jan 14, 2022
@rok-cesnovar rok-cesnovar deleted the feature/varmat-glms branch January 14, 2022 11:09
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