# Archive for the ‘Finance’ category

## A Primer in Brownian Motion

February 26th, 2010
Brownian Motion

Image via Wikipedia

Every once in a while, my job affords me the opportunity to learn something really cool – granted in a very nerdy kind of way.  Recently, I learned one method for modeling stock prices and interest rates called Geometric Brownian Motion (first used in particle theory, but later used in financial instruments). This conversation might get a little technical, but I’ll start first with a conceptual description before moving into the math. For those who are uninterested in the nerdier parts of finance, feel free to skip this post

In theory, it is nearly impossible to predict what stock prices are going to be in the future – if someone knew, they would be very very very wealthy (or in jail for using illegal methods).  If you know of a legal way, let me know and we can quit our jobs and trade stocks for the rest of our lives! But just because stocks are unpredictable doesn’t mean there aren’t ways to try to figure out what these prices over time might look like, especially if you are trying hundreds or thousands of iterations to test for averages, highs, and lows. For instance, what are the odds that Microsoft’s stock price will hit 40, or the odds that it will hit 20? We do this by way of probability and statistics.

For instance, we can probably guess that a stock like General Electric will likely stay around the \$15-\$16 range that it’s been at for the last month.  Maybe there is a 50% chance that it rises a bit tomorrow, and maybe there is a 50% chance that it falls, but we can overwhelmingly say that it’s probably not going to drop to \$1.

Image via Wikipedia

To demonstrate this, lets take that GE stock and try to figure out what one path of stock prices over the next week might look like. Take out a coin and flip it: if it comes out heads, add \$0.25 to the price of GE’s shares, and if it comes out tails, subtract \$0.25. Now repeat this process 10 times. You should have a series of prices that looks somewhat plausible – perhaps GE’s price will trend upwards, or perhaps it will trend downwards, but more likely, it will look like what financial engineers call a “random walk“, or a seemingly random series of prices – sometimes moving up, sometimes moving down.

So, to start to define this better, we know that tomorrow’s stock price will likely equal today’s stock price plus or minus some small but random amount. Note that random is the key word here. Now, that’s just using a coin to figure out our probability of stock increases and decreases with a 50% chance of rising by a quarter, and a 50% chance of falling by a quarter. These are certainly not the only rises and falls that could happen, and things are hardly ever assigned a 50% probability.  For instance, what happens if the US government black lists GE and refuses to ever buy any GE products again? The stock would tank! A low probability, for sure, but it could happen.

Thus, we need a more sophisticated way of doing this. Luckily, statistics has something called a “Normal Distribution” which will provide us with more granularity than just a binary flip of the coin to figure out how stock prices might change. This will also allow us to factor in those seemingly low probability events (like GE tanking). A normal distribution looks something like this:

Image via Wikipedia

What this graph says is that most of the frequency data for a particular sample will cluster around the mean in the center (the symbol that looks like µ). As you get further and further away from the center and head to the extremes, the frequency of certain values becomes less and less. For instance, take the average height of a man, which is about 5′ 10″ in the US. Most guys you meet will probably be about 5’10″. There are going to be several that are 5′ 11″ or 5′ 9″, but you will very rarely find someone who is 5’1″ or 6’6″ – those people are on the extremes.

So to end the conceptual part of this discussion before getting into the modeling, to figure out one possibility tomorrows price,  we simply take today’s price and then add some normally distributed (around a mean of zero) change (be it 0 or -.1 or +2), and then repeat for the day after and so on.

An Example using Excel:

You’ll have 3 input’s to this model:

1. the current stock price
2. the standard deviation of the stock price ( =stdev(stockprices))
3. the time units for which you want to make this prediction (days or 1/360, weeks or 1/52 , months or 1/12, etc) – make sure to stay consistent between the units of time for 2 and 3.

Now your formula should look like this:

P1 =  P0 + Stdev * Sqrt(time) * normsinv(rand() )

What does this mean? To directly translate: take the standard deviation of the stock, multiply by the square root of time, then multiply by a random normally distributed number (the function rand() generates a random number of uniform distribution between 0 and 1 and normsinv takes this as a probability and maps that to a normal distribution – thus, if rand() returns .60, normsinv says, given a probability of 60% where does that fall on a curve with mean zero and standard distribution of one), and finally add this amount to today’s stock price.

The one thing that threw me off at first was the multiplication by the square root of time, however this is basically due to the standard deviation’s units being in price/(square root of time), so to cancel units you have to multiply by the same factor.

I’ve attached a sample Excel spreadsheet which demonstrates this process. Just hit F9 to see how the price of GE’s stock changes over time. Brownian Motion.xls

## Thoughts on Elance – Outsourcing to India

February 15th, 2010

Image via Wikipedia

For the last 3 weeks, I’ve been working with a firm out of India to help me with the design of my financial planning site.  So far, things are going relatively well, but there have been some bumps along the way. For those of you interested, here’s what to look out for.

