Ridge regression by the Hoerl-Kennard-Baldwin method.
- [b,theta] = ridge(x,y,thetamax,divs,tf)
RIDGE creates a ridge regression model, using a matrix containing the values of multiple predictor variables for a set of samples (x-block) x, and a vector containing the values of a single predictor variable for the same set of samples (y-block) y.
- x = matrix of input data for the predictor variables
- y = vector of input data for the predicted variable
- thetamax = the maximum value of the ridge parameter theta to consider (thetamax > 0).
- divs = the number of values of the ridge parameter between 0 and thetamax to be used for calculating the regression vector shown in the plots
Note: In most instances the optimum ridge parameter will be less than 0.1, often as low as 0.01. A good starting guess when working with the method is to specify thetamax = 0.1 with divs = 20.
- tf = text flag input; allows the user to place the labels on the plot with the mouse when it is set to 1
- b = final regression vector, corresponding to the best guess value for the ridge parameter theta
- theta = best-guess value of the ridge parameter by the Hoerl-Kennard method