lrCostFunction.m