This function implements the Computation of the test statistic T given in section 3. "Statistical tests" of "Rationalizing Rational Expectations? Tests and Deviations".
T_stat(m_bar, Sigma_bar, prob_weight, N_g, N_k, p)
the moments m_bar for the different instrumental functions h considered
the matrix of all the variances of the moments m_bar for the different instrumental functions h considered
vector of weigths for the test statistic
number of instrumental functions h considered
number of moments
the parameter p in the Statistic.
a real T which is the test statistic