A data vendor delivers a panel of daily returns for n assets over T days, but some entries are missing. The returns were generated by a factor model with k factors:
r_it = b_i^T f_t + eps_it
where b_i is the loading vector of asset i, f_t is the factor vector on day t, and eps_it ~ N(0, sigma_i^2) is independent noise with an asset-specific variance. The number of factors k is given; the loadings, the factors and the noise variances are not disclosed and vary between test cases.
Fill in the missing entries.
The first line contains n, T and k. Each of the next n lines contains T values, the returns of one asset over the T days: either a real number with 8 digits after the decimal point, or the token NA for a missing entry.
One real number per missing entry: your prediction of that return. Print them in row-major order, i.e. all missing entries of asset 1 from left to right, then those of asset 2, and so on.
A prediction y for the missing entry (i, t) is scored by its predictive efficiency
s_it = sigma_i^2 / (sigma_i^2 + (y - b_i^T f_t)^2)
the ratio of the expected squared error of the optimal prediction to yours. The case score is the mean of s_it over the missing entries. Note that b_i . f_t is the signal part of the return, without the noise, so a score of 1.0 requires the exact loadings and factors.
40 <= n <= 60
150 <= T <= 250
2 <= k <= 5
Between 10% and 20% of the entries are missing. Every asset and every day has at least k + 5 observed entries.