R/fastols.R

#' Compute least squares coefficient fast
#' 
#' @params y response vector
#' @params x matrix of covariates
#' @return param parameter vector
fastols <- function (y ,x) { 
  XtX <- crossprod(x) 
  Xty <- crossprod(x, y) 
  return(solve(XtX, Xty)) 
}

Try the LassoNet package in your browser

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

LassoNet documentation built on Jan. 19, 2020, 5:06 p.m.