Write a function that requires three inputs, namely, y (a T vector), X (a (T K)
Question:
Write a function that requires three inputs, namely, y (a T vector), X (a
(T × K) matrix), and lambda and then returns the Ridge estimator (a K vector) for a given penalization parameter λ. Recall that the intercept should not be penalized. Therefore, your function should indicate whether X contains a vector of ones as the first column, which should be exempt from the L2 penalty.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Tidy Finance With R
ISBN: 9781032389349
1st Edition
Authors: Christoph Scheuch, Stefan Voigt, Patrick Weiss
Question Posted: