library(Rdimtools)
#> ** ------------------------------------------------------- **
#> ** Rdimtools
#> ** - Dimension Reduction and Estimation Toolbox
#> **
#> ** Version : 1.0.8 (2021)
#> ** Maintainer : Kisung You (kisungyou@outlook.com)
#> ** Website : https://kisungyou.com/Rdimtools/
#> **
#> ** Please share any bugs or suggestions to the maintainer.
#> ** ------------------------------------------------------- **
#?Rdimtools::do.olpp
## use iris data
data(iris)
set.seed(100)
subid = sample(1:150, 50)
X = as.matrix(iris[subid,1:4])
label = as.factor(iris[subid,5])
## connecting 10% and 25% of data for graph construction each.
output1 <- do.olpp(X,ndim=2,type=c("proportion",0.10))
output2 <- do.olpp(X,ndim=2,type=c("proportion",0.25))
## Is basis orthogonal?
bas1 <- output1$projection
bas2 <- output2$projection
t(bas1) %*% bas1
#> [,1] [,2]
#> [1,] 1.0000000 0.9667698
#> [2,] 0.9667698 1.0000000
t(bas2) %*% bas2
#> [,1] [,2]
#> [1,] 1.000000 0.937701
#> [2,] 0.937701 1.000000
print("both are normal, but neither is orthogonal.")
#> [1] "both are normal, but neither is orthogonal."
Created on 2021-06-28 by the reprex package (v2.0.0)
Created on 2021-06-28 by the reprex package (v2.0.0)