PiW: Projection onto the standard simplex

Description Usage Arguments Details Value References Examples

View source: R/method_inspect.R

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

1
PiW(v)

Arguments

v

Input vector

Details

This is an auxiliary function used by the InspectChangepoint package.

Value

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

References

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

Examples

1
2
v <- rnorm(10)
PiW(v)

Tveten/capacc documentation built on Sept. 29, 2021, 5:31 a.m.