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

In var, don't compute the mean if provided #68

Merged
merged 2 commits into from
Jan 22, 2021

Conversation

knuesel
Copy link
Contributor

@knuesel knuesel commented Jan 20, 2021

As mentioned in #12, var currently calculates the mean even if provided through the mean keyword argument.

Before this PR:

v = rand(100000);
μ = mean(v);

julia> @btime var($v, mean=$μ)
  33.777 μs (0 allocations: 0 bytes)

After:

julia> @btime var($v, mean=$μ)
  17.571 μs (0 allocations: 0 bytes)

@codecov
Copy link

codecov bot commented Jan 20, 2021

Codecov Report

Merging #68 (b710298) into master (ba90d86) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #68      +/-   ##
==========================================
+ Coverage   97.37%   97.41%   +0.04%     
==========================================
  Files           1        1              
  Lines         381      387       +6     
==========================================
+ Hits          371      377       +6     
  Misses         10       10              
Impacted Files Coverage Δ
src/Statistics.jl 97.41% <100.00%> (+0.04%) ⬆️

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 ba90d86...b710298. Read the comment docs.

src/Statistics.jl Outdated Show resolved Hide resolved
src/Statistics.jl Outdated Show resolved Hide resolved
Copy link
Member

@nalimilan nalimilan left a comment

Choose a reason for hiding this comment

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

Thanks!

@DilumAluthge
Copy link
Contributor

@nalimilan Good to merge now?

@nalimilan nalimilan merged commit 7b56a27 into JuliaStats:master Jan 22, 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