error_funs function

Estimate model error