Ralph Vince - Portfolio Mathematics

(Brent) #1

ch02 JWBK035-Vince February 12, 2007 6:50 Char Count= 0


94 HANDBOOK OF PORTFOLIO MATHEMATICS


double r28 = rc8 * rc8;
double rs8 = Math.sin(r8);
double y8 = r8;
double y8 = r8;
if(degreesOfFreedom %2 !=0 ){
if(degreesOfFreedom !=1){
y8 = rc8;
for(int i =3;i<=degreesOfFreedom - 2; i+=2){
x8 = x8 * r28 * (double)((i - 1)/i);
y8 = y8 + x8 * rc8;
}
y8 = r8 + rs8 * y8;
}
confidenceLevel = y8 * 0.6366197723657157;
}else{
y8=1.0;
for(int i =2;i<=degreesOfFreedom -2; i+=2){
x8 = x8 * r28 * (double)((i - 1)/i);
y8 += x8;
}
confidenceLevel = y8 *rs8;
}
System.out.println(“The two-tailed probabilities associated with
the T distribution for a Z score of ”+zScore+“ and ”+degreesOfFreedom+
“degrees freedom is ”+confidenceLevel);
}

Next, we come to another distribution, related to the Chi-Square Dis-
tribution, that also has important uses in statistics. TheF Distribution,
sometimes referred to asSnedecor’s DistributionorSnedecor’s F, is use-
ful in hypothesis testing. Let A and B be independent chi-square random
variables with degrees of freedom of M and N, respectively. Now the ran-
dom variable:
F=(A/M)/(B/N)

can be said to have the F Distribution with M and N degrees of freedom.
The density function, N′(X), of the F Distribution is given as:
Free download pdf