These are programs for my Journal of Multivariate Analysis paper 
"On the Moments of Ratio of Quadratic Forms in Normal Random 
Variables" (with Yong Bao).  If you have questions, comments, or bug 
reports, please send them to kan@chass.utoronto.ca

Raymond Kan
Rotman School of Management
University of Toronto

Version 1.0: 2/5/2012, initial release
Version 1.1: 8/15/2016, vectorize qratint.m and qratintnc.m to improve
             speed.
Version 1.2: 1/1/2017, improve qratint.m and qratintnc.m when p is an
             integer.  No longer needs to do eigenvalue decomposition.

Integration approach
qratint.m: Compute E[(z'Az)^p/(z'Bz)^q] for z ~ N(0_n,I_n) using an
           integration approach
qratintnc.m: Compute E[(z'Az)^p/(z'Bz)^q] for z ~ N(mu,I_n) using an
             integration approach

Infinite series approach
qratser.m: Compute E[(z'Az)^p/(z'Bz)^q] for z ~ N(0_n,I_n) using an
           infinite series approach
qratsernc.m: Compute E[(z'Az)^p/(z'Bz)^q] for z ~ N(mu,I_n) using an
             infinite series approach
             
Testing programs:
test1.m: test the relative speed of the two different approaches 
         for computing E[(z'Az)^p/(z'Bz)^q] for a set of p and q's.
test2.m: test the relative speed of the two different approaches 
         for computing E[(z'Az)^p/(z'Bz)^q] for different values of n.
           