Estimating the covariance matrix for regression models with ar(1) errors and lagged dependent variables