pre.pplot.pro | R Documentation |
This function produces the a matrix of points projected onto a tropical triangle defined by the column space of a matrix
pre.pplot.pro(S, D)
S |
matrix of points representing a tropical polytope; rows are the vertices |
D |
data points in the tropical projective torus |
matrix of points representing projections of the points in D (row vectors) onto S
Ruriko Yoshida ryoshida@nps.edu
s <- 3 #number of vertices. Here it is a tropical triangle
d <- 3 ## dimension
N <- 100 ## sample size
D <- matrix(rep(0, N*d), N, d)
D[, 1] <- rnorm(N, mean = 5, sd = 5)
D[, 2] <- rnorm(N, mean = -5, sd = 5)
D[, 3] <- rnorm(N, mean = 0, sd = 5)
index <- sample(1:N, s)
S <- D[index,]
DD <- pre.pplot.pro(S, D)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.