Create LossFunction.R