From b57b56d3a20089e428e013bef6ae038e3d7de92e Mon Sep 17 00:00:00 2001 From: brucala Date: Mon, 5 May 2025 17:22:13 +0200 Subject: [PATCH] fix Moments --- src/stats.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stats.jl b/src/stats.jl index f8285a3..6e3d9fb 100644 --- a/src/stats.jl +++ b/src/stats.jl @@ -505,7 +505,7 @@ end Moments(;weight = EqualWeight()) = Moments(zeros(4), weight, 0) function _fit!(o::Moments, y::Real) γ = o.weight(o.n += 1) - y2 = y * y + y2 = float(y) ^ 2 @inbounds o.m[1] = smooth(o.m[1], y, γ) @inbounds o.m[2] = smooth(o.m[2], y2, γ) @inbounds o.m[3] = smooth(o.m[3], y * y2, γ)