This function generates a univariate upper partial moment for any degree or target.
Arguments
- degree
numeric;
(degree = 0)is frequency,(degree = 1)is area.- target
numeric; Set to
target = mean(variable)for classical equivalences, but does not have to be. Whenexcess_ret = FALSE, this can be a scalar or a vectorized target for the standard partial moment calculation. Whenexcess_ret = TRUE, it is interpreted element-wise as the benchmark/threshold relative tovariable.- variable
a numeric vector. data.frame or list type objects are not permissible.
- excess_ret
logical;
FALSE(default). IfTRUE, switches from the standard vectorized-target partial moment to an element-wise excess-deviation calculation. ForUPM, this computespmax(variable - target, 0)raised todegreeand averaged. In this mode,targetmust have length 1 or the same length asvariable.