Minimum distance estimation on regression models with dependent errors and goodness of fit test of errors