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

binning scheme description #4

Open
mdsumner opened this issue Mar 30, 2017 · 0 comments
Open

binning scheme description #4

mdsumner opened this issue Mar 30, 2017 · 0 comments

Comments

@mdsumner
Copy link
Member

We generate long MCMC chains, posterior samples at arbitrary observation-times with longitude, latitude from modelling animal location. The observation times are (usually) roughly twice-daily at local twilight, or at more arbitrary times whenever the Argos Service observes the tag, or perhaps other derived or quality filtered locations from GPS. To summarize these we developed a system of sparse and abstract 3D rasters, with a time slice at each observation time, and with each observation stored as a small window matrix from a "parent grid". Since the posterior samples are spatially dense it makes sense to to "bin" them into a local discretized window, and store a local matrix for every observation - this things the chains immensely and provides a continuous spatial model of positional-likelihood or other metric of intensity (like time-spent).

This was implemented long ago in tripEstimation::pimg (on CRAN) and sees a more modern version in SGAT::Pimage (at github.com/SWotherspoon/SGAT). I've been toying with a new "tidy" version that uses raster/dplyr as the binning engine, by coalescing tables of cell counts using group_by after identifying cells with raster. This is as fast as the fastest we could make the old matrix versions, that used tabulate with a simple affine transform and local indexing within a parent matrix to avoid expanding the parent by time.

It's really straightforward to do this, and it makes for very compelling summary engine for building duration-based metrics of location-probability, time-spent surfaces and animations of these, from large collections of tracking data. The local window model scales up to any number of tracking events, since it collapses long MCMC chains into very efficient discretized versions. There's an overhead to calculate any particular bin choice, and coordinate system of course but the results are so useful it makes a nice step from the model outputs to the result stage.

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

1 participant