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)
}
ZhengguoGu/RegularizedSCA documentation built on July 4, 2019, 2:46 p.m.