Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2D histograms #148

Closed
yakir12 opened this issue May 27, 2019 · 3 comments
Closed

2D histograms #148

yakir12 opened this issue May 27, 2019 · 3 comments

Comments

@yakir12
Copy link

yakir12 commented May 27, 2019

This would be very powerful for processing coordinates, for instance:

xys = [[rand(2) for _ in 1:10] for _ in 1:3] # 3 tracks with 10 coordinates each
o = Hist(.2:0.1:.8, .3:.1:1) # dispatch on 2 arguments versus one, so no need for new name
for xy in xys # iterate over tracks
    fit!(o, xy) # fit all the coordinates
end
@joshday
Copy link
Owner

joshday commented May 27, 2019

That exists in https://github.com/joshday/AverageShiftedHistograms.jl, but it would be nice to have it built into OnlineStats

@yakir12
Copy link
Author

yakir12 commented May 28, 2019

I guess a time will come when people will want to (on-line) fit n-dimensional histograms to their data... So it might be good to implement it in a generic enough way so to handle that as well. I have no idea what I'm talking about: maybe that is theoretically impossible.

@joshday
Copy link
Owner

joshday commented Sep 30, 2019

I think StatsBase.Histogram can do N-dimensional fitting. If I remember correctly, there's also a low level function that does online updating.

Also, apparently I forgot about OnlineStats.HeatMap which does exactly what you want.

I think I like keeping HeatMap separate from Hist in order to keep the code cleaner (less type parameters, etc.)

@joshday joshday closed this as completed Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants