Crcvrnd: Difference between revisions
Jump to navigation
Jump to search
imported>Jeremy No edit summary |
imported>Jeremy No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
===Synopsis=== | ===Synopsis=== | ||
:[press,fiterr,minlvp,b] = crcvrnd(x,y, | :[press,fiterr,minlvp,b] = crcvrnd(x,y,split,iter,lv,powers,''ss'',''mc'') | ||
===Description=== | ===Description=== | ||
crcvrnd is used to cross-validate continuum regression models | crcvrnd is used to cross-validate continuum regression models. | ||
====Inputs==== | |||
* '''x''' = a matrix of predictor variables (x-block) | |||
* '''y''' = matrix or vector of predicted variables (y-block) | |||
* '''split''' = the number of divisions into which to split the data | |||
* '''iter''' = the number of iterations of the cross-validation procedure using different re-orderings of the data set | |||
* '''lv''' = maximum number of latent variables | |||
* '''powers''' = the row vector of continuum regression parameters to consider | |||
====Optional Inputs==== | |||
* '''ss''' = causes the routine to choose contiguous blocks of data during cross-validation when set to 1 (default is 0) | |||
* '''mc''' = when set to 0 the subsets are not mean-centered during cross-validation (default is 1) | |||
====Outputs==== | |||
* '''press''' = the predictive residual error sum of squares where each element of the matrix represents the PRESS for a given combination of LVs and continuum parameter | |||
* '''fiterr''' = the corresponding fit error | |||
* '''minlvp''' = the number of LVs and power at minimum PRESS | |||
* '''b''' = the final regression vector or matrix | |||
A good smooth PRESS surface can usually be obtained by calculating about 20 models spaced logarithmically between 4 and 1/4 and using 10 to 30 iterations of the cross-validation. A good rule of thumb for dividing the data is to use either the square root of the number of samples or 10, which ever is smaller. | A good smooth PRESS surface can usually be obtained by calculating about 20 models spaced logarithmically between 4 and 1/4 and using 10 to 30 iterations of the cross-validation. A good rule of thumb for dividing the data is to use either the square root of the number of samples or 10, which ever is smaller. |
Latest revision as of 11:56, 22 February 2013
Purpose
Cross-validation for continuum regression models using SDEP.
Synopsis
- [press,fiterr,minlvp,b] = crcvrnd(x,y,split,iter,lv,powers,ss,mc)
Description
crcvrnd is used to cross-validate continuum regression models.
Inputs
- x = a matrix of predictor variables (x-block)
- y = matrix or vector of predicted variables (y-block)
- split = the number of divisions into which to split the data
- iter = the number of iterations of the cross-validation procedure using different re-orderings of the data set
- lv = maximum number of latent variables
- powers = the row vector of continuum regression parameters to consider
Optional Inputs
- ss = causes the routine to choose contiguous blocks of data during cross-validation when set to 1 (default is 0)
- mc = when set to 0 the subsets are not mean-centered during cross-validation (default is 1)
Outputs
- press = the predictive residual error sum of squares where each element of the matrix represents the PRESS for a given combination of LVs and continuum parameter
- fiterr = the corresponding fit error
- minlvp = the number of LVs and power at minimum PRESS
- b = the final regression vector or matrix
A good smooth PRESS surface can usually be obtained by calculating about 20 models spaced logarithmically between 4 and 1/4 and using 10 to 30 iterations of the cross-validation. A good rule of thumb for dividing the data is to use either the square root of the number of samples or 10, which ever is smaller.