/*
	As an input we choose the 5-factor model with 4800 obligors.
	To compute the achieved coverage levels for 95 percent upper and lower endpoint 
	confidence intervals for computing tail loss probabilities, our global variable 				
	declarations and main() function should be like this.
*/

//Glabal variables
int model = 3;
const int d=5;
const int numbofOblgrs = 4800;

//Main() function
gsl_vector *res;
int numbofSim = 1000000;
x_p = 30000;
GlassLiNumericExampleInit();

printf("model %d\n", model);
printf("x %lf\n", x_p);

double exactProb = simulateISProbofExceedance(numbofSim);

numbofSim = 1000;
double beta = 1-0.05;
int m = 10000;
res = simulatemanyLossProb(m,numbofSim,exactProb,beta);
printf("Upper Endpoint (Ordinary t, Hall) Lower Endpoint (Ordinary t, Hall)\n");
printf("$%.3lf$&$%.3lf$&$%.3lf$&$%.3lf$ \n",gsl_vector_get(res, 0),gsl_vector_get(res, 1),gsl_vector_get(res, 2), gsl_vector_get(res, 3));
gsl_vector_free(res);
