lrCostFunction