pre.pplot.pro {TML} | R Documentation |
Projections of points onto a tropical triangle
Description
This function produces the a matrix of points projected onto a tropical triangle defined by the column space of a matrix
Usage
pre.pplot.pro(S, D)
Arguments
S |
matrix of points representing a tropical polytope; rows are the vertices |
D |
data points in the tropical projective torus |
Value
matrix of points representing projections of the points in D (row vectors) onto S
Author(s)
Ruriko Yoshida ryoshida@nps.edu
Examples
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)
[Package TML version 2.3.0 Index]