Git Product home page Git Product logo

bus_kalman's Introduction

Interpolating bus travel times

The motivation

Currently, the NYC bus system's GPS sensors only give us 30-second granularity on bus position, and - as is par for the course with GPS sensors - are fairly noisy. In general, whether for nice visualizations or for general interest, we might want to get a better sense of where a given bus is, especially if a GPS sensor report fails. How can we interpolate between our messy measurements into something nice?

The solution: a Kalman Filter

Kalman Filters are the exact tool typically used to solve this sort of problem. We make a prediction for our next state, based only on the previous state, via a linear model - then measure and update the estimate of our state based on the measurement - adding in a Gaussian error term to account for noise.

In particular, we make predictions every 5 seconds, ignoring the measure/update phase of the filter until the next measurement comes in (usually about 30 seconds later). Hence, we use the filter as a way to smooth out our interpolations to something "smarter" than pure linear interpolation based on how fast the bus was previously moving. It will be interesting to test this against pure linear interpolation to see how much the filter's smoothing can help us better estimate bus position at any point in time.

The notebook contains the machinery making the model work.

bus_kalman's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.