R/mcc.R

Defines functions mcc

mcc <- function(x, y, coeffs){
  y.hat = predicted.y(x, coeffs)
  mean.y.hat = mean(y.hat)
  res.y.hat  = y.hat - mean.y.hat

  mean.y = mean(y)
  res.y = y - mean.y

  numerator = sum(res.y * res.y.hat)

  denominator = sqrt(sum(res.y^2) * sum(res.y.hat^2))

  R = numerator / denominator

  return(R)
}

Try the traj package in your browser

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

traj documentation built on April 14, 2023, 12:39 a.m.