It is a fact that on most days, not much is going on in the stock market. When we estimate the relation of a stock with the market, or the “beta” of a stock, we use all available daily returns. … Continue reading →
It is a fact that on most days, not much is going on in the stock market. When we estimate the relation of a stock with the market, or the “beta” of a stock, we use all available daily returns. … Continue reading →
This post shows how to print a prettier nested pivot table, created using the {reshape} package (similar to what you would get with Microsoft Excel), so you could print it either in the R terminal or as a LaTeX table. This task is done by bridging between the cast_df object produced by the {reshape}...
I’ve been writing a fair amount of R recently and have been going through a good learning period, here are some functions that I’ve discovered (mainly plyr and reshape related) and thought I would share: merge_all is a good way to merge multiple different data frames, rather than multiple merge commands. The key thing...
I was a bit annoyed by the error when loading a dataset that contains multi-byte characters. R basically just chokes on them. I have not really understood the intricacies of this, but it was basically just an annoyance and since I did not really use these characters in the strings containing them, I just...
Previous post presented the problem of dishonest casino that ocassionally uses loaded die. Sequence of the real states is hidden, and we are trying to figure it out just by looking at the observations (symbols). If we apply our implementation to the data in the previous post, we can get the idea how well...
Last year, I covered a number of the so-called “Twitter protests” in China (#cn220), Iran (#25bahman), and Algeria (#fev12). Since these protests began in January 2011, the Arab Spring has claimed many members of both ruling and revolting groups … Continue reading →
The Multiple Factor Model can be used to decompose returns and calculate risk. Following are some examples of the Multiple Factor Models: The expected returns factor model: Commonality In The Determinants Of Expected Stock Returns by R. Haugen, N. Baker (1996) The expected returns factor model: CSFB Quantitative Research, Alpha Factor Framework on page...