The Leverage Space Portfolio Model in the Real World 407
if(column==0){
x = (int)(pn % NL);
}else{
x=
(int)((pn/(long)(Math.pow((double)N,(double)column))) %
NL);
}
int a = q-1-column;
hprpermutation[a] = hpr[x];
probsarray[a] = probs[x][0];//it’s zero here
because we are only figuring one MS
}
return hprpermutation;
}
protected void control(){
double sigmas = 5.0;
double errorsize = .001;
double samplesize = Math.pow(sigmas/errorsize,2.0)
x .25;
long samplesizeL = (long)(samplesize+.5);
int counter=1;
RalphVince.Math.MersenneTwisterFast generator = new
RalphVince.Math.MersenneTwisterFast(System.currentTime
Millis());
java.util.Random random = new java.util.Random();
while(1==1){
long permutationcount = 0L;
double passed=0.0;
double sumOfProbs=0.0;
long nopermutations = (long)
Math.pow((double)hpr.length,(double)counter);
if(nopermutations<(long)samplesize){
for(long pn=0;pn<nopermutations;pn++){
double
hprpermutation[]=nPqi(counter,pn);
double theB =
(double)B(hprpermutation,usedrawdowninsteadofruin);
if(theB>0.0){
theB *= probThisB;
passed += theB;
}
sumOfProbs += probThisB;
permutationcount++;
}
}else{