Wednesday, February 13, 2013

Portfolio Update (6 months later)

My portfolio gains versus the S&P, Dow, and NASDAQ.
It's been about 6 months now after I bought my first round of stocks. Overall, my portfolio has performed consistently well and netted a total return of 12% so far, which amounts to about $600 of passive, tax-free income. In this post, I will summarize the results below with a bit of commentary.

First, let me go over my current portfolio as well as some positions that I've closed since my initial purchase.

Company Ticker Status % Gain
Cisco Systems Inc. CSCO Closed 16%
Citigroup Inc. C Closed 14%
Hewlett-Packard Company HPQ Open -3%
Intel Corporation INTC Open -8%
JetBlue Airways Corporation JBLU Open 21%
JPMorgan Chase & Co. JPM Closed 8%
Knight Capital Group Inc. KCG Open 24%
NRG Energy Inc. NRG Open 17%
Office Depot Inc. ODP Closed 14%
Pepco Holdings, Inc. POM Open 2%
PG&E Corporation PCG Open -7%
Safeway Inc. SWY Open 32%
Staples, Inc. SPLS Closed 9%
Xerox Corporation XRX Open 16%

As you can see, I closed positions in Cisco, Citigroup, JPMorgan Chase, Office Depot, and Staples.

Tuesday, September 18, 2012

Modeling Price Fluctuations

The premise of this post is that the movements in price of a security (e.g. stocks, bonds) can be viewed as a random process. Whether or not this is a valid assumption is somewhat of a philosophical question. The price of a security entirely depends on the factors of supply and demand, which are in turn deterministically governed by a multitude of more subtle factors. But like the outcome of a flip of a coin, which is completely determined by the equations of physics and the parameters of the system, such processes are much to complex to analyze in full generality. As a result, we model it as a stochastic process whose variance comes from all of these latent factors.

An illustration of random walks

Problem Statement and Assumptions

We are given the initial price \(P_0\) and we want to make inferences about the future stock price \(P_T\). The random variables \(P_i\) must also be non-negative. The time scale here is arbitrary and can be made as large or small as necessary.

Our key assumption here is that the changes in price are independent and identically distributed (iid). We characterize the price change as the ratio \[C_i = \frac{P_i}{P_{i-1}}\] Note that we didn't use a straightforward difference (\(P_i-P_{i-1}\)). The reason is because the difference most certainly isn't iid (a price of $1 has support on \([-1,\infty]\) whereas a price of $2 has support on \([-2,\infty]\)). You'll notice that our characterization corresponds to a percentage difference (plus one).

The Normal Distribution

The normal distribution (also known as the bell curve, the Gaussian, etc.) is ubiquitous in modeling random variables. And so it would be reasonable to conjecture that \(P_T\) is normally distributed. \[ f_{\mu,\sigma^2}(x) = \frac{1}{\sqrt{2\pi \sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}} \]
The normal distribution

However in a similar vein as to why we didn't use the difference in price as our characterization of change, the normal distribution doesn't have the correct support. If we had used the distribution as our model, we would have found that the model would assign a positive probability to the future price being less than 0.

Logarithms to the Rescue

Okay, let's actually do the math without resorting to guessing. The price \(P_{1}\) can be expressed as \(C_1 \times P_0\), and \(P_{2}\) as \(C_2 \times P_1\), and so on. Inductively continuing this process yields \[ P_T = C_T C_{T-1} \dots C_1 P_0 \] Thus we have that \(P_T\) is proportional to the product of \(T\) iid random variables. The trick is to turn this product into a sum so then we can apply the central limit theorem. We do this by taking the logarithm of both sides \[ \begin{align*} \log P_T &= \log(C_T C_{T-1} \dots C_1 P_0) \\ &= \log C_T + \log C_{T-1} + \dots + \log C_1 + \log P_0 \\ &\thicksim N(\mu,\sigma^2) \end{align*} \] Since the \(C_i\)s are iid, their logarithms must also be iid. Now we can apply the central limit theorem to see that \(\log P_T\) converges to a normal distribution! The exponential of a normal distribution is known as the log-normal distribution so \(P_T\) is log-normal. \[ g_{\mu,\sigma^2}(x) = \frac{1}{x\sqrt{2\pi \sigma^2}}e^{-\frac{(\log x-\mu)^2}{2\sigma^2}} \]
The log-normal distribution

