September 2018 – Applying AI: Transforming Finance, Investing, and Entrepreneurship

Bobby Axelrod, the main character on the popular Finance drama, Billions, is a lot like Tesla CEO Elon Musk. They’re both billionaires. They both draw substantial public praise and criticism and are highly divisive figures who have a large impact on their respective industries. They were also both investigated and charged by the SEC (and in Axelrod’s case, the US Justice Department) for actions related to securities law. The main difference between the two? Bobby Axelrod is a fictional character whose proclivity for conflict is only superceded by his complete lack of restraint when his life and freedom are on the line. In real life, the consequences of your actions are permanent and making deals in the business world often means compromising, negotiating, and settling.

Today (September 29, 2018) Elon Musk settled with the SEC. He will no longer be chairman of Tesla, for at least three years, and will pay a fine in excess of $20 Million. In all, it is a relatively lesser penalty than the lifetime ban from being CEO of a publicly traded company that the SEC was seeking. It is also a larger punishment than someone who has not committed any wrongdoing deserves. Depending on your perspective, Musk either got away easy or was unfairly chastised by the state for a 60 character tweet.

Of course, the civil settlement does not preclude the Justice Department from filing criminal charges against Elon at a future date. However, a criminal trial has a much higher burden of proof than a civil case, which can be decided based on a balance of probabilities. In a criminal case, the prosecution must prove, beyond a reasonable doubt, that the defendant committed the alleged crimes, whereas, in a civil suit, all that is required is a greater than 50% probability that the act took place.

In a previous post from September 27, we discussed whether AI could play a role in predicting the outcome of cases like this, perhaps assisting traders in making appropriate investment decisions surrounding companies with legal troubles. Despite a strong performance in short-term volume trading, automation has not yet played a large role in the fundamental analysis of a stock’s long-term viability. Most AIs that trade today are relying on purely technical analysis, not looking at any of the traits that make a company likely to succeed, but instead relying on historical price data to predict trading and movement patterns.

Fundamental analysis is complex and subjective. Even the smartest deep neural networks would have a difficult time distinguishing between the very human aspects that go into valuing a company. The problem with AI, in this particular application, is that it would require a broad knowledge of various domains to be combined in order to predict with any degree of accuracy. Right now, even the best deep neural networks are still very narrowly defined. They are trained to perform exceptionally well within certain contexts, however, beyond the confines of what they ‘understand’ they are unable to function at even a basic level.

Screenshot 2018-09-29 19.52.57.png
Complexity in neural networks results in ‘overfitting’ – networks specify the training set well but fail at more generalized tasks.

In the above example, we can see how more complicated neural networks might fail to understand topics that are even slightly different from what they have seen in the past. The model fits the data that the network has already encountered, however, this data does not reflect what could happen in the future. When something happens that they haven’t encountered before (a CEO tweets something about 420, for example), a human can immediately put that into context with our everyday experience and understand that he’s likely talking about smoking weed. However, an AI trained to predict share prices based on discounted cash flow analysis would have absolutely no clue what to do with that information.

It is likely that there are companies working on technology to help train neural networks to deal with the idiosyncratic information present in everyday business interactions. One possible answer is to have multiple neural networks working on different subsets of the problem. Similar to how deep neural networks have enabled advances in fields ranging from medical diagnosis to natural language processing, new organizations of these systems could enable the next generation of AI that is able to handle multiple tasks with a high level of competency. As we continue to build this technology, we’ll keep speculating on whether or not an executive is guilty, and traders and short-sellers will continue to make and lose billions based on the result.

The True Cost of an MBA – Applying AI

Everything has an opportunity cost. An MBA, for example, costs about fifty to eighty thousand dollars, but that’s just the face value. It turns out, by taking two years off of work to go to school, you are also sacrificing the earnings you could have had from those two years, not to mention any promotions, raises or job experience that would have come along with it. If we’re thinking about lifetime earning potential, we can calculate the incremental earnings that you’d need from the MBA in order to break-even on the investment. Of course, all of these calculations should always be done ex-ante (prior to enrollment) because otherwise, we’re falling prey to the sunk-cost fallacy, and that will only make us regret a decision we’ve already made.

