troppca.linsp {Rtropical} | R Documentation |
Tropical Principal Component Analysis by Tropical Linear Space
Description
Approximate the principal component as a tropical linear space
for a given data matrix and returns the results as an object of class troppca
.
Usage
troppca.linsp(x, pcs = 2, iteration = list(), ncores = 2)
Arguments
x |
a data matrix, of size n x e, with each row an observation vector. e is the dimension of the tropical space |
pcs |
a numeric value indicating the order of principal component. (default: 2) |
iteration |
a list with arguments controlling the iteration of the algorithm.
|
ncores |
a numeric value indicating the number of threads utilized for multi-cored CPUs. (default: 2) |
Value
A list of S3 class "troppca"
, including:
pc |
The principal component as a tropical linear space |
obj |
The tropical PCA objective, the sum of tropical distance from each point to the projection. |
projection |
The projections of all data points. |
type |
The geometry of principal component. |
Examples
library(Rfast)
n <- 100
e <- 10
sig2 <- 1
x <- rbind(rmvnorm(n, mu = c(5, -5, rep(0, e - 2)), sigma = diag(sig2, e)))
troppca_fit <- troppca.linsp(x)