The daily returns of p assets are independent draws from a multivariate normal distribution with mean zero and an unknown covariance matrix Sigma. In every test case, Sigma is the sum of a low-rank factor component and a diagonal idiosyncratic component, scaled by heterogeneous asset volatilities; the number of factors, the loadings, the idiosyncratic variances and the volatilities are not disclosed and vary between test cases.
You observe n days of returns, with n only slightly larger than p. Estimate Sigma.
The first line contains n and p. Each of the next n lines contains p real numbers, the returns of that day, with at most 6 digits after the decimal point.
p lines of p real numbers: your estimate of Sigma. It must be symmetric and positive definite; otherwise the case scores 0.
Your estimate is scored by Stein's loss against the true covariance,
L(S_hat) = ln det(S_hat) + tr(S_hat^{-1} Sigma),
normalized between two anchors: the diagonal matrix of sample variances scores 0 and the true Sigma scores 1,
score = clip((L(D) - L(S_hat)) / (L(D) - L(Sigma)), 0, 1).
The case score is this value; estimates worse than the diagonal baseline score 0.
30 <= p <= 100
1.2 p <= n <= 3 p