{ # Add a column of 1s for the intercept X = cbind(1, X)
# Linear predictor mu = X %*% par
# Calculate the sum squared error error = sum((y – mu)^2)
# Add the penalty term value = error + lambda * sum(par^2)
return(value) }
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Save my name, email, and website in this browser for the next time I comment.
Δ
Leave a Reply