public void rayleighProbabilityPlot(){
            this.lastMethod = 3;

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

            // Create instance of Regression
            Regression min = new Regression(this.sortedData, this.sortedData);
            double sigmaest = this.standardDeviation;
            double[] start = {sigmaest};
            double[] step = {0.3*sigmaest};
            this.initialEstimates = start;
            double tolerance = 1e-10;

             // Add constraint; beta>0
            min.addConstraint(0, -1, 0);

            // Create an instance of RayleighProbPlotFunc
            RayleighProbPlotFunc rppf = new RayleighProbPlotFunc();
            rppf.setDataArray(this.numberOfDataPoints);

            // Obtain best probability plot varying beta
            // by minimizing the sum of squares of the differences between the ordered data and the ordered statistic medians
            min.simplex(rppf, start, step, tolerance);

             // Get mu and sigma values
            this.rayleighParam = min.getBestEstimates();

            // Get mu and sigma value errors
            this.rayleighParamErrors = min.getBestEstimatesErrors();

            // Get sum of squares
            this.rayleighSumOfSquares = min.getSumOfSquares();

            // Calculate Rayleigh order statistic medians (Weibull with mu = 0, sigma = sqrt(2).beta, gamma = 2)
            this.rayleighOrderMedians = Stat.weibullOrderStatisticMedians(0.0, this.rayleighParam[0]*Math.sqrt(2.0), 2.0, this.numberOfDataPoints);

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

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

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

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

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

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

            data[2] = rayleighOrderMedians;
            for(int i=0; i<this.numberOfDataPoints; i++){
                data[3][i] = this.rayleighLine[0] + this.rayleighLine[1]*rayleighOrderMedians[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("Rayleigh Order Statistic Medians");
            pg.setYaxisLegend("Ordered Data Values");
            pg.setGraphTitle("Rayleigh probability plot:   gradient = " + Fmath.truncate(this.rayleighLine[1], 4) + ", intercept = "  +  Fmath.truncate(this.rayleighLine[0], 4) + ",  R = " + Fmath.truncate(this.rayleighCorrCoeff, 4));
            pg.setGraphTitle2("  beta = " + Fmath.truncate(this.rayleighParam[0], 4));

            // Plot
            pg.plot();

            this.rayleighDone = true;
            this.probPlotDone = true;
        }