Info
此问题已关闭。 请重新打开它进行编辑或回答。
Please help me to translate this code in to R language. I want to find out critical values for lag 10, 20 and 30. I have attached the matlab code.
1 次查看(过去 30 天)
显示 更早的评论
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% FUNCTION quantileQmax(L,p,iprob) %
% computes quantiles of statistic Qmax at level 1-alpha %
% when max autocorrelation is at lag p %
% and the largest computed lag is L %
% probability levels: iprob=1 alpha=0.10 %
% iprob=2 alpha=0.01 %
% any other iprob: alpha=0.05 %
% %
% Matlab functions required: fzero, chi2inv %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function qqq= quantileQmax(L,p,iprob)
if iprob==1
alpha=0.1;
elseif iprob==2
alpha=0.01;
else
alpha=0.05;
end
x0=chi2inv(1-alpha,p);
qqq=fzero(@(x)(qnoncondp(x,p,L)-1+alpha),x0);
end
0 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!