public double calculateStudentsTSignificance(StudentsTParameters params) {
		int it = 1000, sigCount = 0;
		double p = 0.0;

		DISTANCE_TYPE distType = DISTANCE_TYPE.KS_DISTANCE;

		this.x = ArraysExt.filter(
				this.x,
				FilterFactory.createInstance(FILTER_TYPE.LARGER_THAN,
						params.getXMin()));
		double[] x = toDistribution(this.x);
		double[] empiricalCdf = cdf(x);
		empiricalCdf = ArraysExt.scaleBy(empiricalCdf,
				empiricalCdf[empiricalCdf.length - 1]);
		ArraysExt.print(empiricalCdf);
		double[] theoreticalCdf = cdfStudentsT(params.getDf(),
				ArraysExt.max(this.x), params.getScaling(),
				params.getShifting());
		double diff = theoreticalCdf[theoreticalCdf.length / 2
				+ params.getXMin() - 1];
		theoreticalCdf = Arrays.copyOfRange(theoreticalCdf,
				theoreticalCdf.length / 2 + params.getXMin(),
				theoreticalCdf.length);
		theoreticalCdf = ArraysExt.subtract(theoreticalCdf, diff);
		theoreticalCdf = ArraysExt.scaleBy(theoreticalCdf,
				theoreticalCdf[theoreticalCdf.length - 1]);
		ArraysExt.print(theoreticalCdf);

		double empiricalDistance = cdfDistance(params.getXMin(), empiricalCdf,
				theoreticalCdf, distType);

		this.parameters.clear();
		Log.println("Empirical distance=" + empiricalDistance);

		ProgressPrinter printer = new ProgressPrinter(it, true);
		for (int i = 0; i < it; i++) {
			double[] sampleStudentsT = sampleStudentsTDistribution(
					params.getDf(), ArraysExt.max(this.x), params.getScaling(),
					params.getShifting(), this.x.length);

			int[] intSampleStudentsT = new int[sampleStudentsT.length];
			for (int j = 0; j < sampleStudentsT.length; j++)
				intSampleStudentsT[j] = (int) sampleStudentsT[j];
			intSampleStudentsT = ArraysExt.filter(intSampleStudentsT,
					FilterFactory.createInstance(FILTER_TYPE.LARGER_THAN,
							params.getXMin()));

			DistributionParameterEstimation estimator = new DistributionParameterEstimation(
					intSampleStudentsT);
			try {
				StudentsTParameters newParams = estimator
						.estimateStudentsTParameters();

				if (newParams.getScaling() == 0.0)
					throw new IllegalArgumentException();
				System.out.println(newParams);

				double[] sampleDistr = toDistribution(intSampleStudentsT);
				double[] sampleCdf = cdf(sampleDistr);
				sampleCdf = ArraysExt.subtract(sampleCdf[0], sampleCdf);
				sampleCdf = ArraysExt.scaleBy(sampleCdf,
						sampleCdf[sampleCdf.length - 1]);

				double[] newTheoreticalCdf = cdfStudentsT(newParams.getDf(),
						ArraysExt.max(this.x), newParams.getScaling(),
						newParams.getShifting());
				newTheoreticalCdf = Arrays.copyOfRange(newTheoreticalCdf,
						newTheoreticalCdf.length / 2 + newParams.getXMin(),
						newTheoreticalCdf.length);
				newTheoreticalCdf = ArraysExt.subtract(newTheoreticalCdf[0],
						newTheoreticalCdf);
				newTheoreticalCdf = ArraysExt.scaleBy(newTheoreticalCdf,
						newTheoreticalCdf[newTheoreticalCdf.length - 1]);
				ArraysExt.print(sampleCdf);
				ArraysExt.print(newTheoreticalCdf);

				double syntheticDistance = cdfDistance(newParams.getXMin(),
						sampleCdf, newTheoreticalCdf, distType);
				// Log.println(syntheticDistance);
				if (syntheticDistance >= empiricalDistance) {
					sigCount++;
				}
				this.parameters.add(newParams);
				p = sigCount / (double) (i + 1);
				printer.update(i + 1, "p=" + p);
			} catch (Exception e) {
				i--;
				continue;
			}
		}

		return p;
	}