Skip to content

Commit

Permalink
Improve accumulation for CarleEstimator
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Oct 18, 2024
1 parent 5ece127 commit fdeda3d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/empirical/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,10 @@ function accumulate(data, pairs, estimator::CarleEstimator, algo::AccumAlgo)
# evaluate function estimator
v = formula(estimator, z₁[i], z₁[j], z₂[i], z₂[j])

# accumulate if value is valid
if all(!ismissing, v)
ns[lag] += 1
Σx[lag] += h
Σy[lag] += v
end
# accumulate because value is always valid
ns[lag] += 1
Σx[lag] += h
Σy[lag] += v
end
end
end
Expand Down

0 comments on commit fdeda3d

Please sign in to comment.