cumulative distribution function
显示 更早的评论
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 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Noncentral t Distribution 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!