Learn R Programming

NNS (version 11.5)

LPM.ratio: Lower Partial Moment Ratio

Description

This function generates a standardized univariate lower partial moment of any non‑negative degree for a given target.

Usage

LPM.ratio(degree, target, variable)

Value

Numeric vector of standardized lower partial moments.

Arguments

degree

numeric; degree = 0 gives frequency (CDF), degree = 1 gives area.

target

numeric vector; threshold(s). Defaults to mean(variable).

variable

numeric vector or data‑frame column to evaluate.

Author

Fred Viole, OVVO Financial Systems

References

Viole, F. & Nawrocki, D. (2013) *Nonlinear Nonparametric Statistics: Using Partial Moments* (ISBN:1490523995)

Viole, F. (2017) Continuous CDFs and ANOVA with NNS. tools:::Rd_expr_doi("10.2139/ssrn.3007373")

Examples

Run this code
  set.seed(123)
  x <- rnorm(100)
  LPM.ratio(0, mean(x), x)
if (FALSE) {
  plot(sort(x), LPM.ratio(0, sort(x), x))
  plot(sort(x), LPM.ratio(1, sort(x), x))
}

Run the code above in your browser using DataLab