Ridgecv: Difference between revisions
Jump to navigation
Jump to search
imported>Chuck No edit summary |
imported>Chuck No edit summary |
||
Line 9: | Line 9: | ||
===Description=== | ===Description=== | ||
This function calculates a ridge regression model using a matching set of predictor variables (x-block) <tt>x</tt> and predicted variables (y-block) y, and uses cross-validation to determine the optimum value of the ridge parameter <tt>theta</tt>. The maximum value of the ridge parameter to consider is given by <tt>thetamax</tt> (where 0 < thetamax). | This function calculates a ridge regression model using a matching set of predictor variables (x-block) <tt>x</tt> and predicted variables (y-block) <tt>y</tt>, and uses cross-validation to determine the optimum value of the ridge parameter <tt>theta</tt>. The maximum value of the ridge parameter to consider is given by <tt>thetamax</tt> (where 0 < thetamax). | ||
====Inputs==== | ====Inputs==== | ||
Line 15: | Line 15: | ||
* '''x''' = matrix of independent variables | * '''x''' = matrix of independent variables | ||
* '''y''' = matching vector of dependent variables | * '''y''' = matching vector of dependent variables | ||
* '''thetamax''' = maximum value of | * '''thetamax''' = maximum value of ridge parameter <tt>theta</tt> to consider | ||
* '''divs''' = the number of values of <tt>theta</tt> to test | * '''divs''' = the number of values of <tt>theta</tt> to test | ||
* '''split''' = the number of times to split and test the data for cross-validation | * '''split''' = the number of times to split and test the data for cross-validation |
Revision as of 11:36, 9 October 2008
Purpose
Ridge regression with cross validation.
Synopsis
- [b,theta,cumpress] = ridge(x,y,thetamax,divs,split)
Description
This function calculates a ridge regression model using a matching set of predictor variables (x-block) x and predicted variables (y-block) y, and uses cross-validation to determine the optimum value of the ridge parameter theta. The maximum value of the ridge parameter to consider is given by thetamax (where 0 < thetamax).
Inputs
- x = matrix of independent variables
- y = matching vector of dependent variables
- thetamax = maximum value of ridge parameter theta to consider
- divs = the number of values of theta to test
- split = the number of times to split and test the data for cross-validation
Outputs
- b = the regression column vector, at the optimal ridge parameter value
- theta = the optimal ridge parameter value
- cumpress = Predicted Residual Sum of Squares (PRESS) statistics for the cross-validation
Note: RIDGECV uses the venetian blinds cross-validation method.