Learn R Programming

NNS (version 11.5)

PM.matrix: Partial Moment Matrix

Description

Builds a list containing all four quadrant partial‑moment matrices (CUPM, DUPM, DLPM, CLPM) plus the overall covariance matrix.

Usage

PM.matrix(LPM_degree, UPM_degree, target, variable, pop_adj, norm = FALSE)

Value

A list with elements $cupm, $dupm, $dlpm, $clpm and $cov.matrix.

Arguments

LPM_degree

numeric; lower partial moment degree (0 = freq, 1 = area).

UPM_degree

numeric; upper partial moment degree (0 = freq, 1 = area).

target

numeric vector; thresholds for each column (defaults to colMeans).

variable

numeric matrix or data.frame.

pop_adj

logical; TRUE adjusts population vs. sample moments.

norm

logical; FALSE (default) if TRUE, each of the four quadrant partial-moment matrices (cupm, dupm, dlpm, clpm) is normalized cell-wise so that their sum at each position is 1. The covariance matrix is then recomputed from those normalized quadrants.

Author

Fred Viole, OVVO Financial Systems

References

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

Examples

Run this code
  set.seed(123)
  A <- cbind(rnorm(100), rnorm(100), rnorm(100))
  PM.matrix(1, 1, NULL, A, TRUE)

Run the code above in your browser using DataLab