err.m

% ------------------------------------------------------------------------
% Function: [RMS,RMSEP]=err(ym,ymp,yt,ytp)
% ------------------------------------------------------------------------
% Aim:
% Computing Root Mean Squared Error and Root Mean Squared Error of
% Prediciton
% -------------------------------------------------------------------------
% Input:  
% ym, vector (n,1), response for model set
% ymp, vector (n,1), predicted response for model set
% yt, vector (n1,1), response for test set (optionally)
% ytp, vector (n1,1), predicted response for test set (optionally)
% -------------------------------------------------------------------------
% Output:
% RMS, scalar (1,1), Root Mean Squared Error (for model set)
% RMSEP, scalar (1,1), Root Mean Squared Error of Predition 
%                      (for test set if available)
% -------------------------------------------------------------------------
% Example:
% [RMS,RMSEP]=err(ym,ymp,yt,ytp)
Valid CSS! Valid HTML 4.01!