FWpoint.num.w.reg {TML} | R Documentation |
Modified Fermat-Weber point numerical solver for ultrametrics
Description
Returns a modified Fermat-Weber point of N points using a gradient based numerical method This method is appropriate for points coming from ultrametrics. The algorithm tries to find a point that minimizes the sum of tropical distances from the samples, but also also tries to find a point that is as close as possible to the space of ultrametrics. The tradeoff between these two objectives is controlled by the penalty parameter. If penalty=0, the method is identical to FWpoint_numerical; it finds the Fermat-Weber point, which may not be an ultrametric. If penalty is very large, the algorithm is trying to find the Fermat-Weber point in the space of ultrametrics.
Usage
FWpoint.num.w.reg(datamatrix, penalty = 0)
Arguments
datamatrix |
matrix of dimension N*e, where N is the number of observations which lie in R^e |
penalty |
positive real number; the regularization rate |
Value
vector; Fermat-Weber point approximation
Author(s)
Georgios Aliatimis g.aliatimis@lancaster.ac.uk
References
Aliatimis, Georgios, Ruriko Yoshida, Burak Boyaci and James A. Grant (2023). Tropical Logistic Regression on Space of Phylogenetic Trees
Examples
D = matrix(c(0,0,0,0,2,5,0,3,1),3,3,TRUE)
FWpoint.num.w.reg(D,1e4) # (0,2,5/3) not ultrametric
FWpoint.num.w.reg(D,1e4) # (0,5/3,5/3) ultrametric