Elance, for those who don’t know, is a site that connects freelancers with people in need of professional work.  I was able to post some basic specs, and a whole host of firms were able to bid on this work.

Choosing a Contractor

This really is going to be highly dependent on what you are looking for (and will seem a little discriminatory).  Keep in mind that you get what you pay for, so the better developers are  going to cost you more than \$20/hr. As per some basic discrimination, avoid all developers in the US who charge \$20/hr or less -cost of living alone in the US is phenomenally high compared to developing countries such that a similarly priced US and foreign firm will tell you something about what you will get back.  And if you are looking for something extremely high quality, avoid India and Pakistan.  Developers from this region are looking to cut corners and put something out as quickly as possible, regardless of quality. Something you also need to consider will be your own technical and product management skills. If you haven’t overseen a developer before, you might want to consider shelling out some more moolah.

Elance also provides samples of work from each firm, customer reviews, and a skill-set testing system so you can get a basic idea of what each firm can do. Before choosing a firm, make sure that the firm has taken Elance’s tests (instead of self rating which obviously is going to lead to arbitrarily high scores), and has received high marks from previous customers.

So why did I choose India?

Because the developer had ton a TON of work previously completed via Elance and had received mostly positive reviews. Also, per my own advice, I am getting a very alpha version out as quickly as possible so that I can test before I spend too much money. I’ve spec’d out what I consider a minimum viable product for initial feedback, and only once I feel we’ve developed a sustainable idea will I find a higher quality firm (or co-founder). Moreover there’s something to be said about having worked with Indian firms before, and having worked extremely closely with a wide variety of highly skilled developers here in the States.

My dream firm was this studly Ukrainian team that unfortunately would have cost me about 3 times as much. They were responsive, technically savvy, and honest about their qualifications and time needs. Sadly, for now I need something cheap and dirty, and am willing to sacrifice quality for cost effectiveness.

The Bumps

So far, communication has been the largest issue so far.  After I first selected the firm, when my project was being handed over from the marketing team to the developers, the firm stopped responding. Flat, cold stopped responding. I basically had to threaten to take my work elsewhere before someone got back to me and a flurry of activity began.  Luckily, the initial mockups of the homepage were of high enough quality to justify sticking with them.

My other issue with communication is around dialogue. I’m used to asking developers a question and getting an answer with a few options as well as a recommendation. This doesn’t occur with the Indians – instead, I ask “would this navigation work better horizontally instead of vertically?” and a day later they just respond “we have changed the navigation tabs”.

My last issue is one of quality. You can tell that some of the aesthetics are rushed, and often I have to ask for 4 or 5 iterations before something looks like it should’ve the first time. The code looks clean enough so far, mostly because I think they are using 3rd party open sourced plugins.  I’ll see how the custom code ends up looking, and hopefully that will be clean as well.

Final Thoughts

I’ll definitely follow up on this after the project is done, but so far so good. Here’s what I’ve learned:

1) Micromanage, micromanage, micromanage: you have to be on top of these guys day in and day out. Every week begins with me asking what the plan for the week is, and then for every iteration I critique and immediately send back my feedback. Typically, I hate to micromanage as I think it is hugely inefficient, but this is one of the exceptions to the rule.

2) Everything takes twice as long as you plan for: the typical adage is that it should cost twice as much as well, but this is a fixed bid. We’ll see about how much follow on work costs.

3) Know EXACTLY what you want: You can’t assume that the firm will go above and beyond to wow you, so you must have your project perfectly specified and planned.

## Lunch and Inspiration

January 8th, 2010
Image via Wikipedia

Just got back from lunch with a friend of mine named Zach Servideo. He introduced me to “The Black Sheep”, a restaurant located in an old Firehouse in Kendall Square which has phenomenal food. If you don’t know Zach, he’s a passionate PR professional who could befriend the most anti-social person in a room and turn them into an entrepreneur.  Needless to say, had Jeffrey Dahmer met Zach in the early 70′s, he would’ve started up a software company.

Zach is starting up a little side project called All White Kicks aimed at individuals interested in White Shoes. It’s a niche I would’ve never thought of, but with his passion, he can clearly make it work.

It also reminded me of my friend Alan who always has a few side projects going on. He’s experimenting with a few random AdSense pages such as My Reticulated Python and he’s also working on a niche site called The Curry Project, which aims to review every Indian restaurant in the world.

All of these side projects have inspired me, and I wanted to let you know about a new project I have called HapiMoney. Personal finance education is woefully inadequate and most people don’t know the first thing about where their money should go and in what amounts. I hope to shed some light on money management. Check it out and let me know if you have any ideas. Also, the name is awesome because Hapi is the Egyptian deification of the Nile flooding. This flooding helped water Egyptian crops and brought prosperity to the region.

These little projects also reminded me about one of the biggest mistakes that we ever made at WebNotes- we failed to follow the adage ” release early and release often”. The project was started in 2005 and wasn’t actually released to the public until 2008- 3 years of time which could’ve desperately used public feedback. But I’ll talk more about this in a future post.

