R/gauss_loss.R

Defines functions gauss_loss

gauss_loss <- function(W, y, sigmaUU, beta){
  n <- nrow(W)
  loss <- numeric(ncol(beta))
  for(i in seq(ncol(beta)))
    loss[i] <- (1/n) * sum( (y - W %*% beta[, i] ) ^2 ) - t(beta[, i]) %*% sigmaUU %*% beta[, i]
  return(loss)

}

Try the hdme package in your browser

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

hdme documentation built on May 31, 2023, 5:44 p.m.