The goal of waspr is to compute Wasserstein barycenters of subset posteriors.
You can install a beta-version of waspr from github with:
# install.packages("devtools")
devtools::install_github("joliencremers/waspr")
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