mix-SQP: sequential quadratic programming for fast maximum-likelihood estimation of mixture proportions
This repository contains code resources to accompany our research paper,
Youngseok Kim, Peter Carbonetto, Matthew Stephens and Mihai Anitescu (2019). A fast algorithm for maximum likelihood estimation of mixture proportions using sequential quadratic programming. arXiv:1806.01412.
We provide code implementing optimization methods for maximum-likelihood estimation of mixture proportions, in particular a fast algorithm based on sequential quadratic programming, which we call "mix-SQP". This method is implemented Julia. For demonstrations of the mix-SQP algorithm and comparisons with other optimization approaches, see here.
For an R implementation of the mix-SQP algorithm, see the mixsqp R package.
If you find a bug, or you have a question or feedback on our work, please post an issue.
Copyright (c) 2017-2019, Youngseok Kim, Peter Carbonetto, Matthew Stephens and Mihai Anitescu.
All source code and software in this repository are made available under the terms of the MIT license. See the LICENSE file for the full text of the license.
If you find any of the source code in this repository useful for your work, please cite our paper. The full citation is given above.
├── data
├── analysis
├── scripts
├── code
├── output
└── docs
-
The
data
directory is where raw and simulated data are stored. -
The
analysis
directory contains Jupyter notebooks illustrating the optimization methods on simulated data sets. The Julia code in these notebooks has been tested in Julia 1.1.1. -
The
scripts
directory contains various Julia and MATLAB scripts implementing some of the numerical experiments described in the paper. It also includes the R scripts to generate plots for the paper. The Julia and MATLAB scripts were tested in Julia 1.1.1 and MATLAB 9.5.0 (2018b). -
The
code
directory contains Julia and MATLAB code implementing the optimization algorithms, as well as other code used in the numerical experiments. -
Results of the demos and numerical experiments are stored in the
output
directory. -
The
docs
directory contains webpages generated from the Jupyter notebooks using the nbconvert program.
To run the first two Julia demos here, follow these steps. Note: If you encounter a problem running the demos, or installing any of the programs, we have recorded information at the bottom of each Jupyter notebook here about the exact setup used to run the Julia code.
-
Install Julia. Note that all the code has been tested in Julia 1.1.1.
-
Install the Distributions, LowRankApprox packages in Julia:
Pkg.add("Distributions") Pkg.add("LowRankApprox")
-
Precompile the packages and load them to make sure that they work:
using Distributions using LowRankApprox
-
Clone or download this git repository on your computer.
-
Work through the first and second demos here. To do this, start up Julia, making sure that the working directory is set to the
analysis
directory inside the git repository. To verify, runreaddir()
in Julia; it should return a list of the Jupyter notebooks such asmixSQP_example.ipynb
. If it does not, then you are in the wrong directory.Alternatively, you may open the mixsqp_example notebook in Jupyter (e.g., Jupyter notebook), and run the code inside Jupyter. This requires Jupyter and the Julia kernel for Jupyter.
The simple setup instructions above will allow you to run the first two examples. If you have successfully run the first two examples, and you would like to try the other demos, follow these additional setup instructions. These additional examples compare performance of different methods, and require additional programs and Julia packages to run.
-
Install R.
-
Install MOSEK.
-
Install the Rmosek package in R (see here for installation instructions).
-
Run this example in R to verify that MOSEK and Rmosek are correctly installed.
-
Install the REBayes package in R:
install.packages("REBayes")
-
Install the Mosek, JuMP and RCall packages in Julia, and precompile the packages to make sure they work:
Pkg.add("Mosek") Pkg.add("JuMP") Pkg.add("RCall") using Mosek using JuMP using RCall
Now try running the other demos listed here.
Run these commands from the analysis
directory to rebuild the
website from the Jupyter notebooks.
jupyter nbconvert --template=../docs/nbconvert.tpl index.ipynb \
mixSQP_example.ipynb low_rank_approximation.ipynb \
mixSQP_REBayes_EM.ipynb ash_computation_time.ipynb \
QPsubproblem.ipynb --output-dir=../docs
This project was developed by Youngseok Kim, Peter Carbonetto, Matthew Stephens and Mihai Anitescu at the University of Chicago.