无花果树下

临美两载,春夏秋冬,过红海禅神机; 学道廿年,酸甜苦辣,铸刚韧造灵秀.[
正文

Kormalglov-smirnov Test 克米尔格若夫-斯密尔诺夫检验的应用一例

(2009-12-24 12:48:24) 下一个

cd 'C:Program FilesMATLABR2006awork';
filelist = dir('*.mat');
isis=[];

load('ppplh00.mat')
for n=1:length(trials)
    if (isfield(trials(n).stim,'ontime')&&isfield(trials(n).stim,'changeframe')&& trials(n).changeloc==0) %&& isfield(trials(n).stim, 'offtime')
    if ~isempty(trials(n).saccade) & ~isempty(trials(n).sacend) & trials(n).sacend.azimuth>0
        if sum(find(trials(n).sp))>=2
            spikes=trials(n).sp;
            stimon=trials(n).stim.ontime;
            spikes(find(spikes           
            isi=spikes(2:end)-spikes(1:end-1);
            isis(end+1:end+length(isi)) = isi;
           
        end

    end
    end
end
isis2=sort(isis);
m=round(max(isis2)+1);
b1=0;
b2=b1+1;
for binwidth=1:m;

 
  
      k=find(isis2>b1 & isis2<=b2);
      l=length(k);
      j(binwidth)=l/length(isis2);
      b1=b1+1;
      b2=b2+1;

end
plot(j,'g') 
hold on
x=mean(isis2);
for z=1:m;
    y(z)=exppdf(z,x);
   
end
plot(y,'b')
hold on
 for z=1:m;
    f(z)=poisspdf(z,x);
end
plot(f,'r')

h1=kstest2(j,y,0.05)

 p=j(find(j<0.016));
 q=y(find(y<0.016));
 
 h2=kstest2(p,q,0.05)
  

 

[ 打印 ]
阅读 ()评论 (0)
评论
目前还没有任何评论
登录后才可评论.