For example, let’s say that your MBA will cost $75,000 up front and that you are currently making $50,000 per year annually at your current job. What incremental salary increase would you need in order to account for the opportunity cost of the MBA?

First, we have to calculate an appropriate discount rate for our money. In this case, we can probably use r_m , the market’s rate of return because if we choose not to put the money towards an MBA, we could instead put it in an Index Fund or another similar investment vehicle, where it would grow at around the market interest rate.

Source: Market-Risk-Premia.com

Based on the July 2018 numbers, the market risk premium is about 5.38%. Notice that we didn’t just use the Implied Market Return of 7.69%, this is because we need to subtract the Risk-free rate r_f in order to account for the incremental risk.

Let’s round down to 5% for simplicity. Assuming we’re starting our MBA in January of 2019 and Finishing in December of 2020 (2 years) with a cash outflow of $37,500 in 2019 and 2020 and sacrificed earnings of $50,000 in each of those years. We can calculate the future value (FV) of that money in 2021 as follows:

Future Value of Annuity Formula
Future Value of an Annuity

Our periodic payment, P , is $87,500, our discount rate,r , is 5% and our number of periods, n , is 2. That leaves us with the following:

FV = \$87,500*[((1+0.05)^2-1)/0.05]  = \$179,375

Assuming we’re able to land a job on day 1 after graduation, how much more do we have to make in our careers to make up for the opportunity cost of the MBA? For that, we can use another annuity formula to calculate the periodic payment required over a given number of years to equal a certain present-value amount.

Annuity payment formula

Let’s say that we will have a 30-year career and that our market risk premium stays the same at 5% (the historical average for Canada is closer to 8%, however, let’s be conservative and stick with 5%). Substituting in these values to our formula with PV = $179,375 r = 5% and n = 30, we find that the payment, P, is:

P = {0.05*\$179,375}/{ 1 - (1+0.05)^{-30}} = \$11,670

So, we need to make an additional $12,000 per year every year for the rest of our careers, because of the MBA, in order to make up for the opportunity cost of the program.

If that seems realistic to you, maybe you should consider an MBA.

Of course, if we’re being really clever, we should probably also include a risk premium for our MBA. There is not a lot of data out there to suggest what the probability of completing an MBA is, but we can assign some probabilities to our equation for reference. Let’s say that there’s a 60% chance that the market will be strong when we complete the MBA and we’re able to find a job that pays $62,000 per year right out of the MBA program. There is also a 20% chance that we’ll make the same amount as we made before the MBA program $50,000 per year, a 10% chance that we’ll make $75,000 per year after the program and a 10% chance that the market for MBAs tanks and we’ll make below $40,000 per year when we graduate.

Expected Value = 0.6 * \$62,000 + 0.2 * \$50,000 + 0.1 * \$75,000 + 0.1 * \$40,000 = \$58,700

How do we make a decision with all these different possible outcomes? Simply multiply the probabilities by the annual salaries and add them together to find the probable result. If these numbers are correct we’re looking at an equivalent salary of $58,700 per year coming out of the MBA program. Of course, these numbers are completely made-up, but if we find numbers like these in our real-world evaluation, the logical decision from a financial perspective would be to reject doing an MBA because the cost is outweighed by the potential gains.

According to PayScale, the average salary in Calgary for an MBA with a finance specialization is $87,500 per year, but the average salary for someone with a bachelor of science degree is over $75,800 per year. Based on these numbers, it might not make sense for someone with a science degree to do an MBA.

Of course, there are other intangible factors that come into play including career preferences, lifestyle, and happiness. These are all important and should definitely be factored into your decision.

Graphs and iPads are an important part of any MBA

Yes, this is a very hard decision to make but can machine learning algorithms help make these decisions easier for us? It should be possible to use machine learning algorithms to predict future earnings potential and even take into account qualitative variables like career preferences and working style to give us a better idea of which choices might be right for us.

It is my goal to understand the capabilities of machine learning models to assist in these types of financial predictions. Hopefully, in the next few weeks, I’ll have an update for you on whether this type of predictive capability exists and if it does, how to access it.

