Quantile Autoregression in R

In the past, I wrote about robust regression. This is an important tool which handles outliers in the data. Roger Koenker is a substantial contributor in this area. His website is full of useful information and code so visit when you have time for it. The paper which drew my attention is “Quantile Autoregression” found under his research tab, it is a significant extension to the time series domain. Here you will find short demonstration for stuff you can do with quantile autoregression in R.

Continue reading

Forecasting the Misery Index, follow-up

Five months ago I generated forecasts for the Eurozone Misery index. I used the built-in “FitAR” package in R. Using different models differing in their memory length (how many lags were considered for each model) 24 months ahead forecasts were generated. Might be interesting to see how accurate are the forecasts. The previous post is updated and few bugs corrected in the code. The updated data is public and can be found here. It is the sum of inflation rate and unemployment rate in the Euro-zone area.

Continue reading

Spurious Regression Illustrated

Spurious Regression problem dates back to Yule (1926): “Why Do We Sometimes Get Nonsense Correlations between Time-series?”. Lets see what is the problem, and how can we fix it. I am using Morgan Stanley (MS) symbol for illustration, pre-crisis time span.  Take a look at the following figure, generated from the regression of MS on the S&P, actual prices of the stock, actual prices of the S&P, when we use actual prices we term it regression in levels, as in price levels, as oppose to log transformed or returns.

Continue reading

Piecewise Regression

A beta of a stock generally means its relation with the market, how many percent move we should expect from the stock when the market moves one percent.

Market, being a somewhat vague notion is approximated here, as usual, using the S&P 500. This aforementioned relation (henceforth, beta) is detrimental to many aspects of trading and risk management. It is already well established that volatility has different dynamics for rising markets and for declining market. Recently, I read few papers that suggest the same holds true for beta, specifically that the beta is not the same for rising markets and for declining markets. We anyway use regression for estimation of beta, so piecewise linear regression can fit right in for an investor/speculator who wishes to accommodate himself with this asymmetry.

Continue reading

OLS beta VS. Robust beta

In financial context, $\beta$ is suppose to reflect the relation between a stock and the general market. A broad based index such as the S&P 500 is often taken as proxy for the general market. The $\beta$, without getting into too much detail, is estimated using the regression: $$stock_i = \beta_0+\beta_1market_i+e_i$$ A $\widehat{\beta_1}$ of say, 1.5 means that when the market goes up 1% the specific stock goes up 1.5%. (Ignoring all the biases at the moment!)

Continue reading

Reducing Portfolio Fluctuation

THIS IS NOT INVESTMENT ADVICE.  ACTING BASED ON THIS POST MAY, AND IN ALL PROBABILITY WILL, CAUSE MONETARY LOSS.

Most of us are risk averse, so in our portfolio, we prefer to have stocks that will protect us to some extent from market deterioration. Simply put, when things go sour we want to own solid companies. This will reduce return fluctuation and will help our ulcer index against large downwards market swings. Large caps are such stocks. But which large caps should we chose? The squared returns are often taken as a proxy for the volatility so, keeping simplicity in mind, I use those.

Continue reading