Hello guys, i want to compare one constant value (LR2) with some function values of the chi-square function. If the function value and the constant value are equal, the loop should stop and should show me, for which value of my parameter the function has the same value as the constant.
I tried this:
LR2=0.0634for alpha=0:0.001:0.999 if chi2inv(alpha,1)==LR2x=alpha break endendx
I know that at one point, chi2inv is exactly 0.0634. I also tried:
LR2=0.0634tolerance=1e-3for alpha=0:0.001:0.999 if abs(chi2inv(alpha,1)-LR2)<tolerancex=alpha break endendx
Hope yu understand the question. Thanks for the help.
Sincerly, Ronald Singer
Best Answer