For now, good luck with your decision making! I did an MBA and I don’t regret it at all because it was the right decision for me. My hope is that this article has given you the tools to decide whether the decision might be right for you.

The True Cost of an MBA – Applying AI

Everything has an opportunity cost. An MBA, for example, costs about fifty to eighty thousand dollars, but that’s just the face value. It turns out, by taking two years off of work to go to school, you are also sacrificing the earnings you could have had from those two years, not to mention any promotions, raises or job experience that would have come along with it. If we’re thinking about lifetime earning potential, we can calculate the incremental earnings that you’d need from the MBA in order to break-even on the investment. Of course, all of these calculations should always be done ex-ante (prior to enrollment) because otherwise, we’re falling prey to the sunk-cost fallacy, and that will only make us regret a decision we’ve already made.

For example, let’s say that your MBA will cost $75,000 up front and that you are currently making $50,000 per year annually at your current job. What incremental salary increase would you need in order to account for the opportunity cost of the MBA?

First, we have to calculate an appropriate discount rate for our money. In this case, we can probably use r_m , the market’s rate of return because if we choose not to put the money towards an MBA, we could instead put it in an Index Fund or another similar investment vehicle, where it would grow at around the market interest rate.

Source: Market-Risk-Premia.com

Based on the July 2018 numbers, the market risk premium is about 5.38%. Notice that we didn’t just use the Implied Market Return of 7.69%, this is because we need to subtract the Risk-free rate r_f in order to account for the incremental risk.

Let’s round down to 5% for simplicity. Assuming we’re starting our MBA in January of 2019 and Finishing in December of 2020 (2 years) with a cash outflow of $37,500 in 2019 and 2020 and sacrificed earnings of $50,000 in each of those years. We can calculate the future value (FV) of that money in 2021 as follows:

Future Value of Annuity Formula
Future Value of an Annuity

Our periodic payment, P , is $87,500, our discount rate,r , is 5% and our number of periods, n , is 2. That leaves us with the following:

FV = \$87,500*[((1+0.05)^2-1)/0.05]  = \$179,375

Assuming we’re able to land a job on day 1 after graduation, how much more do we have to make in our careers to make up for the opportunity cost of the MBA? For that, we can use another annuity formula to calculate the periodic payment required over a given number of years to equal a certain present-value amount.

Annuity payment formula

Let’s say that we will have a 30-year career and that our market risk premium stays the same at 5% (the historical average for Canada is closer to 8%, however, let’s be conservative and stick with 5%). Substituting in these values to our formula with PV = $179,375 r = 5% and n = 30, we find that the payment, P, is:

P = {0.05*\$179,375}/{ 1 - (1+0.05)^{-30}} = \$11,670

So, we need to make an additional $12,000 per year every year for the rest of our careers, because of the MBA, in order to make up for the opportunity cost of the program.

If that seems realistic to you, maybe you should consider an MBA.

Of course, if we’re being really clever, we should probably also include a risk premium for our MBA. There is not a lot of data out there to suggest what the probability of completing an MBA is, but we can assign some probabilities to our equation for reference. Let’s say that there’s a 60% chance that the market will be strong when we complete the MBA and we’re able to find a job that pays $62,000 per year right out of the MBA program. There is also a 20% chance that we’ll make the same amount as we made before the MBA program $50,000 per year, a 10% chance that we’ll make $75,000 per year after the program and a 10% chance that the market for MBAs tanks and we’ll make below $40,000 per year when we graduate.

Expected Value = 0.6 * \$62,000 + 0.2 * \$50,000 + 0.1 * \$75,000 + 0.1 * \$40,000 = \$58,700

How do we make a decision with all these different possible outcomes? Simply multiply the probabilities by the annual salaries and add them together to find the probable result. If these numbers are correct we’re looking at an equivalent salary of $58,700 per year coming out of the MBA program. Of course, these numbers are completely made-up, but if we find numbers like these in our real-world evaluation, the logical decision from a financial perspective would be to reject doing an MBA because the cost is outweighed by the potential gains.

According to PayScale, the average salary in Calgary for an MBA with a finance specialization is $87,500 per year, but the average salary for someone with a bachelor of science degree is over $75,800 per year. Based on these numbers, it might not make sense for someone with a science degree to do an MBA.

