tropproj.linsp: Projection on Tropical Linear Space

Description Usage Arguments Value Examples

View source: R/troproj.linsp.R

Description

Compute projection of data points on a given tropical linear space.

Usage

1

Arguments

x

a data matrix, of size n x e, with each row an observation.

V

a data matrix, of dimension s x e, with each row a basis of tropical linear space. e is the dimension of the tropical space and s is the dimension of the linear space.

Value

A matrix of projections of all data points.

Examples

1
2
3
4
5
6
7
8
9
library(Rfast)
n <- 100
e <- 10
sig2 <- 1
s <- 3
x <- rbind(rmvnorm(n, mu = c(5, -5, rep(0, e - 2)), sigma = diag(sig2, e)))
V <- matrix(runif(s * e, -10, 10), nrow = s, ncol = e)
x_proj <- tropproj.linsp(x, V)
head(x_proj)

Rtropical documentation built on Nov. 10, 2021, 1:07 a.m.