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

Explore possibilities for storing speed statistics in higher fidelity #3

Open
bmander opened this issue Mar 11, 2015 · 1 comment
Open

Comments

@bmander
Copy link
Collaborator

bmander commented Mar 11, 2015

The plan is to digest GPS point updates into speed statistics for way segments. The statistics will be keyed to:

way_id, node_start_index, node_end_index, hour_of_week

The easiest way to store speed statistics as a rolling average, with fields

count, mean

In this case, every time a new speed is detected which matches the key, count = count+1 and mean=((mean*count)+newSpeed)/(count+1). That's simple enough.

But what if we want to know the distribution of speeds? How can we update such a distribution incrementally?

@abyrd
Copy link

abyrd commented May 6, 2015

One straightforward way is to just store histograms in arrays, with each element in the array being a bin of 1 kph, 5kph or whatever. When a new measurement comes in you increment the corresponding bin. If this turns out to be too voluminous the usual combination of delta coding / variable byte coding / run length coding should compress this down nicely.

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