Showing posts with label Parameter Stability. Show all posts
Showing posts with label Parameter Stability. 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.