Standard Regression Error

I just learned something that I didn't know. I happened to be browsing and ...
>I suspect there's lots of stuff you don't know. I remember when ...
Pay attention!
I want to go over regression analysis:
 We have a bunch of observed values: y_{1}, y_{2} ... y_{n}.
Example: n successive daily returns for GE stock.
 We suspect there may be a relationship between these numbers and another set: x_{1}, x_{2} ... x_{n}.
Example: n successive daily returns for the DOW Index.
 We plot the points (x_{1}, y_{1}), (x_{2}, y_{2}) ... (x_{n}, y_{n}) giving a "scatter plot", like so:
 We try to find the "best" straight line approximation to the n points.
That'll depend upon our definition of "best".
 We consider a line described by the equation: y = α + β x.
For x = x_{k}, the ycoordinate on the line is: y = α + β x_{k}.
The observed value, for that particular xvalue, is: y_{k}.
 For each point we calculate the error:
e_{k} = y_{k}  (α + β x_{k}).
 
 We then calculate the sum of the squares of these errors:
e_{1}^{2} + e_{2}^{2} + ... +e_{n}^{2}
= Σe_{k}^{2}.
For sanitary reasons, we'll use the notations:
Σx_{k} = x_{1}+x_{2}+ ... +x_{n}
Σx_{k}y_{k} = x_{1}y_{1}+x_{2}y_{2}+ ... +x_{n}y_{n} etc.
... or, sometimes, simply: Σx or Σxy.
 Our definition of "best" is to choose the 2 parameters α and β so that:
Σe_{k}^{2} = Σ{y_{k}  (α + β x_{k})}^{2} is a minimum.
 The resultant "best" line is called the "regression line" and the "best" parameter values are:
[1]
α = {(Σx^{2}/n) (Σy/n)  (Σx/n)
(Σxy/n)}
/
{Σx^{2}/n (Σx/n)^{2}}
β = {Σxy/n (Σx/n)(Σy/n)}
/
{Σx^{2}/n (Σx/n)^{2}}

 
 Recall that the Standard Deviation of a set of numbers such as x_{1}, x_{2} ... x_{n} is calculated according to:
[2]
SD^{2}[x] = (1/n) Σ(x_{k}  M[x])^{2}
where M[x] = (1/n) Σx_{k}, the Mean (or Average) of the xvalues.

 Further, it can be shown that this is the same as:
[3]
SD^{2}[x] = (1/n) Σx_{k}^{2}  M[x]^{2}
= Σx^{2}/n  ( Σx/n)^{2}
= (the Average of the squares)  (the square of the Average)

 Then the denominators in the magic equations for α and β are just SD^{2}[x].
>Okay, but what's that "standard regression error? When do you intend to ... ?
Patience!
Continuing, we note that:
 The numerator of the equation for α is: (Mean of x^{2})(Mean of y)  (Mean of x)(Mean of xy) = M[x^{2}]M[y]  M[x]M[xy]
 The numerator of the equation for β is: (Mean of xy)  (Mean of x)(Mean of y) = M[xy]  M[x]M[y]
 By definition, the Covariance of x and y is: COVAR[x,y] = Mean[xy]  Mean[x]Mean[y]
 Hence we can write:
[4]
β = COVAR[x,y] / SD^{2}[x]

 There's also this thing called Pearson productmoment Correlation coefficient defined by:
[5]
(Pearson) Correlation = r = COVAR[x,y] / SD[x]SD[y]

Remember those errors? They were calculated as: e_{k} = y_{k}  (α + β x_{k}).
 For the regression line, it can be shown that the average squared error is given by:
[6]
Error^{2} = Σe_{k}^{2} / n
= SD^{2}[y] (1  r^{2})

>"It can be shown this" and "It can be shown that". Shown ... where?
Check things out here.
Okay, we're almost there!
[7]
(Standard Regression Error)^{2}
= Σe_{k}^{2} / (n2)
= { n / (n2) } SD^{2}[y] (1  r^{2})

