Blog Archives

Visualizing Principal Components

December 22, 2012
By
Visualizing Principal Components

Principal Component Analysis (PCA) is a procedure that converts observations into linearly uncorrelated variables called principal components (Wikipedia). The PCA is a useful descriptive tool to examine your data. Today I will show how to find and visualize Principal Components. Let’s look at the components of the Dow Jones Industrial Average index over 2012. First,

Read more »

XLLoop examples

December 10, 2012
By
XLLoop examples

Today I want to follow up with the XLLoop framework post. Please read the XLLoop framework post first to setup the XLLoop before trying the examples below. My first example is based on the TFX Package – to retrieve real-time FX quotes. To try this example, please first install the TFX Package. Please note that

Read more »

XLLoop framework

December 7, 2012
By
XLLoop framework

Today I want to highlight the XLLoop framework : Excel User-Define Functions in in any language. The XLLoop consists of two main components: An Excel addin implementation (XLL written in c++). A server and framework written in R (or/and in many other languages). The XLLoop allows you to connect Excel and R in very simple

Read more »

TFX Package

December 5, 2012
By
TFX Package

Today I want to highlight the TFX Package created by Garrett See. TFX is an R Interface to the TrueFX(tm) Web API for free streaming real-time and historical tick-by-tick market data for dealable interbank foreign exchange rates with millisecond detail. Garrett provided a great tutorial, examples, and shiny application of TFX at http://rpubs.com/gsee/TFX Please note

Read more »

Financial Turbulence Example

December 1, 2012
By
Financial Turbulence Example

Today, I want to highlight the Financial Turbulence Index idea introduced by Mark Kritzman and Yuanzhen Li in the Skulls, Financial Turbulence, and Risk Management paper. Timely Portfolio did a great series of posts about Financial Turbulence: Part 1, Part 2, Part 3. As example, I will compute Financial Turbulence for the equal weight index

Read more »

Extending Commodity time series

November 21, 2012
By
Extending Commodity time series

I want to follow up with Extending Gold time series post by showing how we can extend Commodity time series. Most Commodity ETFs began trading in 2006, please see the List of Commodity ETFs page. I will use DBC – PowerShares DB Commodity Fund, one on the most liquid Commodity ETFs as my proxy for

Read more »

Regime Detection Pitfalls

November 14, 2012
By
Regime Detection Pitfalls

Today, I want to address some questions that I was getting regarding the Regime Detection post. In the Regime Detection post I showed an example based on the simulated data, and some of you tried to apply this example to actual stocks. There is one big problem that you have to be aware in designing

Read more »

Simulating Multiple Asset Paths in R

November 5, 2012
By
Simulating Multiple Asset Paths in R

I recently came across the Optimal Rebalancing Strategy Using Dynamic Programming for Institutional Portfolios by W. Sun, A. Fan, L. Chen, T. Schouwenaars, M. Albota paper that examines the cost of different rebablancing methods. For example, one might use calendar rebalancing: i.e. rebalance every month / quarter / year. Or one might use threshold rebalancing:

Read more »

Regime Detection

October 31, 2012
By
Regime Detection

Regime Detection comes handy when you are trying to decide which strategy to deploy. For example there are periods (regimes) when Trend Following strategies work better and there are periods when Mean Reversion strategies work better. Today I want to show you one way to detect market Regimes. To detect market Regimes, I will fit

Read more »

Modeling Couch Potato strategy

October 25, 2012
By
Modeling Couch Potato strategy

I first read about the Couch Potato strategy in the MoneySense magazine. I liked this simple strategy because it was easy to understand and easy to manage. The Couch Potato strategy is similar to the Permanent Portfolio strategy that I have analyzed previously. The Couch Potato strategy invests money in the given proportions among different

Read more »