Determination of noise variances for optimality of Kalman filter