Description:
------------

Performs an appropriate selection of indicators from a latent variable probit
model. The goal and methodology are explained in detail in the paper

- Silva, R. (2011) "Thinning measurement models and questionnaire design".
  Advances in Neural Information Processing Systems.

Version 1.0. Written by Ricardo Silva.
London, October 11th 2011

Installation:
------------

This software uses the Gurobi optimization library, which at the time of this
writing is free for academic usage. The URL is:

- http://www.gurobi.com/

The only MATLAB wrapper for it I was aware of at the time of the development 
of this software was the wrapper kindly supported by Wotao Yin, Gurobi MEX

- http://www.convexoptimization.com/wikimization/index.php/Gurobi_Mex:_A_MATLAB_interface_for_Gurobi

You will need to install it too. The version I had support Gurobi 4.02. I'm 
not sure it would work with more recent versions of Gurobi, so consider yourself
warned.

After Gurobi and Gurobi MEX are installed, modify the file "setpath.m" according
to your needs.

Please notice I've already included the function "qscmvnv" by Alan Genz in this package.
The original source is from

- http://www.math.wsu.edu/faculty/genz/software/software.html

Usage:
------

First run "setpath.m". The best way of understanding the software is by examining the
contents of "batch_test_synth.m" and "test_methods.m". This will apply the methods to
synthetic data. It is possible to fully reproduce the synthetic studies in Silva (2011).
For that, do as follows:

> setpath
> batch_generate_sem
> batch_test_synth

This will run all 160 evaluations with the 5 methods discussed in the paper (one of the
methods is a random choice of variables). Randomness is controlled by pre-stored seeds,
which requires the "nips_seed.mat" file found in the "src" directory. THERE ARE SOME
DEFAULT DIRECTORIES IN "batch_generate_sem" THAT WILL NEED TO BE MODIFIED. Please take
notice also of the directory information in "batch_test_synth" to control where log files
will be stored.

BE AWARE RUNNING ALL EXPERIMENTS WILL TAKE DAYS. This is because evaluation is done by
computing posterior expectations, and I am using some reasonably long MCMC chains to do
that. This is the main bottleneck. You might want to shorten the chains, although results
should vary somewhat from the paper. 

In my setup, the log files also took approximately 70 megabytes of storage.

Once all 160 experiments are finished, you can rebuilt the graphs found in Figure 2 of
Silva (2011) by running :

> summarize_batch_test_synth

Make sure directories in this script are coherent with the directories chosen in the other
scripts.

Contact:
--------

Please report any problems, questions and suggestions to:

Ricardo Silva
Department of Statistical Science
University College London
ricardo@stats.ucl.ac.uk
