0001
0002
0003
0004
0005
0006
0007
0008
0009 disp('---- determine lower bounds delta for non-central chi-distribution ----')
0010
0011
0012
0013
0014 alphas = [0.003:-0.00005:0.002];
0015 Nalpha = length(alphas);
0016
0017
0018 betas = [0.8]
0019
0020
0021 dof =[2];
0022 Ndof = length(dof);
0023
0024
0025
0026 table_alpha_d = zeros(1+Nalpha,1+Ndof);
0027 table_alpha_d(2:Nalpha+1,1) = alphas;
0028 table_alpha_d(1,2:1+Ndof) = dof;
0029
0030
0031 for ib = 1:length(betas);
0032
0033 beta_0 = betas(ib);
0034
0035
0036 for ia = 1:Nalpha
0037
0038 alpha = alphas(ia);
0039
0040
0041 for idf = 1:length(dof)
0042
0043 df = dof(idf);
0044
0045
0046 c = chi2inv(1-alpha,df);
0047
0048
0049 mindelta = 0.1;
0050 maxdelta = 6*df;
0051 meandelta = (maxdelta+mindelta)/2;
0052
0053
0054
0055 minpower = 1 - ncx2cdf(c,df,mindelta^2);
0056 maxpower = 1 - ncx2cdf(c,df,maxdelta^2);
0057
0058
0059
0060 while maxpower-minpower > 10^-10
0061
0062 d_power=maxpower-minpower;
0063 meanpower= 1-ncx2cdf(c,df,meandelta^2);
0064
0065 if meanpower > beta_0
0066 maxdelta = meandelta;
0067 maxpower = 1-ncx2cdf(c,df,maxdelta^2);
0068 meandelta = (maxdelta+mindelta)/2;
0069 else
0070 mindelta = meandelta;
0071 minpower = 1-ncx2cdf(c,df,mindelta^2);
0072 meandelta = (maxdelta+mindelta)/2;
0073 end
0074
0075 end
0076
0077 table_alpha_d(ia+1,idf+1) = meandelta;
0078
0079 end
0080 end
0081 beta = beta_0
0082 t_alpha_0_d = table_alpha_d
0083
0084 end