prm.m

% -------------------------------------------------------------------------
% Function: [yp,b,wy,wt,T]=prm(X,y,h,fairct,opt)
% -------------------------------------------------------------------------
% Aim:
% Partial Robust M-regression estimator, PRM
% -------------------------------------------------------------------------
% Input:  
% y, vector (n,1), predictand
% X, matrix (n,p), predictor variables in columns
% h, scalar, the number of components
% fairct, scalar, the tuning constant of the weighting function (default=4)
% opt, string, centering done by L1-median if opt='l1m', or by the
%      coordinatewise median if opt='cm' (default='cm')
% -------------------------------------------------------------------------
% Output:
% yp, vector (n,1), predicted response
% b, vector (p,1), regression coefficients
% wy, vector (n,1), residual weights
% wt, vector (n,1), weights for leverage points
% T, vector (n,h), the scores of the observations in the rows
% -------------------------------------------------------------------------
% WARNING:
% The PRM is not intended for classification, where the initial mean of 
% predictand, y, is equal to 0
% -------------------------------------------------------------------------
% Example:
% [yp,b,wy,wt,T]=prm(x,y,5,4,'cm')
% -------------------------------------------------------------------------
% Reference:
% S. Serneels, C. Croux, P. Filzmoser, P. J. Van Espen,
% Partial Robust M-regression, Chemometrics and Intelligent Laboratory Systems,
% 79 (2005) 55-64
Valid CSS! Valid HTML 4.01!