## Getting drunk with Venture Capitalists

October 27th, 2009
Image by Vincent Ma via Flickr

Last Thursday, I had the immense pleasure of doing a little drinky drinky with some of the financial titans of industry at the 4th annual New England VC Wine Tasting. Dana Samuels of TUGG was kind enough to provide me with a complimentary ticket (they normally range about \$150), so I was much obliged.

Luckily, I happened to know quite a few people who showed up. There were about 6 people from fama PR whom it was awesome to see (Keri, Keith, Marta, Whitney, Zach, and Liz). If you don’t know fama and you’re in the tech inudstry, you should.  I also ran into Healy Jones of Startable fame, and the new VP Marketing at Pixily, who’s one of my more recent acquaintances.

From there I met an absolute hodge podge of characters ranging from VC’s who were bidding on \$5000 dollar cases of wine, to a clean tech entrepreneur who had just sold his \$200 million dollar business and miraculously had the chutzpah and energy of an 18 year old. In all, everyone was rather convivial and jolly, no doubt lubricated by the libations, and making random introductions was hardly a problem.

By the end of the night, I had probably consumed about 8 to 10 glasses of wine with nary a bite of food, so my memory gets a bit hazy,and as such, my desire to network diminished accordingly. All in all, it was a phenomenal time and a rather enjoyable experience…I hope to be at the next event. Good luck to Dana Samuels, Jeff Fagnan, et al. and of their aspirations with TUGG.

## Venture Capitalists and the myth of the anonymous business plan

October 11th, 2009

It’s a commonly held truism that venture capitalists don’t invest in an entrepreneur that hasn’t been introduced through their network. I’m sure that everyone has that one story of the entrepreneur who emails a firm on a lark and ends up with 5 million in financing.  The one I know of is that of Tony Hsieh who invested in Zappos after a message left on his voicemail. This is hardly the norm, and I’ve personally seen how hard it is to get ahold of investors.

So why is it that so many venture capitalists have links on their websites to “submit your business plan”? Does anyone actually do this? Is it to perpetuate the myth that these firms are approachable?

Here’s a better solution: use LinkedIn, or rather, this nice little mashup here. This bad boy will tell users how many people they know at your firm via their own networks. I think this could be phenomenally powerful if I were looking for financing and I got to your site and saw that by virtue of my connections, I knew 2 associates and a partner at your firm. Now I can get an intro and actually have my business plan heard, as opposed to dismissed out of hand.

## Competing with Hedge Funds

June 19th, 2008

A while ago I read an interesting quote from Google saying that because they can see searches in Real Time they are able to effectively see market trends long before the public consciously recognizes them. This struck me as really cool, so when I came across a Boston startup called Compete (www.compete.com), and saw that you could download data in regards to web analytics, I became pretty excited.  If page hits is covariant with web trends and consumer habits then Compete tells me that I should be able to predict the next web trends based on their data. I thus became curious if we could predict stock prices.

Therefore I took a sampling of 3 companies where I thought web hits would directly relate to economic success: Apple, Ebay, and Amazon.  The more people who visit these sites, the more transactions these companies are going to generate…or so the theory goes.  Further, one would hope that there is some sort of delay between site hits and stock price such that one could set up a stock portfolio and trade upon our non-public information (semi-strong theory of price efficiency).  Unfortunately, I’m slightly limited in the data that Compete provides (for non-paying, and or, cheap-skate, users), as they only have aggregated monthly numbers for 1 year. Thus, for a comparison, I averaged daily stock prices to get a monthly average.  This makes it increasingly difficult to separate noise out of visitor numbers and stock price, but hopefully the numbers can provide us a “trend” of sorts. Later on, to add robustness, I might look at the “Engagement” metrics that are provided to see if this can tell us anything…but for now, I’m lazy.

First: The basic overlay between stock price and site volumes.

From the graphs above its hard to tell if there is any causation, but there definitely seems to be a trend occurring and possibly correlation (Amazon at .39, Apple at .28 and Ebay at a negligible .10).  Although, the T-Stats, p-values and R squareds of each basic regression of price to volumes indicate that we can’t make any conclusion from a basic overlay.

However offsetting the price by 2 months increases the correlation pretty significantly by the following: Amazon at .72, Apple at .57 and Ebay at .75. (Offsetting means that Volumes from T-2 months prior are matched with Prices @ T 0)

Here are the results of a basic regression on the Offset Data:

You can see that our T-Stats are now meaningful, p-values are all great with the exception of Apple which is slightly higher than you would normally like, and R^2 show that half of the movement in price can be explained by site volumes.

Obviously, a much more rigorous analysis would need to be completed in order to prove anything, hopefully with much more data on many many more companies, but the preliminary results are kind of cool.  Maybe our next hedge fund will come from Compete. Oh, and btw, no secondary research was completed so its entirely possible that this study has been done before. Let me know if you’ve seen anything like it.