Approximates p-values for quadratic forms in normal variables using Liu's moment-matching method.
liu_pvalue(q, lambda)Approximate p-value.
Test statistic (quadratic form value).
Vector of eigenvalues.
This method matches the first four moments of the quadratic form to a chi-square distribution with appropriate degrees of freedom and non-centrality.
Liu, H., Tang, Y., and Zhang, H.H. (2009). A new chi-square approximation to the distribution of non-negative definite quadratic forms in non-central normal variables. Computational Statistics & Data Analysis.