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

Make wishart and inv_wishart functions check symmetry/positive definiteness on input #2281

Merged
merged 3 commits into from
Jan 1, 2021

Conversation

bbbales2
Copy link
Member

@bbbales2 bbbales2 commented Dec 31, 2020

Summary

This is a fix for #2279 . It makes it so that wishart_lpdf, wishart_log, wishart_rng, inv_wishart_lpdf, inv_wishart_log, and inv_wishart_rng check that their matrix arguments are symmetric and positive definite.

Tests

I added new positive definite tests to the prim tests. I also updated all the old tests so that only symmetric, positive definite inputs work

Release notes

  • Wishart and inverse wishart functions now check that symmetric positive definite inputs are actually symmetric positive definite.

Checklist

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.32 3.34 0.99 -0.66% slower
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 1.0 -0.22% slower
eight_schools/eight_schools.stan 0.11 0.11 0.98 -1.57% slower
gp_regr/gp_regr.stan 0.16 0.16 1.01 0.58% faster
irt_2pl/irt_2pl.stan 5.17 5.14 1.01 0.64% faster
performance.compilation 91.07 88.57 1.03 2.74% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.66 8.66 1.0 0.06% faster
pkpd/one_comp_mm_elim_abs.stan 28.37 29.9 0.95 -5.42% slower
sir/sir.stan 136.68 131.79 1.04 3.58% faster
gp_regr/gen_gp_data.stan 0.04 0.04 1.0 -0.45% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.04 3.05 1.0 -0.26% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.38 0.38 1.0 -0.29% slower
arK/arK.stan 2.53 2.54 1.0 -0.44% slower
arma/arma.stan 0.61 0.61 0.99 -1.0% slower
garch/garch.stan 0.67 0.68 1.0 -0.3% slower
Mean result: 0.998344698235

Jenkins Console Log
Blue Ocean
Commit hash: 5151f64


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
Copy link
Member Author

bbbales2 commented Jan 1, 2021

Ready for review! #2266 needs this in

Copy link
Member

@syclik syclik left a comment

Choose a reason for hiding this comment

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

Lgtm!

@bbbales2 bbbales2 merged commit 62f5aa8 into develop Jan 1, 2021
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