As a sanity check, we see that the support of the log-normal is on \((0,\infty]\) as expected.

But wait there's more!

In the beginning we noted that the choice of time-scale is arbitrary. By considering smaller time scales, we can view our \(C_i\)s as the product of finer grained ratios. Thus by the same argument as above, each of the \(C_i\)s must also be log-normally distributed.

Experimental Results

I took ~3200 closing stock prices of Microsoft Corporation (MSFT), courtesy of Yahoo! Finance from January 3, 2000 to today. I imported the data set into R and calculated the logarithms of the \(C_i\)s. I then plotted a normalized histogram of the results and overlaid the theoretical normal distribution on top of it. The plot is shown below:


Discussion

As you can see, the theoretical distribution doesn't fit our data exactly. The overall shape is correct, but our derived distribution puts too little mass in the center and too little on the edges.

We now must go back to our assumptions for further scrutiny. Our main assumption was that the changes are independent and identically distributed. In fact, it has been shown in many research papers (e.g. Schwert 1989) that the changes are not identically distributed, but rather vary over time. However, the central limit theorem is fairly robust in practice. Especially under a sufficiently large of samples, each "new" distribution will eventually sum to normality (and the sum of normal distributions is normal).

I suspect that the deviation from normality is primarily caused by dependence between samples. The heavy tails can be explained by the fact that a large drop/rise in price today may be correlated to another drop/rise in the near future. This is particularly true during times of extreme depression or economic growth. A similar argument can be made about the excess of mass in the center of the distribution. It is conceivable that times of low volatility will be followed by another time of low volatility.

Conclusion

While our model might not be perfect in practice, it is a good first step to developing a better model. I think what you should take from this is that it is important to experimentally verify your models rather than blindly taking your assumptions as ground truths. I'll conclude this post with a few closing remarks:
  • Many people actually do use the normal distribution to model changes in prices despite the obvious objections stated above. One can justify this by noting that the distribution of \(C_i\) in practice is usually close to 0. Thus the first order approximation \(e^x \approx 1+x\) is fairly accurate.
  • The histogram and fit shown above can be reproduced for almost any stock or index (e.g. S&P 500, DJIA, NASDAQ)
  • R is a great piece of software but has god awful tutorials and documentation. I am not in a position to recommend it yet because of this.

Friday, August 31, 2012

Valuation Techniques: Liquidation value

This is part of a series on valuation techniques.

When we talk about the value of a company, there are two fundamental components associated with it: assets and income. Very simplistically, we can view a company as a black box holding assets that grow over time in a stochastic manner.

I will define the liquidation value of a company as the net worth of a company's tangible assets in event of a bankruptcy.

How it useful?

Unfortunately, liquidation value isn't an accurate measurement of the intrinsic value of a company. Then how is it at all useful to an investor?

Neither accuracy nor precision are necessary conditions to make a profit in investing. The only necessary condition to successful investing is arbitrage. As long as we can buy a security for less than what it's worth, a profit can be made. Even if we don't know precisely what a security is worth, we need only to establish sufficiently tight lower bounds on the price to determine if it is a worthwhile investment.

That is exactly what the liquidation value is meant to provide. While it is difficult to predict the future earnings of a company, we still have a lower bound given by what the company currently holds. These figures are reported regularly on the balance sheet in financial statements.

Valuation Techniques

Investing ultimately comes down to the ability of an individual to value a company and the associated risks of such a valuation. There are hundreds of different models and techniques in use today, both simple ones devised by humans and enormously complex ones used in algorithmic trading.

