www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xregMdlGui/@rbfprune/drawResiduals.m

    function drawResiduals(h)
%DRAWRESIDUALS

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


graph2d = h.Graph2d;
% This gets the standard statistics
p= h.ptrMdev;
m = p.model;
X = p.getdata('X');
Y = p.getdata('Y');
[x,y] = checkdata(m,X,Y);

ncenters = h.NCenters;
centers = get(m,'centers');
maxncenters = size(centers(Terms(m),:),1);

TermsIn = Terms(m);
indices = fliplr(find(TermsIn)');
[m,OK] = stepwise(m,indices(1:maxncenters-ncenters));%toggle the state and get the fit 
m = setFitOpt(m,'cost',log10GCV(m));

% Get the model statistics ...
[data,factors,standardPlotStr,olIndex]= diagnosticStats(m,X,Y);

% and plot on the graph2d object
set(graph2d,'data',data,...
   'factors',factors,...
   'limits',repmat({'auto'},1,size(data,2)));

% reset the model
[m,OK] = stepwise(m,indices(1:maxncenters-ncenters));