crossvalidation.m

% -----------------------------------------------------------------------------
% Function: [RMSECV]=crossvalidation(method,x,y,h,standard,lout,iter,varargin)
% -----------------------------------------------------------------------------
% Aim:
% Cross-Validation procedure includint classical leave-n-out and
% Monte Carlo Cross-Validation
% -----------------------------------------------------------------------------
% Input: 
% method, string, type of the PLS method used: 
%       - 'PLS' classical Partial Least Squares, 
%       - 'PLS-WIM' Partial Least Squares for wide matrices,
%       - 'PLS-SIM' Partial Least Squares for tall matrices,
%       - 'CR' Continuum Regression.
% x, matrix (n,p), predictor matrix 
% y, matrix (n,m), predictand
% h, scalar, number of factors in the model
% standard, scalar, standardization 1/yes or 0/no (only centering)
% lout, scalar, number of observations to be left out in each step
% iter, scalar, number of iterations in Monte Carlo Cross-Validation
% varargin, optional input for Continuum Regression
% -----------------------------------------------------------------------------
% Output:
% RMSECV, vector (1,h), Root Mean Square Error of Cross-Validation 
% -----------------------------------------------------------------------------
% Example:
% [RMSECV]=crossvalidation('PLS-WIM',x,y,10,0,30,100)
% [RMSECV]=crossvalidation('CR',x,y,10,0,5,[],[.1 2 10]), where power it is 
% a scalar, for 0 - MLR; .25, .5, 1 - PLS; 2, 4, and inf - PCR
% -----------------------------------------------------------------------------
% References:
% [1] K. Baumann, H. Albert, M. von Korff, A systematic evaluation of the 
% benefits and hazards of variable selection in latent variable regression. 
% Part I. Search algorithm, theory and simulations, Journal of Chemometrics 
% 16 (2002) 339-350
% [2] K. Baumann, H. Albert, M. von Korff, A systematic evaluation of the 
% benefits and hazards of variable selection in latent variable regression. 
% Part II. Practical applications, Journal of Chemometrics 16 (2002) 351-360
% [3] Q.-S. Xu, Y.-Z. Liang, Monte Carlo calidation, Chemometrics and
% Intelligent Laboratory Systems 56 (2001) 1-11
Valid CSS! Valid HTML 4.01!