Compute the covariance matrix of \(M\) and \(S^2\) (S-squared) given \(q_\mathrm{min}\). Define the vector of four moment expectations
$$E_{i\in 1,2,3,4} = \Psi\bigl(\Phi^{(-1)}(q_\mathrm{min}), i\bigr)\mbox{,}$$
where \(\Psi(a,b)\) is the gtmoms
function and \(\Phi^{(-1)}\) is the inverse of the standard normal distribution. Using these \(E\), define a vector \(C_{i\in 1,2,3,4}\) as a system of nonlinear combinations:
$$C_1 = E_1\mbox{,}$$
$$C_2 = E_2 - E_1^2\mbox{,}$$
$$C_3 = E_3 - 3E_2E_1 + 2E_1^3\mbox{, and}$$
$$C_4 = E_4 - 4E_3E_1 + 6E_2E_1^2 - 3E_1^4\mbox{.}$$
Given \(k = n - r\) from the arguments of this function, compute the symmetrical covariance matrix \(COV\) with variance of \(M\) as
$$COV_{1,1} = C_2/k\mbox{,}$$
the covariance between \(M\) and \(S^2\) as
$$COV_{1,2} = COV_{2,1} = \frac{C_3}{\sqrt{k(k-1)}}\mbox{, and}$$
the variance of \(S^2\) as
$$COV_{2,2} = \frac{C_4 - C_2^2}{k} + \frac{2C_2^2}{k(k-1)}\mbox{.}$$