Coder Social home page Coder Social logo

ekstroem / waspr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joliencremers/waspr

0.0 1.0 0.0 227 KB

waspr: an R package for computing Wasserstein barycenters of subset posteriors

License: GNU General Public License v3.0

R 58.91% Stan 6.82% C++ 23.47% TeX 10.80%

waspr's Introduction

waspr

[![Travis build

status](https://travis-ci.com/joliencremers/waspr.svg?branch=master)](https://travis-ci.com/joliencremers/waspr)

The goal of waspr is to compute Wasserstein barycenters of subset posteriors.

Installation

You can install a beta-version of waspr from github with:

# install.packages("devtools")
devtools::install_github("joliencremers/waspr")

Example

This is a basic example which shows you how to compute the Wasserstein barycenter from a set of mcmc outputs for several data subsets. A more extensive explanation of the usage of the package can be found in the Tutorial vignette.

library(waspr)
#> 
#> Attaching package: 'waspr'
#> The following object is masked from 'package:base':
#> 
#>     summary

wasp(pois_logistic,
     par.names = c("beta_s", "alpha_l", "beta_l",
                   "baseline_sigma", "baseline_mu",
                   "correlation", "sigma_s", "sigma_l"))
#> Iteration:1
#> Cost:738.216
#> Iteration:2
#> Cost:738.224
#> Iteration:3
#> Cost:737.835
#> Iteration:4
#> Cost:738.29
#> Iteration:5
#> Cost:738.137
#> Iteration:6
#> Cost:738.614
#> Iteration:7
#> Cost:738.23
#> Iteration:8
#> Cost:738.48
#> Iteration:9
#> Cost:738.36
#> Iteration:10
#> Cost:738.108
#> 
#> 
#> WASP 
#> 
#> Call: 
#> wasp(mcmc = pois_logistic, par.names = c("beta_s", "alpha_l", 
#>     "beta_l", "baseline_sigma", "baseline_mu", "correlation", 
#>     "sigma_s", "sigma_l"))
#> 
#> Swapping algorithm: 
#> iter = 10
#> acc = 0.001
#> 
#> MCMC: 
#> subsets = 8
#> parameters = 8
#> samples = 450
#> 
#> Posterior summary of the Wasserstein Barycenter: 
#>                      mean       mode         sd      LB hpd     UB HPD
#> beta_s          0.5527601  0.5518034 0.10988949  0.36598187  0.7896041
#> alpha_l         2.6811079  2.6959176 0.19199304  2.30380675  3.0295802
#> beta_l          0.7508520  0.7339988 0.21631011  0.37281283  1.1740767
#> baseline_sigma  0.3563222  0.3811609 0.06859910  0.21910807  0.4870079
#> baseline_mu    -0.8008872 -0.7516167 0.10867533 -1.01168299 -0.5944583
#> correlation     0.1732170  0.1392670 0.07437737  0.02824474  0.3059979
#> sigma_s         1.7225455  1.7535499 0.17920847  1.40126462  2.0610585
#> sigma_l         1.2190297  1.2612822 0.07558163  1.06768047  1.3569757

waspr's People

Contributors

joliencremers avatar

Watchers

 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.