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

📄 prob_ga.m

📁 wang xiao ping 版遗传算法
💻 M
字号:
% Script file for calculating the probability of a certain input
% appearing in a member of the population. For analysing the output of 
% auto_ga.
%
% Run ver_ga first to generate win_pop and num_inp run_num.
%

[Q1,R1]=size(suc_pop);

count=zeros(num_inp,1);

for i=1:Q1,
   for j=1:num_inp,
      eval(['xx=''u' num2str(j) ''';'])
      I=findstr(suc_pop(i,:),xx);
      if any(I)==1,
         count(j)=count(j)+1;
      end
   end
end

prob_inp=count/length(I_tol);

%
% Use binomial distribution to calculate error bounds on the probabilities
%

% Set confidence level
conf_level = 0.95;
alpha=1-conf_level;

   
options=foptions;
%options(1)=1;
%for i=1:num_inp,
%
%   U(i)=fmin('prob_uf',prob_inp(i),1,options,count(i),run_num,alpha);
%   L(i)=fmin('prob_lf',0,prob_inp(i),options,count(i),run_num,alpha);
%
%end
%
 

%
% F-Test to select models "not significantly worse" than the "best" one.
%

% Note: Needs to be set depending on the number of points.
%F_alpha=1.61  % For 50 points
F_alpha=1.41; % For 100 points
%F_alpha=1.35  % For 120 points

%F_alpha=1.455 % For 50 points if alpha=0.1 (ie. 90% sure)
%F_alpha=1.26   % For 120 points

F=SDR_v(I_tol).^2/(min(SDR_v(I_tol)).^2)
I_suc=find(F<=F_alpha)

⌨️ 快捷键说明

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