R/AOPT.R

Defines functions AOPT

Documented in AOPT

AOPT <-
  function(Train,Test=NULL, P, lambda=1e-5, C=NULL){
    PTrain<-P[rownames(P)%in%Train,]
    if (!is.null(C)){
    D<-mean(diag(C%*%solve(crossprod(PTrain)+lambda*diag(ncol(PTrain)), t(C))))
    }else {
      D<-mean(diag(solve(crossprod(PTrain)+lambda*diag(ncol(PTrain)))))
    }
    
    return(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.