compute forecast error covariance matrix
B = (1/(N-1))*(uai-ua[:,k+1].reshape(-1,1))@(uai-ua[:,k+1].reshape(-1,1)).T
if (km<nt_m) and (k+1==ind_m[km]):