SecondOrderLossFunctionIfc

Represents the 2nd order loss function.

Each order of a loss function is the tail accumulation of the order below it, taken in the natural measure for the support:

G2(x) = sum over integers j > x of G1(j)      X discrete
G2(x) = integral from x to infinity of G1(u)   X continuous

Carrying that out gives two different closed forms, and each family uses its own:

G2(x) = (1/2)E[max(X-x,0)*max(X-x-1,0)]        X discrete
G2(x) = (1/2)E[max(X-x,0)^2]                   X continuous

They are not interchangeable. The discrete form carries the extra factor because (X-x)(X-x-1) = (X-x)^2 - (X-x) when X and x are whole numbers, and using the continuous form on a Poisson overstates G2 by half the mean — an error of a few percent in an inventory cost, and of the wrong sign in an optimization.

An implementor uses the form belonging to its own support, and says which in its own KDoc. LossFunctionInvariantsTest checks each against the accumulation relation for its family, which is what keeps this from drifting.

Note that no such split arises at first order: G1(x) = E[max(X-x,0)] is the same expression either way. See FirstOrderLossFunctionIfc.

Author

rossetti

Inheritors

Functions

Link copied to clipboard

Computes the 2nd order loss function for the distribution function for a given value of x: (1/2)Emax(X-x,0)*max(X-x-1,0) when X is discrete, (1/2)Emax(X-x,0)^2 when X is continuous.