Calculating the Density and Distribution Function of a Singly and Doubly Noncentral F Random Variable
AbstractA number of test statistics arising in econometrics can be expressed as a weighted ratio of quadratic forms in normal variables (ROQNV), but tractable expressions for computing their pdf and cdf do not exist. A numerical method for evaluating the cdf is given in Imhof (1961) but has the drawbacks of being slow and possibly failing in the tails. A practical, numerically sound method for calculating the exact pdf does not exist. In this paper, we derive second-order saddlepoint approximations to both the pdf and cdf of a ROQNV and examine their behavior in the special cases of the singly and doubly noncentral F distribution. This distribution arises quite often in the analysis of linear models, most notably in the calculation of the power of tests of linear hypotheses. Most often, it is the singly noncentral F that is relevant. However, numerous examples exist where the doubly noncentral case is required, for example, in power calculations for ANOVA designs with interaction or bias effects, two-way cross classification ANOVA, testing in linear models with proxy variables---a common occurrence in econometric applications, and also in signal processing and pattern recognition applications. We show that our proposed method is not only precise (over the entire support of the distribution including the tails), but also leads to simple, closed-form expressions for the pdf and cdf that are computationally easy to implement, numerically sound, and several thousand times faster than the Imhof method. We also show several examples where the latter method fails and compare the saddlepoint approximation to alternative specialized algorithms made for the singly and doubly noncentral F distribution, pointing out some mistakes in popular software packages such as SAS, GAUSS and MATLAB.