Showing posts with label IBM. Show all posts
Showing posts with label IBM. Show all posts

Tuesday, April 8, 2008

Parameter Stability - 3

My previous post (Parameter Stability-2) showed that even when I excluded outlying returns from the regression of IBM's and HP's monthly returns against the S&P 500 Index and the Fama French market factor, I still got sharp jumps in estimated beta as I moved across 36 years of history. But, as I realized while making the post, I didn't do the exclusion correctly. I should have re-estimated the mean and standard deviation for each sub-period. I redid the study, this time against the S&P 500 Index because it was convenient and because all I care about for the moment are methodological requirements for parameter stability. The estimation period is 36 months long. I excluded returns that were more than 2.9 standard deviations away from the mean for each period. No returns were excluded for most periods; one or two returns were excluded about 15% of the time; three returns were excluded in about 0.5% of the periods. Although the r-squares jump around a lot, the betas are a lot more stable now.

Data for IBM is on the left below; HP is on the right. The Mathematica code shown produced the two plots on the left. I pasted the ones on the right later.

Procedurally, the code gets lists of IBM, HP and the S&P returns from Wolfram Research, transposes two lists into a single list of paired values for the regression, and then 396 regressions, recalculating the sample mean and standard deviation for each, filtering the returns subset for outliers, running regression, adding the regression values for beta and r-squared to the end of the list {params}, and finally, plotting the values in the list. Pretty neat, huh? Click the image for a better view.

Parameter Stability - 2

My previous post (Parameter Stability-1) showed the betas and r-squares obtained from 366 rolling 36 month regressions of IBM against the Fama French market factor. I was surprised to see how unstable the regression parameters were. I suspected data outliers were the problem, but some preliminary testing showed that the sharp jumps in the parameters were not completely due to extreme returns. I decided to expand this study by looking at both HP and IBM, and regressing against both the S&P 500 Index as well as the FF market factors. I excluded stock returns that were more than 4 standard deviations from the stock's long term mean.

The results can be seen below. The upper four graphs show results for IBM; the lower four ones for HP. The graphs on the left show regressions against the Fama French data; the ones on the right are against the S&P 500. The graphs are paired: beta above and r-squared below. Click the image for a better view.

I was surprised at the results, but was somewhat comforted by the fact that they were pretty much the same for both stocks and against either index. However, just as I was writing this post, it occurred to me I hadn't grasped the implication of using the whole 36 year period as a basis for excluding returns. I should have exclude outliers based on the returns in each 36 month period. I'll do that next. But even though it's clear that I made a methodological error, comments would be appreciated.

Parameter Stability - 1

My previous post (IBM vs the Fama French market factor) showed the results of a regression of 426 months of IBM returns against the Fama French market factor. I was working out the details of getting the data and using Mathematica to do the regression. Now let's take a closer look at that data. Let's look at the stability of IBM's exposure to the Fama French market factor. The image below shows a plot of 366 rolling 60-month factor betas, and the corresponding r-squares. Not very stable! However, notice the discontinuities in the r-square plot (enclosed by two red boxes). This strongly suggest that data outliers are causing problems. My next step will be to define procedures to identify and deal with outliers.

Look how little Mathematica code it took to do this work (Click on the image below to see the details). I like Mathematica more every day.

IBM vs the Fama French Market Factor

I'm more interested in economic factor models (EFM) than fundamental factor models. Since the heart of building an EFM is estimating the exposures (betas) of stocks to economic time series with regressions, I'm going to start with that. This is pretty basic, but I have an additional challenge in that I've decided to do everything with Mathematica (M-). It's extremely powerful, but has a steep learning curve. Starting with something basic will make it easier for me to learn about M-.

Finding sources for data and making sure it's good data is another challenge, and not a trivial one. MM helps me out a bit because version 6 comes with built in access to a financial database, but it's not perfect either. The Mathematic financial data function ( FinancialData ["IBM", "Returns", {to,from,period}] ) comes back with price returns. The financial database at Wolfram Research is a new thing for them, so they still have a few bugs to work out. I'll solve total return problem later.

My first exercise is simple. I want to calculate IBM's exposure to the Fama French market factor (this is basically IBM's market beta). This regression is based on approximately 36 years of monthly returns. The IBM's returns are price instead of instead of total returns, and not excess returns either, but I'm anxious to get started! Look how little M- code it took to load the data, do the regression and make two plots. The regression returns a beta of 1.30 with an r-squared of 34%. Not a bad r-squared! Click the image below for a better view.