MATLAB code for mixed-data FA using variational bounds

Back to Home or Software

Written by Emtiyaz, CS, UBC.
Last updated: Dec. 03, 2010.

Description: This matlab code fits a factor analysis model for mixed continuous and discrete dataset using an expectation-maximization (EM) algorithm. The method is based on variational bounds described in our NIPS 2010 paper. This code can be used for latent-factor inference, parameter learning, and missing-value imputation. This implementation handles missing-values in data.

Download: 2010-NIPS-FA-code.zip

System requirements and dependencies: The code works fine on MATLAB 7.4 (2007a) and higher versions. We use some functions from Tom Minka’s lightspeed toolbox for matrix-inversion and matrix-determinant (included in the zip file), but can be replaced by other equivalent functions.

How to use the code: Download and unzip the code. Inside MATLAB, execute the following commands:
   > cd 2010-NIPS-FA-code;
   > addpath(genpath(pwd));
   > demoFA;
See demoFA.m for usage of various functions.

Description of files:

  • demoFA.m runs the demo on Auto-mpg dataset.
  • initMixedDataFA.m initializes the parameters.
  • inferMixedDataFA.m is the inference file (use inferMixedDataFA_missing.m if data contains missing values).
  • maxParamsMixedDataFA.m is the parameter-maximization file.
  • learnEM.m runs EM algorithm given the above three functions.
  • Directory FA contains the corresponding files for continuous data FA, although mixedDataFA code handles only continuous (and only discrete) case as well.

Example: The example file ’demoFA’ runs the mixedDataFA code on Auto-mpg data.