www.gusucode.com > mbctools 工具箱 matlab 源码程序 > mbctools/@mdev_local/rmse_explorer.m

    function [factors,data] = rmse_explorer(mdev)
%RMSE_EXPLORER Create RMSE explorer GUI
%
%  [factors,data] = rmse_explorer(mdev) returns data for RMSE plots.

%  Copyright 2000-2015 The MathWorks, Inc. and Ford Global Technologies, Inc.


% local
df= mdev.MLE.df;

OK= mdev.FitOK;
RMSE = NaN(length(OK),1);
df(df==0)=1;
RMSE(OK)= sqrt(mdev.MLE.SSE_nat(OK)./df(OK));


factors = {'Test Number','RMSE'};
R= [ (1:length(RMSE))', RMSE];


if isfield(mdev.MLE,'ValRMSE') && ~all(isnan(mdev.MLE.ValRMSE))
    % Add Validation RMSE
    factors = [factors {'Validation RMSE'}];
    R = [R mdev.MLE.ValRMSE(:)];
end

TS = BestModel(mdev);
if ~isempty(TS) && isfield(mdev.TSstatistics,'RMSE') && ...
        size(mdev.TSstatistics.RMSE,2)<=2
   % add two-stage RMSE
    factors = [factors {'Two-stage RMSE'}];
    if mle_best(mdev) &&  size(mdev.TSstatistics.RMSE,2)==2
        TSRMSE = mdev.TSstatistics.RMSE(:,2);
    else
        TSRMSE = mdev.TSstatistics.RMSE(:,1);
    end
    R = [R TSRMSE(:)];

end

% add Response Feature RMSE
rfnames=children(mdev,'name');
if RFstart(model(mdev))
    % remove datum
    rfnames(1) = [];
end
for i=1:length(rfnames);
    rfnames{i}= ['s_',lower(rfnames{i})];
end
st = size(R,2);
R= [R zeros(size(R,1),size(mdev.MLE.Sigma,1))];
for i=1:size(mdev.MLE.Sigma,1)
    r= squeeze(sqrt(mdev.MLE.Sigma(i,i,:))).*RMSE; % *Pooled_RMSE;
    R(:,st+i)= r(:);
end

X= getdata(mdev,'FIT');
Xg= X{2};
R= [ R,double(Xg)];


factors = [factors,rfnames,get(Xg,'Name')'];
data = R;