stripe / rainier

Bayesian inference in Scala.
https://rainier.fit
Apache License 2.0
433 stars 51 forks source link

Multivariate Normal #474

Closed avibryant closed 4 years ago

avibryant commented 4 years ago

This introduces the MVNormal distribution, parameterized by the cholesky decomposition L of its correlation matrix A.

Currently there are only two convenient way to construct the required correlation matrix:

More ways of constructing/decomposing matrices will be added in the future.

bg-stripe commented 4 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop@337c4cc). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #474   +/-   ##
==========================================
  Coverage           ?   51.71%           
==========================================
  Files              ?       73           
  Lines              ?     2856           
  Branches           ?      174           
==========================================
  Hits               ?     1477           
  Misses             ?     1379           
  Partials           ?        0           
Impacted Files Coverage Δ
...in/scala/com/stripe/rainier/core/Categorical.scala 26.53% <0.00%> (ø)
...n/scala/com/stripe/rainier/core/Multivariate.scala 0.00% <0.00%> (ø)
...main/scala/com/stripe/rainier/bench/stan/ARK.scala 0.00% <0.00%> (ø)
...com/stripe/rainier/bench/stan/ModelBenchmark.scala 0.00% <0.00%> (ø)
...a/com/stripe/rainier/bench/stan/GLMMPoisson2.scala 0.00% <0.00%> (ø)
...c/main/scala/com/stripe/rainier/sampler/EHMC.scala 0.00% <0.00%> (ø)
...ain/scala/com/stripe/rainier/ir/DataFunction.scala 100.00% <0.00%> (ø)
...ala/com/stripe/rainier/ir/ExprClassGenerator.scala 100.00% <0.00%> (ø)
...rc/main/scala/com/stripe/rainier/compute/Vec.scala 13.23% <0.00%> (ø)
...scala/com/stripe/rainier/ir/CompiledFunction.scala 92.15% <0.00%> (ø)
... and 63 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 337c4cc...d32153b. Read the comment docs.

codecov-io commented 4 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop31@972f977). Click here to learn what that means. The diff coverage is 38.98%.

Impacted file tree graph

@@             Coverage Diff              @@
##             develop31     #474   +/-   ##
============================================
  Coverage             ?   51.83%           
============================================
  Files                ?       73           
  Lines                ?     2867           
  Branches             ?      174           
============================================
  Hits                 ?     1486           
  Misses               ?     1381           
  Partials             ?        0
Impacted Files Coverage Δ
...in/scala/com/stripe/rainier/bench/stan/KidIQ.scala 0% <0%> (ø)
...a/com/stripe/rainier/bench/stan/GLMMPoisson2.scala 0% <0%> (ø)
...n/scala/com/stripe/rainier/core/Multivariate.scala 0% <0%> (ø)
...com/stripe/rainier/bench/stan/LowDimGaussMix.scala 0% <0%> (ø)
...rc/main/scala/com/stripe/rainier/compute/Vec.scala 13.04% <0%> (ø)
...ain/scala/com/stripe/rainier/core/Continuous.scala 76.82% <0%> (ø)
...main/scala/com/stripe/rainier/bench/stan/ARK.scala 0% <0%> (ø)
...a/com/stripe/rainier/bench/stan/EightSchools.scala 0% <0%> (ø)
...main/scala/com/stripe/rainier/core/Injection.scala 80% <100%> (ø)
...e/src/main/scala/com/stripe/rainier/core/SBC.scala 14.7% <100%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 972f977...33a48e5. Read the comment docs.

bg-stripe commented 4 years ago

Codecov Report

Merging #474 into develop31 will increase coverage by 0.12%. The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##           develop31     #474      +/-   ##
=============================================
+ Coverage      51.77%   51.90%   +0.12%     
=============================================
  Files             71       73       +2     
  Lines           2814     2867      +53     
  Branches         167      174       +7     
=============================================
+ Hits            1457     1488      +31     
- Misses          1357     1379      +22     
Impacted Files Coverage Δ
...in/scala/com/stripe/rainier/compute/Cholesky.scala 82.35% <0.00%> (ø)
...n/scala/com/stripe/rainier/core/Multivariate.scala 0.00% <0.00%> (ø)
.../scala/com/stripe/rainier/ir/MethodGenerator.scala 86.41% <0.00%> (+1.23%) :arrow_up:
...cala/com/stripe/rainier/compute/Coefficients.scala 90.47% <0.00%> (+1.58%) :arrow_up:
...rc/main/scala/com/stripe/rainier/sampler/RNG.scala 100.00% <0.00%> (+20.00%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7beb2f8...ee12211. Read the comment docs.

codecov-io commented 4 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop31@c181523). Click here to learn what that means. The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             develop31     #474   +/-   ##
============================================
  Coverage             ?   51.82%           
============================================
  Files                ?       73           
  Lines                ?     2871           
  Branches             ?      176           
============================================
  Hits                 ?     1488           
  Misses               ?     1383           
  Partials             ?        0
Impacted Files Coverage Δ
...rc/main/scala/com/stripe/rainier/compute/Vec.scala 13.04% <ø> (ø)
...n/scala/com/stripe/rainier/core/Multivariate.scala 0% <0%> (ø)
...c/main/scala/com/stripe/rainier/compute/Real.scala 83.47% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c181523...945a072. Read the comment docs.