void StatNormalPlot(TVec Data, TVec XDrawVec, TVec YDrawVec, ref Double MinX, ref Double MaxX, ref Double MinY, ref Double MaxY, TVec StdErrs, Boolean DataSorted)
Constructs the Normal Probability Chart.
| # | Name | Description |
|---|---|---|
| 1 | Data | Data to be drawn. The assumption is data values are sorted. |
| 2 | DataSorted | If true, algorithm assumes Data is already sorted in ascending order. If Data is not sorted, you must set this parameter to false so that internal algorithm will automatically do the sorting. |
| 3 | XDrawVec | Returns normal probability plot horizontal values to be drawn - > estimated quantiles from Data vector or in this case sorted Data values. |
| 4 | YDrawVec | Returns normal probability plot vertical values to be drawn - > Values are generated from theoretical standard normal distribution with parameters mu=0, sigma^2=1. |
| 5 | MinX | Returns slope line start X point, XDrawVec 25th percentile. These value are used by Dew.Stats.Tee.ProbabilityPlot series. |
| 6 | MinY | Returns slope line start Y point, YDrawVec 25th percentile. These value are used by Dew.Stats.Tee.ProbabilityPlot series. |
| 7 | MaxX | Returns slope line end X point, XDrawVec 75th percentile. These value are used by Dew.Stats.Tee.ProbabilityPlot series. |
| 8 | MaxY | Returns slope line end Y point, YDrawVec 75th percentile. These value are used by Dew.Stats.Tee.ProbabilityPlot series. |
| 9 | StdErrs | Standard error |
Result: stored in self (calling object)
Remarks:
How to construct Normal distribution probability plot?
- If needed, Data values are sorted (DataSorted parameter must be set to false).
- Abscissa drawing values are formed by estimated data quantiles - ordered Data values. After calculation they are copied to XDrawVec. Dew.Math.TMtxVecBase.Length and Dew.Math.TMtxVec.Complex properties of XDrawVec are adjusted automatically.
- Ordinate drawing values are formed by using theoretical probability
pi.e the soZvalues. After calculation they are copied to YDrawVec. Dew.Math.TMtxVecBase.Length and Dew.Math.TMtxVec.Complex properties of YDrawVec are adjusted automatically. - XDrawVec and YDrawVec 25th and 75th percentile points are used to construct a reference line. Drawing points departures from this straight line indicate departures from normality.
The normal probability plot is used to answer the following questions:
- Are the data normally distributed?
- What is the nature of the departure from normality (data skewed, shorter than expected tails, longer than expected tails)?
Examples
using Dew.Math;
using Dew.Math.Units;
using Dew.Stats.Units;
namespace Dew.Examples
{
private void Example(ProbabilityPlot Series1)
{
double x1,x2;
double y1,y2;
Vector data = new Vector(100,false);
Vector xvec = new Vector(0);
Vector yvec = new Vector(0);
data.RandGauss(0.0, 1.0); // standard distribution
StatProbPlots.StatNormalPlot(data, xvec, yvec, out x1, out x2, out y1, out y2, null,false);
Series1.MinX = x1;
Series1.MaxX = x2;
Series1.MinY = y1;
Series1.MaxY = y2;
MtxVecTee.DrawValues(xvec,yvec,Series1,false);
}
}
See Also: ProbabilityPlot