Wednesday, October 22, 2008

Wednesday Math, Vol. 44: The line of regression and x-y ratio

The picture at the left shows a bunch of dots of different colors representing the closing prices of both gold and silver at various Fridays this year. The colors represent time, with the red dots being prices from the winter, the pink dots from the spring, the green dots from the summer and the light blue dots being the recent prices since late September.

A fair question to ask is if there is a pattern to the price changes, and the standard way to answer that is to find the line of regression, also known as the best fitting line or the line of least squares or the predictor line. In this case, that line is drawn in black and red, starting on the left at slightly above $500 for the price of gold and going up to about $1000 an ounce for gold at the right of the graph.

Gauss is given credit for the method of finding this line from any set of data like this, where values can be represented as matched pairs, and his method finds the slope of the line that will pass through the centroid point (x-bar, y-bar), the average values of both the x entries and the y entries. The line can always be drawn, but sometimes it isn't very valuable, because the data doesn't actually show much correlation. With these 34 data points, the correlation coefficient is about .9, which says the correlation is very strong. The highest possible value of the correlation coefficient is 1, and the lowest value is -1. Being close to 1 means strong positive correlation, being close to -1 means strong negative correlation, being close to 0 means not much correlation at all.

Visually, you can see that the points on the right of the graph are all very close to the line, but as the year progressed, the circled points in green and blue that are off to the left aren't as close, so the correlation got weaker as those points were added. Still, .9 is very impressive correlation for a data set of this size, and the predictor line has value.

This line has the equation y = 22.64x + 527.15, which means the best way to predict the price of gold (y) if you have the price of silver (x), is to multiply the silver price by 22.64, then add 527.15. This is not a tremendously useful tool for investors to get exact prices. If you have found the price of silver, you can probably find the exact price of gold as well. Investors would be more interested in the x-y ratio, which is to say how many ounces of silver will buy an ounce of gold. That is represented by the lines that start at the bottom right point, the origin (0,0) and extend until they reach the right or top of the graph. Because the silver and gold prices have different scales, the 45 degree line represents the x-y ratio of 50, which is marked by the number 50 in a box at the upper right hand corner. The other ratio line are marked with values 40, 60, 70, 80 and 90.

For most of 2006 and 2007, as well as the beginning of 2008, the gold-silver ratio did not stray that much from 50, meaning about 50 ounces of silver would buy you an ounce of gold. The slice of grey near the diagonal of the box shows when the ratio dipped below 50, which would have been the best time to be invested in silver instead of gold.

But in the past few months, even though there is still a correlation between the prices, meaning when gold prices increase or decrease, sliver prices tend to do the same, the ratio increases and decreases have changed drastically, represented by the blue dots being in the yellowish-green slice, indicating it takes between 80 to 90 ounces of silver to buy an ounce of gold.

This is just another odd pattern that is happening in the world markets in this very volatile financial year. To interject a little politics into my usually politics free math posts, this would be a good time to have a steady hand on the tiller in our president. While that is a quote from McCain, it is not a recommendation of McCain.


ken said...

Interesting. I can see reasons for the price of silver to fall relative to gold, but they're all long-term reasons, mostly the decline in silver-based photography.

It also seems like the regression line should come closer to the origin.

What happens if you do a multiple regression of the price of gold v. the price of silver, and time?

Matty Boy said...

The lowered utility of silver was the explanation in 2007 for a fall in its relative price compared to gold. IN both years, silver started out growing faster than gold, then gold caught up and surpassed silver percentage wise.

When both were going up in the first eleven week of this year, silver was doing better than gold. Since both have been in freefall, gold is losing a LOT less than silver is.

Interesting fact: only a tiny percentage of gold usage in the world is non-ornamental. Even with silver use in photographic processes waning seriously, more silver is used industrially than ornamentally, and that includes coinage.