R/pstrLoss.R

######################################################
# a function for calculating the objective function
# associated to the pstr.R file
#
# author: Katrijn Van Deun
# implemented by Zhengguo Gu
#####################################################

pstrLoss <- function(B, Tmat, Target, W){

  DEV <- Tmat %*% B - Target
  wDEV <- W * DEV
  Loss <- sum(wDEV^2)

  return(Loss)
}

Try the RegularizedSCA package in your browser

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

RegularizedSCA documentation built on May 2, 2019, 8:24 a.m.