필터 지우기
필터 지우기

cumulative distribution function

조회 수: 2 (최근 30일)
fatemeh
fatemeh 2015년 5월 9일
편집: Star Strider 2015년 5월 9일
Hi everyone I want to write a formula that includes inverse cumulative distribution function and cumulative distribution function. I'm going to apply this formula on the two matrix called obs and his. These functions should be applied by column to data matrix. I wrote the following code in matlab but I got the wrong results. Some output data were negative. Here is formula link. Would it be possible for direct me. Any suggestions would be appreciated. https://www.dropbox.com/s/2pflf60qrbduh8j/aa.jpg?oref=e&n=71002171
XHIS=zeros(30,12);
his=xlsread('sample data.xls','his','b2:m31'); %his input
obs=xlsread('sample data.xls','obs','b2:m31'); %obs input
for i=1:12
fhis=normcdf(his(:,i),mean(his(:,i)),std(his(:,i))); %cdfhis
hisinv=norminv(fhis,mean(his(:)),std(his(:))); %inversehis
fobs=normcdf(obs(:,i),mean(obs(:,i)),std(obs(:,i))); %cdfobs
obsinv=norminv(fobs,mean(obs(:)),std(obs(:))); %inverseobs
%%%%%%%%%%%%%%%%%%%%%%
outhis =interp1(his(:,i),fhis,his(:,i),'nearest','extrap'); %cdfhis(xhis)
[unifobs,ind]=unique(fobs);
obsinv=obsinv(ind);
XHIS(:,i)=interp1(unifobs,obsinv(:),outhis,'nearest','extrap'); %cdfinverseobs(cdfhis(xhis))
End
Regards

답변 (0개)

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by