/Mposterior

Median Posterior

Primary LanguageR

  • Organization

    • There are two directories, one for the simulation (simulation) and the other for the real data (gss).
    • Each directory has three sub directories: code, data, and qsub.
    • Directory 'code' has files of all the code (Matlab and R source code) that were used in the experiments.
    • Directory 'data' has (if any) simulated/real data that were used in the experiments.
    • Directory 'qsub' has SGE files (.q) that were used to submit jobs on a SGE cluster.
  • Simulation files

    • 'simulate_data.R' contains the code to simulate/partition the data.
    • 'analyze_result.R' contains the code for analyzing the results of MCMC, Mposterior, and competing methods and making plots/tables.
    • 'mcmc_sampler.R' contains the code for the known/standard MCMC/Gibbs sampler for the model.
    • 'wasp_sampler.R' contains the code for the MCMC/Gibbs sampler of a subset posterior distribution. This is a modified version of the code in 'mcmc_sampler.R' using stochastic approximation.
    • 'comp_sampler.R' contains the code for the MCMC/Gibbs sampler of a subset posterior distribution in Consensus Monte Carlo (CMC) or Semiparametric Density Product (SDP). This is a modified version of the code in 'mcmc_sampler.R' by raising the prior to a power of '1/k', where 'k' is the number of subsets.
    • 'variational_bayes.R' contains the code for the variational Bayes approach.
    • 'submit.R' contains the code for the R code for submitting a job on the cluster. The files in 'qsub' directory use this file for running simulations.
  • GSS files

    • 'analyze_result.R' contains the code for analyzing the results of MCMC, Mposterior, and competing methods and making plots/tables.
    • 'create_data.R' contains the code to import/partition the data.
    • 'obtain_samples.m' contains the code to convert Matlab output to csv files that can be imported in R.
    • 'obtain_subset_samples.R' contains the code to obtain marginal and 2-D joint distributions.
    • 'parafac_dx_full.m' and 'parafac_dx_sub.m' are the full and subset posterior DX samplers.
    • 'submit.R' contains the R code for submitting a job on the cluster. The files in 'qsub' directory use this file for running simulations.
    • 'submit_parafac_(full|sub10|sub20).m' contains the Matlab code for submitting full and subset DX samplers on the cluster. The files in 'qsub' directory use this file for running simulations.
  • Citation: If you use the code, then please cite the following two papers:

    • S. Minsker, S. Srivastava, L. Lin, D. B. Dunson (2017) Robust and scalable Bayes via a median of subset posterior measures, Journal of Machine Learning Research, 18 (1), 4488-4527.
    • S. Minsker, S. Srivastava, L. Lin, D. B. Dunson (2014) Scalable and robust Bayesian inference via the median posterior. International Conference on Machine Learning, 1656-1664.
  • Contact: Please email Sanvesh Srivastava (sanvesh-srivastava@uiowa.edu) if you have any questions related to the code.

  • Acknowledgment

    • Please email us if you think that we have missed citations to your paper/work.