ppplot

Create a probability-probability plot.

Syntax

ppplot(X)

ppplot(X, dist)

ppplot(X, dist, param1, param2, ...)

h = ppplot(...)

[p,y] = ppplot(...)

[h,p,y] = ppplot(...)

Inputs

X
A data sample with which to compare a specified distribution.
Type: double
Dimension: vector | matrix
dist
The name of an assumed distribution for X (default: norm).
Type: string
paramX
The parameters for dist (default: none, for standard normal).
Type: double | integer
Dimension: scalar

Outputs

h
A handle for the plot.
p
The theoretical cumulative probability values on the horizontal axis.
y
The cumulative probability values for X on the vertical axis.

Examples

Compare a Chi-squared sample with 50 degrees of freedom to the normal distribution with mean 50 and standard deviation 10.

rand('seed', 2023);
n = 100;
data = chi2rnd(50,n,1);
ppplot(data, 'norm', 50, 10);


Figure 1. ppplot

Comments

The function plots the sorted cumulative probabilities of X, assuming dist, on the vertical axis, with a set of perfectly spaced cumulative probabilities on the horizontal axis. The perfectly spaced cumulative probabilities for N points are selected to be ([1:N] - 1/2) / N.

If X has distribution dist then plot is expected to fall on the straight line from (0,0) to (1,1), which is plotted to provide a visual reference.