Skip to content

Commit

Permalink
fix mean while we're at it
Browse files Browse the repository at this point in the history
  • Loading branch information
joshday committed Jun 20, 2020
1 parent 173c70d commit 0e2e029
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stats.jl
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ mutable struct Mean{T,W} <: OnlineStat{Number}
end
Mean(T::Type{<:Number} = Float64; weight = EqualWeight()) = Mean(zero(T), weight, 0)
function _fit!(o::Mean{T}, x) where {T}
o.μ = (o.n += 1) == 1 ? x : smooth(o.μ, x, T(o.weight(o.n)))
o.μ = smooth(o.μ, x, T(o.weight(o.n += 1)))
end
function _merge!(o::Mean, o2::Mean)
o.n += o2.n
Expand Down

2 comments on commit 0e2e029

@joshday
Copy link
Owner Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request updated: JuliaRegistries/General/16680

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.4.2 -m "<description of version>" 0e2e029e9cd74fce78a0de3a434ef60e5d8f22fe
git push origin v1.4.2

Please sign in to comment.