mad.m

% -------------------------------------------------------------------------
% Function: m=mad(X)
% -------------------------------------------------------------------------
% Aim:
% Computing the Median Absolute Deviation of X (includes correction
% for consistency)
% -------------------------------------------------------------------------
% Input:  
% X, matrix (n,p), data
% -------------------------------------------------------------------------
% Output: 
% m, vector (1,p), containing the median absolute deviation of columns in X
% -------------------------------------------------------------------------
% Example:
% m=mad(X)
% -------------------------------------------------------------------------
% Reference:
% P.J. Rousseeuw, C. Croux, Alternatives to the median absolute deviation, 
% Journal of American Statististical Association 88 (1993) 1273-1283
Valid CSS! Valid HTML 4.01!