histogram-fill
histogram-fill copied to clipboard
Mean and variance functions?
I just wrote this. Maybe it would be worth adding a mean and variance function? Obviously we could make them just one traversal.
marginal1X, marginal1Y :: H.Histogram BinD Double
marginal1X = H.reduceX H.sum test
marginal1Y = H.reduceY H.sum test
m0X1 = H.sum marginal1X
m1X1 = H.sum $ H.bmap (\f v -> v * f) marginal1X
m2X1 = H.sum $ H.bmap (\f v -> v^2 * f) marginal1X
muX1 = m1X1 / m0X1
varX1 = (m2X1 / m0X1) - muX1^2
It certainly makes sense. But at the moment I'm working on big change to binning algorithm so I don't want to add new functions right now.
Ping @Shimuuar ! :)
Oh! I totally forgot about it. I have few half-baked idea an d almost no time :(