GiggleLiu / NiLang.jl

A differential eDSL that can run faster than light and go back to the past.
https://giggleliu.github.io/NiLang.jl/dev
Apache License 2.0
250 stars 16 forks source link

Update statistics.jl #32

Closed HanLi123 closed 4 years ago

HanLi123 commented 4 years ago

add method to get Pearson correlation and covariance of two vectors.

codecov[bot] commented 4 years ago

Codecov Report

Merging #32 into master will increase coverage by 2.58%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
+ Coverage   79.20%   81.78%   +2.58%     
==========================================
  Files          25       25              
  Lines         928     1032     +104     
==========================================
+ Hits          735      844     +109     
+ Misses        193      188       -5     
Impacted Files Coverage Δ
src/stdlib/statistics.jl 100.00% <100.00%> (ø)
src/vars.jl 100.00% <0.00%> (ø)
src/autodiff/instructs.jl 87.12% <0.00%> (+0.32%) :arrow_up:
src/stdlib/sparse.jl 90.90% <0.00%> (+0.43%) :arrow_up:
src/stdlib/linalg.jl 91.66% <0.00%> (+0.75%) :arrow_up:
src/autodiff/ulog.jl 90.90% <0.00%> (+1.43%) :arrow_up:
src/autodiff/jacobian.jl 92.50% <0.00%> (+1.87%) :arrow_up:
src/autobcast.jl 91.89% <0.00%> (+1.89%) :arrow_up:
src/autodiff/hessian_backback.jl 77.77% <0.00%> (+2.02%) :arrow_up:
src/ulog.jl 77.08% <0.00%> (+2.08%) :arrow_up:
... and 6 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 abba09c...a485b7f. Read the comment docs.

GiggleLiu commented 4 years ago

Thank you, @HanLi123, it looks good, do you might adding a test here: https://github.com/GiggleLiu/NiLang.jl/blob/master/test/stdlib/statistics.jl

HanLi123 commented 4 years ago

@GiggleLiu Done.

GiggleLiu commented 4 years ago

The code looks good in general, I just nitpicked some details. e.g. adding @inbounds.

Thank you so much for contributing NiLang!

GiggleLiu commented 4 years ago

I polished the code a little bit, hopefully these changes would make the code run faster. See: https://github.com/GiggleLiu/NiLang.jl/pull/33/files