⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 da_det1.m

📁 珍藏的遗传算法的matlab程序集
💻 M
字号:
%
% da_det1.m
%
% Prints out a more detailed analysis of the regression
% results.
%
% The results should be contained in two vectors,
% py - the predicted output over the validation set
% vy - the actual value of y over the validation set
%


da_front;
drawnow;

%
% Draw some axes
%
ax1=axes;
set(ax1,...
	'Units','pixels',...
	'Position',[300 200 260 170],...
	'Box','on',...
	'Color',[0 0 0],...
	'Visible','on');

%
% few text objects for later
%
text1=da_text(w1,280,150,300,15,'Mean',[0 1 0],[0 0 0]);
set(text1,'visible','off');
text2=da_text(w1,280,130,300,15,'Standard Deviation',[1 0 0],[0 0 0]);
set(text2,'visible','off');
text3=da_text(w1,330,380,220,15,'Residuals Plot',[1 1 1],[0 0 1]);
set(text3,'visible','off');

text4=uicontrol(w1,...
	'style','text',...
	'position',[30 50 200 170],...
	'string','In order to determine which variable plays an important role in the model move the mouse cursor within the graphs axes, but AWAY from the yellow bars, then click the left button. The cursor will then change to a cross. Position this cross over the bar of interest and click the mouse. The selected variable number will be displayed in the red box beneath the graph',...
	'Backgroundcolor',[0 0 1],...
	'Foregroundcolor',[1 1 1],...
	'Visible','off');
text5=da_text(w1,400,100,150,15,'Variable =',[1 1 1],[1 0 0]);
set(text5,'visible','off');


%
% Buttons for each option
%

but1=uicontrol(w1,...
	'style','push',...
	'position',[30 350 170 20],...
	'string','Plot residuals',...
	'callback',[
		'set(ax1,''visible'',''on'');',...
		'axes(ax1);',...
		'plot(py-vy,''.'');',...
		'[D L]=size(py);',...
		'set(ax1,''Xlim'',[0 D]);',...
		's=std(py-vy);',...
		'a=line([0 D],[s s]);',...
		'set(a,''color'',[1 0 0]);',...
		'a=line([0 D],[-s -s]);',...
		'set(a,''color'',[1 0 0]);',...
		'a=line([0 D],[mean(py-vy) mean(py-vy)]);',...
		'set(a,''color'',[0 1 0]);',...
		'set(text1,''string'',''Mean'',''visible'',''on'');',...
		'set(text2,''string'',''+/-1 Standard deviation'',''visible'',''on'');',...
		'set(text2,''foregroundcolor'',[1 0 0]);',...
		'set(text3,''string'',''Residuals Plot'');',...
		'set(text3,''visible'',''on'');',...
		'set(text4,''visible'',''off'');',...
		'set(text5,''visible'',''off'');',...
		'set(ax1,''ButtondownFcn'','''');',...
		'clear s a;']);

but2=uicontrol(w1,...
	'style','push',...
	'position',[30 300 170 20],...
	'string','Plot Actual -v- Predicted',...
	'callback',[
		'set(ax1,''visible'',''on'');',...
		'axes(ax1);',...
		'plot(vy,py,''.'');',...
		'ma=max(vy);',...
		'mi=min(vy);',...
		'a=line([mi ma],[mi ma]);',...
		'set(a,''color'',[0 1 0]);',...
		'a=line([mi ma],[mi-std(py) ma-std(py)]);',...
		'set(a,''color'',[1 0 0]);',...
		'a=line([mi ma],[mi+std(py) ma+std(py)]);',...
		'set(a,''color'',[1 0 0]);',...
		'clear a mi mn;',...
		'set(text1,''string'',''Predicted = Actual'',''visible'',''on'');',...
		'set(text2,''string'',''+/-1 Standard deviation'',''visible'',''on'');',...
		'set(text3,''string'',''Predicted output -v- Actual output'');',...
		'set(text3,''visible'',''on'');',...
		'set(text4,''visible'',''off'');',...
		'set(ax1,''ButtondownFcn'','''');',...
		'set(text5,''visible'',''off'');',...
		'set(text2,''foregroundcolor'',[1 0 0]);']);


but3=uicontrol(w1,...
	'style','push',...
	'position',[30 250 170 20],...
	'string','Sensitivity Analysis',...
	'CallBack',[
		's=da_sens(impact,data,include_var,output_var,mx,sdx,my,sdy);',...
		'axes(ax1);',...
		'bar(s);',...
		'set(text1,''String'',''Each bar corresponds to the models'');',...
		'set(text2,''string'',''response to a 10% change in each variable'');',...
		'set(text1,''visible'',''on'');',...
		'set(text2,''visible'',''on'');',...
		'set(text3,''string'',''Sensitivity analysis results'');',...
		'set(text3,''visible'',''on'');',...
		'set(text2,''foregroundcolor'',[0 1 0]);',...
		'set(text4,''visible'',''on'');',...
		'set(text5,''visible'',''on'');',...
		'da_det1b;']);




%
% Draw a big frame to the right of these buttons to
% put the results in
%


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -