function X = chisquare_inv(P,V);
%CHISQUARE_INV Inverse of chi-square cumulative distribution function (cdf).
%
% X = chisquare_inv(P,V) returns the inverse of chi-square cdf with V
% degrees of freedom at fraction P.
% This means that P*100 percent of the distribution lies between 0 and X.
%
% To check, the answer should satisfy: P==gammainc(X/2,V/2)
% Uses FMIN and CHISQUARE_SOLVE
%
% Written January 1998 by C. Torrence
if (nargin < 2), error('Must input both P and V');, end
if ((1-P) < 1E-4), error('P must be < 0.9999');, end
if ((P==0.95) & (V==2)) % this is a no-brainer
X = 5.9915;
return
end
MINN = 0.01; % hopefully this is small enough
MAXX = 1; % actually starts at 10 (see while loop below)
X = 1;
TOLERANCE = 1E-4; % this should be accurate enough
vers = version;
vers = str2num(vers(1));
while ((X+TOLERANCE) >= MAXX) % should only need to loop thru once
MAXX = MAXX*10.;
% this calculates value for X, NORMALIZED by V
% Note: We need two different versions, depending upon the version of Matlab.
if (vers >= 6)
X = fminbnd('chisquare_solve',MINN,MAXX,optimset('TolX',TOLERANCE),P,V);
else
X = fmin('chisquare_solve',MINN,MAXX,[0,TOLERANCE],P,V);
end
MINN = MAXX;
end
X = X*V; % put back in the goofy V factor
return
% end of code
没有合适的资源?快使用搜索试试~ 我知道了~
chisquare_inv.rar_chisquare _continous wavelet
共1个文件
m:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 18 浏览量
2022-07-15
18:01:31
上传
评论
收藏 863B RAR 举报
温馨提示
inverse of continous wavelet, using matlab example files
资源推荐
资源详情
资源评论
收起资源包目录
chisquare_inv.rar (1个子文件)
chisquare_inv.m 1KB
共 1 条
- 1
资源评论
我虽横行却不霸道
- 粉丝: 75
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功