Learn R Programming

TML (version 2.3.0)

pre.pplot.pro: 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)

Value

matrix of points representing projections of the points in D (row vectors) onto S

Arguments

S

matrix of points representing a tropical polytope; rows are the vertices

D

data points in the tropical projective torus

Author

Ruriko Yoshida ryoshida@nps.edu

Examples

Run this code
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)

Run the code above in your browser using DataLab