⧼exchistory⧽
4 exercise(s) shown, 0 hidden
Jun 24'23

The ridge regression estimator can be viewed as the solution of a constraint estimation problem. Consider the two panels of Figure. Both show the ridge parameter constraint represented by the grey circle around the origin. The left panel also contains an ellopsoid representing a level set of the sum-of-squares centered around the maximum likelihood regression estimate, while the right panel contains a line formed by the solutions of the normal equations. Both panels have four red dots on the boundary of the ridge parameter constraint. Identify for both cases, which of these four dots is (closest to) the ridge regression estimate?

Jun 24'23

Consider the standard linear regression model $Y_i = \mathbf{X}_{i,\ast} \bbeta + \varepsilon_i$ for $i=1, \ldots, n$ and with the $\varepsilon_i$ i.i.d. normally distributed with zero mean and a common variance. The rows of the design matrix $\mathbf{X}$ have two elements, and neither column represents the intercept, but $\mathbf{X}_{\ast, 1} = \mathbf{X}_{\ast, 2}$.

• Suppose an estimator of the regression parameter $\bbeta$ of this model is obtained through the minimization of the sum-of-squares augmented with a ridge penalty, $\| \mathbf{Y} - \mathbf{X} \bbeta \|_2^2 + \lambda \| \bbeta \|_2^2$, in which $\lambda \gt 0$ is the penalty parameter. The minimizer is called the ridge estimator and is denoted by $\hat{\bbeta}(\lambda)$. Show that $[\hat{\bbeta}(\lambda)]_1 = [\hat{\bbeta}(\lambda)]_2$ for all $\lambda \gt 0$.
• The covariates are now related as $\mathbf{X}_{\ast, 1} = - 2 \mathbf{X}_{\ast, 2}$. Data on the response and the covariates are:
[$] \begin{eqnarray*} \{(y_i, x_{i,1}, x_{i,2})\}_{i=1}^6 & = & \{ (1.5, 1.0, -0.5), (1.9, -2.0, 1.0), (-1.6, 1.0, -0.5), \\ & & \, \, \, (0.8, 4.0, -2.0), (0.9, 2.0, -1.0), (\textcolor{white}{-} 0.5, 4.0, -2.0) \}. \end{eqnarray*} [$]
Evaluate the ridge regression estimator for these data with $\lambda = 1$.
• The data are as in part b). Show $\hat{\bbeta}(\lambda+\delta) = (52.5 + \lambda) (52.5 + \lambda + \delta)^{-1} \hat{\bbeta}(\lambda)$ for a fixed $\lambda$ and any $\delta \gt 0$. That is, given the ridge regression estimator evaluated for a particular value of the penalty parameter $\lambda$, the remaining regularization path $\{ \hat{\bbeta}(\lambda + \delta) \}_{\delta \geq 0}$ is known analytically. Hint: Use the singular value decomposition of the design matrix $\mathbf{X}$ and the fact that its largest singular value equals $\sqrt{52.5}$.
• The data are as in part b). Consider the model $Y_i = X_{i,1} \gamma + \varepsilon_i$. The parameter $\gamma$ is estimated through minimization of $\sum_{i=1}^6 (Y_i - X_{i,1} \gamma)^2 + \lambda_{\gamma} \gamma^2$. The perfectly linear relation of the covariates suggests that the regularization paths of the linear predictors $X_{i,1} \hat{\gamma}(\lambda_{\gamma})$ and $\mathbf{X}_{i,\ast} \hat{\bbeta}(\lambda)$ overlap. Find the functional relationship $\lambda_{\gamma} = f(\lambda)$ such that the resulting linear predictor $X_{i,1} \hat{\gamma}(\lambda_{\gamma})$ indeed coincides with that obtained from the estimate evaluated in part b) of this exercise, i.e. $\mathbf{X} \hat{\bbeta}(\lambda)$.
Jun 24'23

