R/EOPT.R

Defines functions EOPT

Documented in EOPT

EOPT <-
  function(Train,Test=NULL, P, lambda=1e-5,C=NULL){
    PTrain<-P[rownames(P)%in%Train,]
    if (!is.null(C)){
    svdD<-svd(C%*%solve(crossprod(PTrain)+lambda*diag(ncol(PTrain)), t(C)), nu=0,nv=0)
    } else {
      svdD<-svd(crossprod(PTrain)+lambda*diag(ncol(PTrain)), nu=0,nv=0)
      
    }
    return(max(1/svdD$d))
  }

Try the STPGA package in your browser

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

STPGA documentation built on May 2, 2019, 8:19 a.m.