Of course, there are other intangible factors that come into play including career preferences, lifestyle, and happiness. These are all important and should definitely be factored into your decision.

Graphs and iPads are an important part of any MBA

Yes, this is a very hard decision to make but can machine learning algorithms help make these decisions easier for us? It should be possible to use machine learning algorithms to predict future earnings potential and even take into account qualitative variables like career preferences and working style to give us a better idea of which choices might be right for us.

It is my goal to understand the capabilities of machine learning models to assist in these types of financial predictions. Hopefully, in the next few weeks, I’ll have an update for you on whether this type of predictive capability exists and if it does, how to access it.

For now, good luck with your decision making! I did an MBA and I don’t regret it at all because it was the right decision for me. My hope is that this article has given you the tools to decide whether the decision might be right for you.

Project Management – Applying AI: Transforming Finance, Investing, and Entrepreneurship

The best-kept secret of financial professionals is that it’s actually pretty easy to value a company, that is, decide how much you should be willing to pay for the business or its shares. My goal is to automate this process using machine learning algorithms to select the appropriate data and apply the formulas in the correct manner. This level of sophistication is still a few months (years?) away, at least by my skillset. For now, we’re going to cover the basics of project valuation via the discounted cash flow (DCF) methodology. Later on, we’ll see if we can get a computer to do the calculations for us.

Note: I’ll be using the terms company and project interchangeably here. However, for companies in more than one industry or market segment, you’ll need to use multiple discount rates because the Beta (systematic risk of the segment divided by the market risk) will vary depending on the industry.

You can probably find a lot of the information that I’m about to disclose (or all of it) in an introductory finance textbook or even from a free resource like Investopedia. That’s fine. Lots of people do not choose to read textbooks or financial-wiki sites in their free time, so I’m going to go over the basics here if you’re interested in the subject, but not quite interested enough to open a book.

Here we go. Are you ready?

All that is needed to value a company is:
    1.  Some revenue projections,
    2.  Some cost projections,
    3.  An appropriate discount rate (or cost of capital) for the company

That’s it!

Obviously, these things can be easy or very difficult to come by depending on several factors including the type of company (or project), the stability of the market, and the quality of the information available about the business.

Let’s assume //quite a big assumption, but hey, that’s what we’re going to do right now// that you’re able to come up with some reasonable revenue and cost projections for the business that you want to value and that you’re able to calculate an appropriate WACC (Weighted Average Cost of Capital) or discount rate.

Then what do you do?

Basically, you take the company’s projected revenue over a given period (let’s say every year for 5 years), subtract the cash costs on the business in each year and you’ve got the company’s Free Cash Flows (we’re skipping a few steps here like subtracting taxes, adding back depreciation, and subtrac

ting Capital Expenditures (CapEx) and changes in Net Working Capital, but we’ll save those for later).

Here’s an example of a company with some projected revenue and some projected costs going out 5 years:

Year 0 1 2 3 4 5
Revenue $20,000 $20,000 $20,000 $20,000 $20,000
Costs ($50,000) ($5,000) ($5,000) ($5,000) ($5,000) ($5,000)
Cash Flows ($50,000) $15,000 $15,000 $15,000 $15,000 $15,000

Next, we take the free cash flows that we calculated above, and we discount each of them by an appropriate ‘discount factor’ that we calculate using our discount rate.

Where: r is the discount rate and n is the period (or year)

All of my finance professors are about to roll over in their beds right now (they’re not dead), but let’s say the discount rate that we found for the company is 10%. Here’s what we end up with for the discount factor over the 5-year period.

Year 0 1 2 3 4 5
Revenue $20,000 $20,000 $20,000 $20,000 $20,000
Costs ($50,000) ($5,000) ($5,000) ($5,000) ($5,000) ($5,000)
Cash Flows ($50,000) $15,000 $15,000 $15,000 $15,000 $15,000
Discount Factor         1.00        0.91        0.83        0.75        0.68        0.62
Discount Rate 10%

Now we just multiply our free cash flows by the discount factor for each year to get the present value (PV) of the future cash flows. Once we have the PV of the cash flows, we can add them all together to find out what the project is worth to us, also known as the project’s NPV or Net Present Value.

