R/dimension_reduction.R

Defines functions dimension_reduction

Documented in dimension_reduction

dimension_reduction <-
function(X) {
    ##eigenvalue decomposition is used to reduce dimension
    
    X <- t(X)
    Xmean <- rowMeans(X)
    Xmeanrm <- X-Xmean  
    r <- eigen(Xmeanrm%*%t(Xmeanrm))
    dimenMatrix <- t(r$vectors[,1:2])
    Xt <- dimenMatrix%*%X
    X <- t(Xt)
    
    dimenreduc <- list(X,dimenMatrix)
    dimenreduc
  }

Try the UNDO package in your browser

Any scripts or data that you put into this service are public.

UNDO documentation built on Nov. 8, 2020, 7:53 p.m.