Skip to content

Chinese Restaurant Process Models for Regression and Clustering. Master branch contains latest stable build.

License

Notifications You must be signed in to change notification settings

stablemarkets/ChiRP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChiRP: Chinese Restaurant Process Mixtures for Regression and Clustering

Development Status:

License: MIT Build Status Coveralls github

status

DOI

About

The R package ChiRP is an MCMC-based implementation of Chinese Restaurant Process (CRP) mixtures for regression and clustering. CRP models (aka Dirichlet Process models) are a class of Bayesian nonparametric models. We provide facilities for zero-inflated semi-continuous outcomes, continuous outcomes, and binary outcomes.

Installation

Install using devtools package

## install.packages('devtools' ) ## make sure to have devtools installed 
devtools::install_github('stablemarkets/ChiRP')
library(ChiRP)

Documentation and Examples

The companion web site contains the statistical details of the model as well as several replicable examples.

Help documentation in R is also available. After installing the package and loading it with library(), use ? to access help documentation for specific functions:

?ChiRP::NDPMix  # for continuous outcomes: outputs draws of posterior *predictive* Y | X ~ N( E[Y|X], sd )), not draws of E[Y|X].
?ChiRP::fDPMix  # for continuous outcomes: outputs draws of posterior regression E[Y|X] )
?ChiRP::ZDPMix  # for zero-inflated, semi-continuous outcomes
?ChiRP::PDPMix  # for binary outcomes
?ChiRP::cluster_assign_mode # computes posterior mode cluster assignment

The help file for each function contains an example that you can run directly in your R session.

Reporting Issues

ChiRP uses the testthat package for unit-testing and Travis CI for continuous integration. Coverage of unit test is tracked using Coveralls.

If you encounter any bugs or have feature requests, please open an issue on GitHub.

Contributing to ChiRP

You can contribute in two ways:

  1. Contribute to base code: First, start an issue in this repository with the proposed modification. Fork this repository, make changes/enhancements, then submit a pull request. The issue will be closed once the pull request is merged.
  2. Contribute an example: First, start an issue in the companion site's repository. Fork the repository and add a new example to examples.Rmd. Use rmarkdown::render_site() to build the site. Submit a pull request in that same repository. The issue will be closed once updates are merged.

Contact

The corresponding package author is Arman Oganisian (email: aoganisi@upenn.edu). You can follow updates about the package on twitter.