Consider the standard linear regression model $Y_i = \mathbf{X}_{i,\ast} \bbeta + \varepsilon_i$ for $i=1, \ldots, n$ and with the $\varepsilon_i$ i.i.d. normally distributed with zero mean and a common variance. Moreover, $\mathbf{X}_{\ast,j} = \mathbf{X}_{\ast,j'}$ for all $j, j'=1, \ldots, p$ and $\sum_{i=1}^n X_{i,j}^2 = 1$. Show that the ridge regression estimator, defined as $\bbeta(\lambda_2) = \arg \min_{\bbeta \in \mathbb{R}^p} \| \mathbf{Y} - \mathbf{X} \bbeta \|_2^2 + \lambda \| \bbeta \|_2^2$ for $\lambda \gt 0$, equals:

[$] \begin{eqnarray*} \hat{\bbeta}(\lambda_2) & = & b [ \lambda^{-1} - p (\lambda^{2}+\lambda p)^{-1} ] \mathbf{1}_p, \end{eqnarray*} [$]

where $b = \mathbf{X}_{\ast,1}^{\top} \mathbf{Y}$. Hint: you may want to use the Sherman-Morrison formula. Let $\mathbf{A}$ and $\mathbf{B}$ be symmetric matrices of the same dimension, with $\mathbf{A}$ invertible and $\mathbf{B}$ of rank one. Moreover, define $g = \mbox{tr}( \mathbf{A}^{-1} \mathbf{B})$. Then: $(\mathbf{A} + \mathbf{B})^{-1} = \mathbf{A}^{-1} - (1+g)^{-1} \mathbf{A}^{-1} \mathbf{B} \mathbf{A}^{-1}$.

Jun 24'23

Consider the linear regression model $\mathbf{Y} = \mathbf{X} \bbeta + \vvarepsilon$, without intercept and $\vvarepsilon \sim \mathcal{N} ( \mathbf{0}_n, \sigma^2 \mathbf{I}_{nn})$, to explain the variation in the response $\mathbf{Y}$ by a linear combination of the columns of the design matrix $\mathbf{X}$. The linear regression model is fitted by means of ridge estimation. The estimator is evaluated directly from its regular expression and a computationally efficient one:

[$] \begin{eqnarray*} \hat{\bbeta}_{\mbox{{\tiny reg}}} (\lambda) & = & (\lambda \mathbf{I}_{pp} + \mathbf{X}^{\top} \mathbf{X})^{-1} \mathbf{X}^{\top} \mathbf{Y}, \\ \hat{\bbeta}_{\mbox{{\tiny eff}}} (\lambda) & = & \lambda^{-1} \mathbf{X}^{\top} \mathbf{Y} - \lambda^{-2} \mathbf{X}^{\top} (\mathbf{I}_{nn} + \lambda^{-1} \mathbf{X} \mathbf{X}^{\top})^{-1} \mathbf{X} \mathbf{X}^{\top} \mathbf{Y}, \end{eqnarray*} [$]

respectively. In the remainder study the computational gain of the latter. Hereto carry out the following instructions:

• Load the R-package microbenchmark [1].
• Generate data. In this fix the sample size at $n=10$, and let the dimension range from $p=10, 20, 30, \ldots, 100$. Sample the elements of the response and the ten design matrices from the standard normal distribution.
• Verify the superior computation time of the latter by means of the microbenchmark-function with default settings. Throughout use the first design matrix and $\lambda=1$. Write the output of the microbenchmark-function to an R-object. It will be a data.frame with two slots expr and time that contain the function calls and the corresponding computation times, respectively. Each call has by default been evaluated a hundred times in random order. Summary statistics of these individual computation times are given when printing the object on the screen.
• Use the crossprod- and tcrossprod-functions to improve the computation times of the evaluation of both $\hat{\bbeta}_{\mbox{{\tiny reg}}} (\lambda)$ and $\hat{\bbeta}_{\mbox{{\tiny eff}}} (\lambda)$ as much as possible.
• Use the microbenchmark-function to evaluate the (average) computation time both $\hat{\bbeta}_{\mbox{{\tiny reg}}} (\lambda)$ and $\hat{\bbeta}_{\mbox{{\tiny eff}}} (\lambda)$ on all ten data sets, i.e. defined by the ten design matrices with different dimensions.
• Plot, for both $\hat{\bbeta}_{\mbox{{\tiny reg}}} (\lambda)$ and $\hat{\bbeta}_{\mbox{{\tiny eff}}} (\lambda)$, the (average) computation time (on the $y$-axis) against the dimension of the ten data sets. Conclude on the computation gain from the plot.
1. Mersmann, O. (2014).microbenchmark: Accurate Timing Functions.R package version 1.4-2