I don't believe that there is one magic, all-encompassing, algorithm that will perform optimally in all (or even most) scenarios. The issue is that every company has a different business model, each of which would require a different model for valuation. This task is rather intractable, and so it is the job of the investor to be able to create robust models that hold under reasonable approximations. In addition, he must be able to understand which approximations hold for which businesses, and use the appropriate model.

Many present models involve looking at one aspect of a business, such as dividends, cash flow, earnings, etc. From these, you can derive dividend discount model, discounted cash flow, and P/E relative valuations, respectively. But naturally, these are rather crude in the sense that they don't look at all of the variables. And combining different valuation schemes is a non-trivial process.

In this series of articles, I will start with a set of assumptions and derive some models for valuation using these approximations. This post will be edited as articles are added.
  1. Liquidation value
  2. Dividend Discount Model

Tuesday, August 28, 2012

Hewlett-Packard (HPQ) Qualitative Analysis

Over the past week, Hewlett-Packard Company (ticker: HPQ) has fell over 17% to the current price of $16.83 per share. This drop was largely due to the company's recent 2012 Q3 earnings report released after hours on August 22, where they reported a net earnings loss of 8.9B.
The PC isn't going away any time
soon

On the surface, I think it is quite natural to feel grim about the company's prospects after such a dramatic loss. In my personal portfolio, if I had sold my shares before the earnings report, I would have realized a 12% gain, whereas now I am sitting on a 7% loss. So while emotionally I am obviously not happy with the turn of events, that should not impact the underlying analysis on which I base my trades.

In fact, it is precisely bear-ish sentiments like these that give investors arbitrage opportunities like this.

As such, I stick by original positive prospects for HP and would buy even more shares if I had the cash and sufficient diversification to do so. Here is why:

Thursday, August 23, 2012

Value vs. Growth Investing

If you have done any research on stocks, mutual funds, etc., you have probably heard the terms value stocks and growth stocks. These two adjectives are used to describe the underlying motivation and strategy for investing in a particular security. Many (if not most) investors and the media portray these two as distinct camps with clashing investment ideologies.

Benjamin Graham (1894-1976) is hailed as the
father of value investing
Proponents of value investing favor low priced stocks, selling below their intrinsic value. Typical characteristics of value stocks are low price/earnings (P/E), price/book (P/B), and high dividends. The idea is that over time, the overall market will realize that the stock is undervalued and correct itself accordingly. As such, it is associated long term investors.

On the other hand, growth investing is a matter of investing in companies with higher than expected growth rates. The premise is that the stock price reflects the opinions of Wall Street analysts on earnings and cash flow. If the company beats these expectations, then the stock price will move up. In order to facilitate high earnings growth, these stocks typically have low or no dividend yields.

Tuesday, August 21, 2012

Day trading and why you shouldn't do it

Day trading is when you try to take advantage of the intraday fluctuations in prices of financial instruments like stocks and bonds. The idea is that even though the overall daily price may decrease, the price will increase at some points throughout the day. If a trader can time his buys right before the increases and sell right before it starts decreasing, he can make a profit.

Consider the following intraday time series for a stock:


Overall, the stock price dropped from $10 to $8, a 20% loss. However, an omniscient investor could in theory buy the stock at 10 AM, sell at 11 AM, buy again at 1 PM, sell at 2 PM, buy at 3 PM, and finally sell at 4 PM. The net result is a $3/share, a 30% gain.

This kind of arbitrage can almost always occur, regardless of market conditions or time scale. This is because while the overall trends are consistent and can be predictable, the small fluctuations caused by people buying and selling shares is inevitable. There will almost always be both buyers and sellers throughout the day and if at any given point the number of supply exceeds the demand, the price will go up temporarily.

Obligatory Disclaimer

The author is not a financial adviser, tax accountant, or lawyer and disclaims any and all liability for the contents of this blog. The information reflects the author's personal research and experience, which may contain errata.