>Huh? Isn't that what you got before? Why did you say it's something you didn't know?
I calculated the Error before, but the "standard" error ... that's a horse of a diff'runt hue, eh?
>But it's just that n/(n2) guy out front. If you had a hundred stock returns, that'd be 100/98 and that's hardly ...
Don't argue. That's what they call the Standard Error. When you take the square root
(for 100 daily stock returns), it'll differ from the garden variety Error by just a schnitzel.
For the GE vs DOW example we considered above (with just 21 points) we'd get:
Error = 2.39% and Standard Error = 2.51%.
If'n we look at a year's worth of returns (that's 252 points) we'd get:
Error = 2.07% and Standard Error = 2.08%.
Note #1:
The Standard Regression Error is available in Excel as: STEYX(y_{k}values, x_{k}values)
Above, we talked about regression between two sets of numbers, x_{k} and y_{k}.
Now we suppose we have a single set of monthly returns for some stock, namely: r_{1}, r_{2} ... r_{n}.
Indeed, we consider the evolution of some monthly stock prices: P_{1}, P_{2} ... P_{n} where P_{k+1} = P_{k} (1+r_{k}).
In particular:
[A] P_{k} = P_{0} (1 + r)^{k} where k is the number of months that have passed since the price was P_{0}.
This monthly chart displays the Value Added Monthly Index (VAMI)
It's actually XOM (Exxon) stock, monthtomonth.
 
Now consider the logarithm of that VAMI. It'll look like this:
If the monthly returns were constant, the log[VAMI] graph would be a straight line.
That's because:
[B] log[P_{k}] = log[P_{0}] + k log[1+r] where k is the number of months passed.
[B] follows from [A].
See? For constant r, the plot of P vs k is linear.
The slope is log[1+r] which, for smallish values of r, is approximately r itself.
>Huh?
That's because log[1+r] ≈ r for small values of r.
In fact, from [B], log[P_{k}]  log[P_{k1}] = log[ P_{k}/P_{k1}] = r is used to define the logarithmic return.
 
>Are you using log_{10}?
No, I'll be using the natural log, to base e ... because it's much sexier.
>I have to tell you that the log[VAMI] chart don't look nothing like a straight line.
Uh ... yes, that's true. What we'd like to do is see how close it is to a straight line. To that end we ...
>You get yourself a regression line and calculate the error, right?
Sort of. We plot log[VAMI] vs the number of the month (that's k), getting a scatter plot like so:
It's XOM (Exxon) over 120 months or 10 years.
The slope of the regression line gives our monthly return. That's 0.0097 ... a "kindofaverage" monthly return of 0.97%.
The deviation of points from the regression line (measured by the Error) tells us how wild and wooly the returns really are.
Large Error means you can't count on getting similar returns.
The Error is then a measure of the risk associated with the stock.
>Don't tell me! You got Return and you got Risk so you got ...
You got a ratio: Return / Risk.
 
That sounds like a Sharpe Ratio, right?
[8]
Sharpe Ratio = [ (Average Return)  (riskfree Return) ] / (Standard Deviation of Returns)

>So you're gonna generate another kind of Sharpe Ratio?
I think there are lots of alternatives to Sharpe ... the Sortino Ratio, for example.
We want to talk about yet another ...
KRatio ... what KRatio?

motivated by email from Shaun C.
Lars Kestner is a Equity Derivatives Trader and author.
In a book called Quantitative Trading Strategies, he introduced the Kratio as an alternative to the Sharpe Ratio.
It goes something like this:
 We generate a scatter plot of log[VAMI] versus (Number of periods).
 The return per period (days, weeks, months, whatever) is measured by the Slope.
For example, using monthly returns of XOM stock over 10 years, we'd get this:
 The deviation of points from the regression line is measured by the Standard Error.
This Error is a measure of "risk" asociated with the stock.
 The ratio: Slope / Standard Error may be interpreted as: Return / Risk ... like the Sharpe Ratio.
 That would give:
[9]
kRatio = (Slope of logVAMI regression line) / (Standard Regression Error)

 
Example:
For the 10year XOM stock, considering 120 monthly returns:
 The Slope of the logVAMI regression line is 0.0097 (corresponding to a 0.97% monthly return).
 The (Standard Regression Error) is 0.158.
The ratio is then 0.0097 / 0.1579 = 0.0614.
>And that's the Kestner KRatio?
Uh ... no.
When he first mentioned the KRatio he defined it as:
[1] KRatio = (Slope of logVAMI regression line) / [ (Standard Regression Error) sqrt(n) ] where n = number of return periods being considered.
Somebody pointed out some error in his logic and he changed it to:
[2] KRatio = (Slope of logVAMI regression line) / [ (Standard Regression Error) (n) ] where n = number of return periods being considered.
For our 10year XOM example (where we used 120 monthly returns), we'd get:
[1a] KRatio = 0.0097 / [0.158*sqrt(120) ]= 0.00561.
[1b] KRatio = 0.0097 / [0.158*120] = 0.000512.
According to Kestner, the [1b] equation is the correct one.
However, neither agrees with our kratio, above.
>So why does Kestner divide by n?
I have no idea ... yet.
However, one would expect that the KRatio should be defined so that it'll give the same number (roughly) regardless of whether one uses daily weekly or monthly returns.
That's similar to calculating the Standard Deviation of monthly returns, then multiplying by sqrt(12) to annualize.
Annualizing the SD of weekly returns, by multiplying by sqrt(52), gives (roughly) the same number.
That explains why people get all excited about annualizing.
>So are you excited about annualizing that Kestner's?
Yes ... but I'd like to understand why Kestner sticks a "n" in the divisor.
Note that if one uses monthly data in the Sharpe Ratio, then annualizes, that Ratio gets multiplied by sqrt(12).
You'd think that, if one wanted to provide an alternate to the Sharpe ratio, that alternate should have similar properties, eh?
>I think you're confused. Maybe you should get some sleep.
zzzZZZ
Standard Error of the Slope

Okay, let's try to make sense of the Kestner KRatio.
The numerator of the Ratio as the SLOPE of the log[VAMI] regression (against time) seems reasonable, 'cause it provides a measure of the monthly returns.
But that denominator!
The denominator should measure, somehow, the volatility of the monthly returns, their deviation from the slope, their lack of consistency over time, their ...
>So what do you suggest?
Well, we started by associating the denominator with the "Standard Error" associated with the regression line.
That Error measures the deviations of the points on the log[VAMI] plot from the regression line.
But we're really interested in the slopes, so maybe we should be measuring the deviations of the monthly returns from that SLOPE .
To this end, let's do this:
 Consider successive points on the log[VAMI] plot: (k1, log[P_{k1}]) and (k, log[P_{k}]).
 The slope of the line joining these two points is: log[P_{k}]  log[P_{k1} = log[P_{k}/P_{k1}].
 That's our (monthly) logarithmic return, so we take that minislope as the measure of the return for the k^{th} month.
 To measure the deviations of these minireturns from the slope of the regression line (that's β), we ...
>We calculate the standard error!!
Excellent idea. We calculate the socalled Standard Error of the Slope.
Let's do that. To make the equations look neater, we'll set y_{k} = log[P_{k}].
 
In fact, let's put aside this KRatio stuff and just consider an arbitrary scatter plot: (x_{k}, y_{k}).
>Huh?
Don't worry about it. We'll talk about the Standard Error of the Slope later. In the meantime, we'll use it to calculate another kRatio.
Note that: (Standard Error of the Slope)^{2} = {Σ(y  y_{k})^{2} / (n2)} / Σ(x  M[x])^{2}.
That curious (n2) reappears. For large n, it's indistinguishable from n.
If we replace (n2) by n, this is like calculating:
(Standard Error of the Slope)^{2} = (1/n){(1/n)Σ(y  y_{k})^{2} } / (1/n)Σ(x  M[x])^{2}
= (1/n) (Mean Square Error in the y_{k}) / (Standard Deviation of the x_{k})^{2}.
Note #2:
I might mention that statisticians usually regard the Standard Deviation of a set of numbers (like the x_{k}) as a sample taken from some universe of xvalues.
In attempting to estimate the SD of the entire xpopulation, they calculate the SD of the sample values, x_{k} as:
Σ(x  M[x])^{2} / (n1) rather than Σ(x  M[x])^{2} / n as we've been doing.
Dividing by (n1) instead of n is not as popular in financial circles as in statistical circles.
In fact, for large values of n there's little difference and ...
>Please continue.
We now have another kRatio:
[11]
kRatio = (Slope of logVAMI regression line) / (Standard Error of the Slope)

>Why the lowercase "k"?
Because it's not Kestner's Kratio. In fact, in [1] and [2], above, we got it wrong.
Kestner did NOT use the (Standard Regression Error) in the denominator.
He used the (Standard Error of the Slope), as in [11]
... but he divided by n.
>So you're getting closer to Kestner, right?
It seems that way.
click to proceed
