Git Product home page Git Product logo

stanlcmcr's Introduction

Stan implementations of Latent Class Multiple Capture-Recapture (LCMCR)

In this repository, we reimplement LCMCR in Stan (see paper), and diagnose and fix the causes of poor mixing and divergent transitions.

Project structure

The repository structure is broken up into atomic tasks joined together using Make (see this blogpost on Principled Data Processing). In particular we have the following directory structure:

  • stan: the raw Stan source code for the models
  • compile: compiles the Stan code
  • import: generates the simulated (and other) data
  • fit: fits the compiled models (and the R LCMCR code by comparison) against all the datasets
  • summaries: creates summaries of each of the fits
  • write: generates the figures ultimately used in the blogpost

Installation and running

We are using an experimental version of the R LCMCR package that takes two parameters: a_lambda and b_lambda. Create a directory called opt/ from the root project directory, and install the package there: install.packages('R_Package_basic/output/LCMCR_0.5.0.tar.gz', lib = '~/path/to/project/opt').

Aside from the experimental LCMCR package, the main R dependency is pacman. If it is not installed, run

Rscript -e 'install.packages("pacman")'

in the terminal. To run the project from end-to-end, which will install the necessary dependencies, run make.

Note: make will install the required R dependencies, including cmdstanr, which will in turn install Stan.

stanlcmcr's People

Contributors

samzhang111 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.