Error Metric and Its Applications