Learn R Programming

InspectChangepoint (version 1.2)

PiW: Projection onto the standard simplex

Description

The input vector is projected onto the standard simplex, i.e. the set of vectors of the same length as the input vector with non-negative entries that sum to 1.

Usage

PiW(v)

Arguments

v

Input vector

Value

A vector in the standard simplex that is closest to the input vector is returned.

Details

This is an auxiliary function used by the InspectChangepoint package.

References

Chen, Y. and Ye, X. (2011) Projection onto a simplex. arXiv preprint, arxiv:1101.6081.

Examples

Run this code
# NOT RUN {
v <- rnorm(10)
PiW(v)
# }

Run the code above in your browser using DataLab