projSimplex | R Documentation |
internal function; project an n-dim vector y to the simplex S_n with sum constrained to 1
projSimplex(y, c = 1)
y |
n-dim vector |
c |
constraint; equals one by default |
simplex S_n with sum constrained to 1
y1 <- c(1,1)
p1 <- projSimplex(y1)
p1
y2 <- c(0.1, 0.3)
p2 <- projSimplex(y2)
p2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.