Serving the Quantitative Finance Community

 
User avatar
r2338
Posts: 0
Joined: May 21st, 2004, 3:22 pm

Regression and Corrleation calculation in Excel for prices

September 1st, 2004, 6:04 pm

That's getting to be a bit much. You should be able to code up the formula I gave you. Just square the residuals,sum them up, and then feed that to the solver. As for t-stats,you could use bootstrapping or I think that the t-stats fromthe 2 step procedure are asymptotically, normal but you'dhave to do some investigating to verify that. I'll offer advice but I'm not going to hold your hand!
 
User avatar
tmoi
Topic Author
Posts: 1
Joined: December 6th, 2003, 4:00 pm

Regression and Corrleation calculation in Excel for prices

September 1st, 2004, 6:25 pm

Mr. R.Thanks but no thanks. I'm not asking you to hold my hand. I'll figure it out. Coding the formula is not an issue, understanding it is. So unless you can provide an explanation in non-quant terms, your error correction model is of little use. Aaron or anyone else reading this:Is there a way to determine when the correlation between dependant variable and independant variable x4 is affecting the model and when to drop it and switch to the model that does not use x4?
Last edited by tmoi on August 31st, 2004, 10:00 pm, edited 1 time in total.
 
User avatar
r2338
Posts: 0
Joined: May 21st, 2004, 3:22 pm

Regression and Corrleation calculation in Excel for prices

September 1st, 2004, 6:40 pm

I thought you wanted a spreadsheet all coded up for you that's all. Ialso made a minor error in the equation. See below.Just write the equation down and have a look at it.On the LHS is a growth rate of yOn the RHS is the growth rate of x4, the lagged x1 to x3'sand the error correction term (y(t-1) - alpha*x4(t-1)).y(t)- y(t-t) = B0 + B1*x1(t-1) +B2*x2(t-1) + B3*x3(t-1) + B4*(y(t-1)-alpha*x4(t-1)) +B5*(x4(t)-x4(t-1)) + e(t)In the long run, you expect the growth rate of y andx4 to be either 0 or a constant right? So set the LHS tozero or a constant and the do the same to the growthrate of x4. Now you can solve out what the long run relationship between y(t) and the x's are through theerror correction term. Just solve this for y(t-1)gy = B0 + B1*x1(t-1) +B2*x2(t-1) + B3*x3(t-1) + B4*(y(t-1)-alpha*x4(t-1)) +B5*gx + e(t)If you do this, I think you'll see the intution. B5 measures the shortrun dynamics between y and x4 (if x4 increases by 5%, y increases byB5*5% on average). Alpha is the long run relationship between y and x4and B4 measure the speed of convergence back to the long run.
 
User avatar
tmoi
Topic Author
Posts: 1
Joined: December 6th, 2003, 4:00 pm

Regression and Corrleation calculation in Excel for prices

September 1st, 2004, 7:52 pm

No No. I din't want you to do the coding!I'll work on it and see if i can make sense of it. Thanks for your help. I won't be able to look at until Friday so will get back to you then.
 
User avatar
Janmoritz
Posts: 0
Joined: July 30th, 2004, 9:05 am

Regression and Corrleation calculation in Excel for prices

September 2nd, 2004, 5:50 am

For further details regarding cointegration also check the works by Carol Alexander. You may want to look up pennoyer.net on the internet and check the cointegration forum here at wilmott.com, too.Moritz
 
User avatar
Aaron
Posts: 4
Joined: July 23rd, 2001, 3:46 pm

Regression and Corrleation calculation in Excel for prices

September 2nd, 2004, 12:22 pm

QuoteOriginally posted by: r2338Aaron, I think that you're confusing in-sample fits with out of sample forecasts. In an efficient market, it is not the case that a forecast regression should not produce any statistically significant results.This is one way of putting the issue, I prefer to see it as a difference between finance and economics. Tmoi's post after mine explains the application, which is economics. Therefore, my answer is not applicable.Useful financial models usually deal with price movements, not prices. The fact that, say, the CPI and S&P500 have a high correlation is not financially meaningful. However, if changes in the CPI (the inflation rate) helped predict tomorrow's stock returns (change in the S&P500), it would be an important result for theory and practice.If you find a historical relation between price movements that would have generated excess profits had you known them in advance, you have a candidate exception to efficient markets. If the relation generates abnormal returns in the future, it is an exception, and a money-making opportunity. If it doesn't generate future profits, in finance we tend to ignore it. In economics, people continue to study it and invoke a "structural change" or something like that to explain why it stopped working.It's not that one field is right and the other wrong. In finance, we tend to assume that the people setting the prices in the past correctly anticipated that something different might have happened. The historical price is correct, there was a coin flip that caused the relation to be correct, it might have gone the other way and people who bet on the relation would have lost. Why doesn't matter, or more accurately, is too complex for useful discussion. Economists tend to assume that what happened happened, and then try to explain why. The relative values of these two approaches can be easily measured in the marketplace.QuoteOriginally posted by: tmoiAaron or anyone else reading this: Is there a way to determine when the correlation between dependant variable and independant variable x4 is affecting the model and when to drop it and switch to the model that does not use x4?This is not an easy question. The usual criterion is adjusted-R^2. That is, you ask whether the new variable reduces the residual sum of squares by more than an unrelated variable would do 1 time in 20. You can think of it as generating 40 random series (using RAND() for example) and putting them in the regression one at a time instead of x4. If two or more of them give a lower residual R^2 than x4, you throw out x4.While this approach makes some sense as a tactic, it's a bad strategy. If all you care about is whether x4 affects your dependent variable, after allowing for effects of the other independent variables, adjusted-R^2 is fine. But if you select a set of variables in a stepwise fashion using adjusted-R^2 (or t-statistics or anything else), you get bad regressions.