This function calculates the loss function based on the squared spherical distances between observed values and predicted values on the curve.
This function calculates the loss function based on the squared spherical distances between observed values and predicted values on the curve.