Skip to content

Commit

Permalink
Handle NaN in CarleEstimator
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Oct 18, 2024
1 parent fdeda3d commit e700e69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/empirical/estimators/carle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ struct CarleEstimator <: Estimator end

formula(::CarleEstimator, z₁ᵢ, z₁ⱼ, z₂ᵢ, z₂ⱼ) = SVector{2,Int}(z₁ᵢ * z₂ⱼ, z₁ᵢ)

normsum(::CarleEstimator, Σy, n) = Σy[1] / Σy[2]
normsum(::CarleEstimator, Σy, n) = iszero(Σy[2]) ? zero(Float64) : Σy[1] / Σy[2]

combine(::CarleEstimator, yα, nα, yβ, nβ) = (yα *+* nβ) / (nα + nβ)

0 comments on commit e700e69

Please sign in to comment.