Coder Social home page Coder Social logo

scr-stan's Introduction

scr-stan: spatial capture-recapture examples in Stan

Project Status: Active – The project has reached a stable, usable state and is being actively developed.

The goal of scr-stan is to provide Stan implementations for a variety of spatial capture-recapture models described in the book Spatial Capture-Recapture by Royle, Chandler, Gardner, and Sollmann. The emphasis is on translating models from JAGS to Stan.

Why?

Stan is a flexible language that enables full Bayesian inference with dynamic Hamiltonian Monte Carlo, approximate Bayesian inference with automatic differentiation variational inference, and optimization (e.g., penalized maximum likelihood).

There are some good reasons to use Stan:

Using Stan can be hard for ecologists with experience in JAGS/BUGS/NIMBLE, because you have to marginalize over discrete parameters. But, you don't have to start from scratch. This repo provide a variety of examples, and if you've never marginalized over discrete parameters to implement a model in Stan, you might find this tutorial helpful.

Hopefully these Stan implementations lower the barrier to entry.

Dependencies

These examples use the scrbook R package, which you can download from here: https://sites.google.com/site/spatialcapturerecapture/scrbook-r-package

The remaining dependencies are on CRAN, and you can install them from R with:

devtools::install_deps()

What's here

This repo contains a bunch of Stan translations of JAGS models provided in the SCR book. Each example is a self-contained R script, and one or two Stan files.

Inspiration

This repo was built in the spirit of the Hiroki Itô's excellent Stan translations of "Bayesian Population Analysis using WinBUGS --- A Hierarchical Perspective" (2012) by Marc Kéry and Michael Schaub.

Contributing

If you have questions or find any issues, feel free to open an issue on GitHub: https://github.com/mbjoseph/scr-stan/issues

scr-stan's People

Contributors

mbjoseph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scr-stan's Issues

Review ovenbird examples

Chapters 9 and 14 both have multisession SCR models that use ovenbird data. In both cases, the posteriors seem different than what's reported in the SCR book. It would be nice to understand why these are different, and if necessary, fix any issues in the Stan implementations.

Chapter specific READMEs

It would be nice to have short READMEs for each chapter to outline what is covered, and potentially highlight any important points about the implementations.

Review early examples

While putting these together, I ended up finding ways to reduce redundant calculations here and there. At some point, I want to circle back to the earlier chapters and review the implementations to see if there are opportunities to make them more clear and/or efficient.

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.