# How to get Predicted Value in a ridge regression?

How to get Predicted Value from a Ridge regression using closed solution? I know that by applying the

we get the vector of coefficients, but do we do next?

• 0.8 0.6 0.3 0.3
– ak3
Oct 18, 2023 at 10:19

Dot the feature vector with that $$w$$ you’ve calculated (the estimated coefficient vector), same as in OLS.

A linear model posits that each conditional expected value (what you’re trying to predict) is a linear combination of the features.

$$\mathbb E\left[y_i\vert x_i\right] = \sum_j x_{ij}w_j$$

In this notation, $$y_i$$ is the outcome, $$x_i$$ is a vector of features, and $$w$$ is a vector of weights.

Therefore, when you estimate that $$w$$, such as with ordinary least squares or ridge estimation, the sensible way to estimate that conditional expected value (that is, to make a prediction) is to dot the feature vector with the coefficient vector that you’ve just estimated.

• why do you do the transposed?
– ak3
Oct 18, 2023 at 10:34
• @ak3 Otherwise, the matrix multiplication is nonsensical. This is a pretty fundamental concept in the linear algebra underlying linear statistical models, so if you’re shaky on that, you might want to review such topics before jumping into more advanced material.
– Dave
Oct 18, 2023 at 10:37
• but my w is 4*1 and xi is 1*4 if i transpose the xi matrix i will get a 4*1 and then its impossible
– ak3
Oct 18, 2023 at 10:40
• @ak3 Then you’ve already transposed one of the vectors. Perhaps it’s easiest just to write it as a weighted sum. I will edit the notation.
– Dave
Oct 18, 2023 at 10:46