Giter VIP home page Giter VIP logo

salleuska / cplogit Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 15.38 MB

Supplementary code for the paper "Centered Partition Processes: Informative Priors for Clustering"

Home Page: https://projecteuclid.org/journals/bayesian-analysis/volume-16/issue-1/Centered-Partition-Processes-Informative-Priors-for-Clustering-with-Discussion/10.1214/20-BA1197.full

C++ 87.76% Makefile 1.88% Shell 0.96% Perl 0.42% Gnuplot 0.01% Emacs Lisp 0.01% C 7.51% R 1.46%

cplogit's Introduction

Supplementary code for Bayesian linear and logistic regression using Centered Partition processes

Code to reproduce simulation results presented in
Centered Partition Processes: Informative Priors for Clustering (with Discussion)
by Sally Paganin, Amy H. Herring, Andrew F. Olshan, David B. Dunson
Bayesian Analysis. 16(1), 301-370, (March 2021) [ Link | arXiV preprint ]

Installation

Be sure to have installed the following R packages

	install.packages("Rcpp")
	install.packages("RcppArmadillo")
	install.packages("devtools")
	install.packages("ggplot2")
	install.packages("reshape2")
	install.packages("magrittr")
	install.packages("dplyr")
	install.packages("sdols")
	install.packages("mcclust")
	install.packages("mvtnorm")

Download and install the package CPLogit using devtools

library(devtools)
devtools::install_github("salleuska/CPLogit", subdir="CPLogit")

or if you download the repo

## How to install 
library(devtools)
library(Rcpp)
clean_dll()

## to export Rcpp functions
compileAttributes()
build()
install()
document()

Reproduce plots in Section 3.3

To reproduce code of the prior probability distribution over the set partition space induced by the CP process, use script Sec3.3_Prior_graphs.R.

Reproduce simulation results

Simulate data used in the Sec 5.2 and in Sec 1 of the Supplementary Materials

Rscript simulation/0_generateData_linearSimulation.R
Rscript simulation/0_generateData_logisticSimulation.R

Run models and reproduce plots in Sec 5.2 and in Sec 1 of the Supplementary Materials

Rscript simulation/1_linearSimulation.R
Rscript simulation/1_logisticSimulation.R

cplogit's People

Contributors

salleuska avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

amy-herring

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.