Skip to content

Commit

Permalink
fix empirical distribution area normalization
Browse files Browse the repository at this point in the history
closes #61
  • Loading branch information
bvenn committed May 11, 2020
1 parent 0d6b4e9 commit 75f5262
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/FSharp.Stats/Distributions/Empirical.fs
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,6 @@ module Empirical =
else
((k + 1.) * bandwidth) - halfBw, count)
|> Seq.sortBy fst
let area =
tmp
|> Seq.pairwise
|> Seq.fold (fun acc ((x0,y0),(x1,y1)) ->
acc + (abs (x1 - x0)) * ((y0 + y1) / 2.)) 0.
tmp
|> Seq.map (fun (a,b) -> (a,b / area))
|> Map.ofSeq
|> normalize

0 comments on commit 75f5262

Please sign in to comment.