Correlation vs. Correlationlog

Discussions about the testing and simulation of mechanical trading systems using historical data and other methods. Trading Blox Customers should post Trading Blox specific questions in the Customer Support forum.
Post Reply
LeviF
Roundtable Knight
Roundtable Knight
Posts: 1436
Joined: Mon Dec 22, 2003 12:24 pm
Location: Des Moines, IA
Contact:

Correlation vs. Correlationlog

Post by LeviF »

I posted this under a different thread, though maybe it should have its own.

When would a person want to use the "correlation" function vs. the "correlationlog" function?
LeviF
Roundtable Knight
Roundtable Knight
Posts: 1436
Joined: Mon Dec 22, 2003 12:24 pm
Location: Des Moines, IA
Contact:

Anybody??

Post by LeviF »

??
Tim Arnold
Site Admin
Site Admin
Posts: 9015
Joined: Tue Apr 06, 2004 1:41 pm
Location: Boston, MA
Contact:

Post by Tim Arnold »

The reason to use thing A vs. thing B is because thing A works better for your purposes. So I would recommend testing your correlation strategy using both and see which is a better fit for your needs.

That said, I find people often use the log functions for correlation and for standard deviation when they have proportionaly backadjusted data such as stock data backadjusted for stock splits. Futures data is not proportionaly backadjusted, so thus the difference in the math.
LeviF
Roundtable Knight
Roundtable Knight
Posts: 1436
Joined: Mon Dec 22, 2003 12:24 pm
Location: Des Moines, IA
Contact:

Post by LeviF »

I dont get the mathematics. What does the correlationlog tell you (besides the correlation of the change in the logs...)? I'm using forex btw.
sluggo
Roundtable Knight
Roundtable Knight
Posts: 2987
Joined: Fri Jun 11, 2004 2:50 pm

Post by sluggo »

I have two suggestions:

(1) Track down the Blox user who requested that correlationlog functionality be added to Blox. Ask her why she wanted it and ask her to explain the mathematics.

(2) Temporarily assume that Tim's remark about logarithms and stocks will point you in a fruitful direction. Check out some books on Security Analysis that focus upon stocks and see whether these books shed light upon correlation of (prices) vs correlation of (price changes) vs correlation of (logarithm of (price changes)). I recall that the Black-Scholes model of stock option valuation, includes logarithms of price changes. Maybe Black-Scholes would be another chapter in a Security Analysis textbook, to study and reflect upon. Presumably they had a Good Reason to deal with logarithms of price changes, maybe knowing their reason will help you better understand the situation you are interested in.
LeviF
Roundtable Knight
Roundtable Knight
Posts: 1436
Joined: Mon Dec 22, 2003 12:24 pm
Location: Des Moines, IA
Contact:

Post by LeviF »

Here is an example:

I have two cross rates with a 100 period price correlation of -0.79. However, the correlation of the % change in price is 0.62. I don't quite understand how the price series can be negatively correlated, but the % change positively correlated.

What i'm trying to do is stay out of trades that are positively correlated so that a 5% instrument DD doesn't turn into a 10% or 15% portfolio DD.

According to my charts, to accomplish my task, I want to stay out of instruments with a high correlation of the % changes?
Attachments
correlation.jpg
correlation.jpg (84.44 KiB) Viewed 5736 times
Asamat
Roundtable Knight
Roundtable Knight
Posts: 175
Joined: Fri Jun 03, 2005 7:50 am
Location: Walldorf, Germany

Post by Asamat »

The reason a logarithm appears in many of the more theoretically motivated trading related formulas is: that way you automatically deal with relative price changes (percentage changes) instead of absolute price changes.

Let's make an example:
Imagine a price going from 10 to 11. Several years later the instrument trades at 100, and you deal with a change from 100 to 101. The question is how to compare the two changes. In many cases a comparison of relative changes is what you want to do: a change from 10 to 11 should have the same weight as a change from 100 to 110, not from 100 to 101.

You can either achive that by calculating percentage changes, 10% compared to 1% in the above example. Or, mathematically equivalent but more flexible in complex calculations: use logarithms. Let's again look at the example. I'll use the logarithm with base 10 to make it more visible to our eyes, but it works the same with ln or with any logarithm, whatever the base.

Code: Select all

10  - 11
100 - 101
100 - 110
log10 of these are:

Code: Select all

1 - 1,04139269
2 - 2,00432137	
2 - 2,04139269
The difference between the logarithms of the (10-11) pair and of the (100-110) pair are exactly the same. (Because the proportion is the same.) Now this is what you want to have in many situations: imagine you need to have a profit target 10 percent above the market. Mathematically this corresponds to the target always being 0,0419269 above the logarithm of the price. The important thing is: this is irrespective of the price level, it's true when the price is 10, 100, 100000, or any other number.

So the reason for the logarithm of price changes being used in Black-Scholes is that it should deal with relative, not absolute price changes. And the reason for a correlation_log function is that somebody wanted to work on relative not absolute correlation changes.

Regards,
Asamat
LeviF
Roundtable Knight
Roundtable Knight
Posts: 1436
Joined: Mon Dec 22, 2003 12:24 pm
Location: Des Moines, IA
Contact:

Post by LeviF »

Yes, thank you.
Post Reply