Year 0 1 2 3 4 5
Revenue $20,000 $20,000 $20,000 $20,000 $20,000
Costs ($50,000) ($5,000) ($5,000) ($5,000) ($5,000) ($5,000)
Cash Flows ($50,000) $15,000 $15,000 $15,000 $15,000 $15,000
Discount Factor               1.00              0.91              0.83              0.75              0.68            0.62
PV Cash Flows ($50,000) $13,636 $12,397 $11,270 $10,245 $9,314
Project NPV $6,862
Discount Rate 10%

If you want a primer on what present value means, and what the time-value of money represents, here’s a good video on it from Khan Academy:

That’s it! We’ve valued a business. We now know that if this company was only going to operate for five years, and then cease to exist, that it would be worth about $6,800 to us in our pocket today.

In general, we accept projects that have a positive NPV and reject projects that have a negative NPV. I’ll cover the reasons for this in another post down the line. For now, at least, we are able to value a company given only its revenue, costs, and an appropriate discount rate. Things are going to get a lot more complicated from here so enjoy the simplicity while it lasts.

Applying AI – Page 4 – Where and how to put AI to use – Applications in Finance, Engineering, Business and more!

If you’ve ever looked into what it takes to become a developer of AI software, you probably know that Python is the language of choice for 95% of Machine Learning applications out there.

So, why Python? It’s not super easy to learn. Students can learn graphical programming languages like Apple’s Swift much faster. It’s not the speediest. There are other programming languages that are better optimized to develop the GPU and CPU intensive tasks that Machine Learning software requires. Unfortunately, it’s not even the most ubiquitous (for applications outside of machine learning and data science). Many programmers are much more familiar with Javascript for web development. It is free, so it does have that going for it.

Here’s what Quora has to say about it:

“…it is a general language that does a little of everything at a good enough complexity-performance tradeoff with a full suite of tools for productionizing machine learning.”

Thia Kai Xin, Head of Data (Tech In Asia), Co-Founder of DataScience SG.

Essentially, Python is effective enough to get the job done. Major companies like Google, Facebook, and Uber all use Python for the majority of their ML software development, so that helps. If you want a job at a major tech company, and you want to develop artificial intelligence applications, you’ll probably need to understand Python pretty well.

So, what can Python do? It’s built on an open-source licence, so there’s no need to worry about licensing fees. Python comes pre-installed on all Apple desktops and can be easily installed on Windows or Linux builds. The latest version of Python (Python 3.7) can be easily integrated with mathematical packages like NumPy and with clever development visualization tools like Jupyter Notebooks.

“The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.”

Project Jupyter – jupyter.org

There are many, many online and in-person courses available that teach Python, including many free and low cost options. Udacity offers a free intro to Python course that you can sign up for right now. 

Python is easy to learn and powerful. It’s accessible to pretty much anyone with a computer and there are lots of ways to get started. Here’s an example of what you can do with Python in only a few days of practice:

Using only freely available libraries and packages, along with some tutelage from Udacity’s AI Programming Fundamentals program, a student can learn to program a deep-neural-net, a type of machine learning tool, that is able to distinguish images of various types of animals, including dog breeds, with a high degree of accuracy. That’s pretty amazing. Someone with limited programming experience can learn how to build their own AI program in less time than it takes to fail your first University midterm.

If you’re interested in programming these types of tools or if you’re curious about how they work, I highly suggest you head over to the 3 Blue 1 Brown YouTube channel and watch his videos on Neural Networks. The animations are world-class and the topics are simplified enough to be understood but still cover the topic in great depth. I’ve linked the first video in the series below and I can’t recommend the channel enough.

So where is this all going and what applications does this have for people in finance?

Using the tools described above, I have already created software that tracks the share price of several tech giants and tries to predict their short-term market performance. Mind you, I have about a decade of software development experience, but nearly all of my experience is outside of the machine learning space.

Python is a great tool for experienced programmers and beginners alike to build some amazing software. Try it out for yourself, and when you get hooked, don’t blame me when you inevitably find yourself up past midnight solving the world’s problems one line of code at a time.