Calculating the moments of a loss function

In this post I describe how to calculate the first and second moments of a loss function for a machine learning (ML) model. The expected value of a loss function is known as its risk, and I refer to the second central moment as the loss variance. While these quantities are not perfectly knowable in the real world, in the simulation setting the researcher has full knowledge of how data is generated…