無花果樹下

臨美兩載,春夏秋冬,過紅海禪神機; 學道廿年,酸甜苦辣,鑄剛韌造靈秀.[
正文

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)
評論
目前還沒有任何評論
登錄後才可評論.