R/predicted.y.R

Defines functions predicted.y

 
predicted.y <- function(data, coeffs)
{

  num.coeffs = length(coeffs)

  pred = NULL

  for(i_data in 1:nrow(data))
  {
    y = coeffs[1] + sum(data[i_data,] * coeffs[-1])
    pred = c(pred , y)
  }

  return(as.numeric(pred))
}

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.