KpNorm

kpNorm is a function that computes the (k,p)-norm of a vector or matrix, defined as follows:
 * $$\|v\|_{k,p} := \left(\sum_{j=1}^k |v_j^{\downarrow}|^p \right)^{1/p}, \quad \|X\|_{k,p} := \left( \sum_{j=1}^k \sigma_j^{\downarrow}(X)^p \right)^{1/p}.$$

In the case of a vector, this is the p-norm of the vector's k largest (in magnitude) entries. In the case of a matrix, this is the p-norm of the vector of its k largest singular values. This norm generalizes many well-known norms including the vector p-norms, the operator norm (when k = 1), the trace norm (when p = 1 and k is the size of X), the Schatten p-norms (when k is the size of X), and the Ky Fan k-norms (when p = 1). It works with both full and sparse vectors and matrices.

Syntax

 * NRM = kpNorm(X,K,P)

Argument descriptions

 * X: A vector or matrix to have its (K,P)-norm computed.
 * K: A positive integer.
 * P: A real number &ge; 1, or Inf.

Generalizes the operator, trace, Ky Fan, and Schatten norms
The (K</tt>,P</tt>)-norm of a matrix is simply the usual operator norm when K = 1</tt> or P = Inf</tt>:

When P = 1</tt> and K</tt> is the size of X</tt>, this norm reduces to the trace norm:

More generally, when P = 1</tt> this norm reduces to the Ky Fan K</tt>-norm:

Similarly, when K = min(size(X))</tt> this norm reduces to the Schatten P</tt>-norm: