LassoObjFn <- function(bbeta, X, y, lambda, stplngth) {
X.beta <- as.vector(X%*%bbeta)
ans <- sum((y - X.beta)*(y - X.beta))/2 + lambda*sum(abs(bbeta))
return(-ans)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.