Estimating the covariance matrices of analysis and forecast error in variational dataassimilation