public void frechetProbabilityPlot(){
            this.lastMethod = 7;

            // Check for suffient data points
            this.frechetNumberOfParameters = 3;
            if(this.numberOfDataPoints<4)throw new IllegalArgumentException("There must be at least four data points - preferably considerably more");

            // Create instance of Regression
            Regression min = new Regression(this.sortedData, this.sortedData);

            // Calculate initial estimates
            double[] start = new double[3];
            start[0] = this.minimum - 0.1*Math.abs(this.minimum);
            start[1] = this.peakWidth()/3.0;
            if(start[1]<1.0)start[1] = 2.0;
            start[2] = 4.0;
            this.initialEstimates = start;
            double[] step = {Math.abs(0.3*start[0]), Math.abs(0.3*start[1]), Math.abs(0.3*start[2])};
            if(step[0]==0)step[0] = this.range*0.01;
            double tolerance = 1e-10;

            // Add constraint; mu<minimum, sigma>0, gamma>0
            min.addConstraint(0, +1, minimum);
            min.addConstraint(1, -1, 0);
            min.addConstraint(2, -1, 0);

            // Create an instance of FrechetProbPlotFunc
            FrechetProbPlotFunc fppf = new FrechetProbPlotFunc();
            fppf.setDataArray(this.numberOfDataPoints);

            // Obtain best probability plot varying mu, sigma and gamma
            // by minimizing the sum of squares of the differences between the ordered data and the ordered statistic medians
            min.simplex(fppf, Conv.copy(start), step, tolerance);

            // Obtain best estimates or first minimisation
            double[] firstBests = min.getBestEstimates();

            double ss = min.getSumOfSquares();

            //Calculate new initial estimates
            double[] start2 = new double[this.frechetNumberOfParameters];
            start2[0] = 2.0*firstBests[0] - start[0];
            if(start2[0]>minimum)start2[0] = minimum*(1.0 - Math.abs(minimum)*0.05);
            step[0] = Math.abs(start2[0]*0.1);
            if(step[0]==0)step[0] = this.range*0.01;
            start2[1] = 2.0*firstBests[1] - start[1];
            if(start2[1]<=0.0)start2[1] = Math.abs(2.0*firstBests[1] - 0.98*start[1]);
            step[1] = Math.abs(start2[1]*0.1);
            start2[2] = 2.0*firstBests[2] - start[2];
            if(start2[1]<=0.0)start2[2] = Math.abs(2.0*firstBests[2] - 0.98*start[2]);
            step[2] = Math.abs(start2[2]*0.1);

            min.simplex(fppf, Conv.copy(start2), step, tolerance);

            // Get mu, sigma and gamma for best correlation coefficient
            this.frechetParam = min.getBestEstimates();
            double ss2 = min.getSumOfSquares();
            if(ss<ss2)this.frechetParam = firstBests;

            // Calculate Frechet order statistic medians
            this.frechetOrderMedians = Stat.frechetOrderStatisticMedians(this.frechetParam[0], this.frechetParam[1], this.frechetParam[2], this.numberOfDataPoints);

            // Regression of the ordered data on the Frechet order statistic medians
            Regression reg = new Regression(this.frechetOrderMedians, this.sortedData);
            reg.linear();

            // Intercept and gradient of best fit straight line
            this.frechetLine = reg.getBestEstimates();

            // Estimated erors of the intercept and gradient of best fit straight line
            this.frechetLineErrors = reg.getBestEstimatesErrors();

            // Correlation coefficient
            this.frechetCorrCoeff = reg.getSampleR();

            // Initialize data arrays for plotting
            double[][] data = PlotGraph.data(2,this.numberOfDataPoints);

            // Assign data to plotting arrays
            data[0] = this.frechetOrderMedians;
            data[1] = this.sortedData;

            data[2] = frechetOrderMedians;
            for(int i=0; i<this.numberOfDataPoints; i++){
                data[3][i] = this.frechetLine[0] + this.frechetLine[1]*frechetOrderMedians[i];
            }

            // Create instance of PlotGraph
            PlotGraph pg = new PlotGraph(data);
            int[] points = {4, 0};
            pg.setPoint(points);
            int[] lines = {0, 3};
            pg.setLine(lines);
            pg.setXaxisLegend("Frechet Order Statistic Medians");
            pg.setYaxisLegend("Ordered Data Values");
            pg.setGraphTitle("Frechet probability plot:   gradient = " + Fmath.truncate(this.frechetLine[1], 4) + ", intercept = "  +  Fmath.truncate(this.frechetLine[0], 4) + ",  R = " + Fmath.truncate(this.frechetCorrCoeff, 4));
            pg.setGraphTitle2("  mu = " + Fmath.truncate(this.frechetParam[0], 4) + ", sigma = "  +  Fmath.truncate(this.frechetParam[1], 4) + ", gamma = "  +  Fmath.truncate(this.frechetParam[2], 4));

            // Plot
            pg.plot();

            this.frechetDone = true;
            this.probPlotDone = true;
        }