Solved – QQ Plot Reference Line not 45°

MATLABqq-plot

I was plotting (standardized) return data with qqplot() in MATLAB against the theoretical quantiles of a normal distribution. However, the line in the QQ-Plot does not have a 45° angle but is rotated a little.

Maybe I misunderstand the concept of a QQ plot but isn't it supposed to be exactly a 45° line?

I put the plot to illustrate the issue.

QQ Plot of standardized return data

Best Answer

Should it be a 45 degree line? It depends!

A QQ plot is the parametric curve defined by:

\begin{align*} x &= F^{-1}(p)\\ y &= G^{-1}(p) \end{align*}

for $p \in [0, 1]$. Where $F^{-1}$ and $G^{-1}$ are inverse CDF functions.

If $F = G$ then $x(p)=y(p)$ and it would be on a 45 degree line.

Another case...

  • Let $\Phi^{-1}(p)$ be the standard normal inverse CDF.
  • Let $F^{-1}(p) = \Phi^{-1}(p)$
  • Let $G^{-1}(p) = \sigma \Phi^{-1}(p) + \mu$

That is $G$ is the inverse CDF for a normally distributed random variable with mean $\mu$ and standard deviation $\sigma$ while $F$ is the inverse CDF for a standard normal variable (i.e. mean 0, standard deviation 1). Then we see:

$$y(p) = \sigma \Phi^{-1}(p) + \mu = \sigma x(p) + \mu$$

That is, the plot is a line $y = \sigma x + \mu$

What's going on in your case?

From the Matlab documentation for qqplot

Superimposed on the plot is a line joining the first and third quartiles of each distribution (this is a robust linear fit of the order statistics of the two samples). This line is extrapolated out to the ends of the sample to help evaluate the linearity of the data.

So even if you standardized your data, the red line MATLAB plots wouldn't be a 45 degree line if the 1st and 3rd quartiles didn't match the normal distribution.