Financial Modeling
Financial Modeling
Financial Modeling
Financial modeling is the task of building an abstract representation (a model) of a financial decision-making situation. This is a mathematical model designed to represent (a simplified version of) the performance of a financial asset or portfolio of a business, project, or any other investment. Financial modeling is a general term that means different things to different users; the reference usually relates either to accounting and corporate
finance applications, or to quantitative finance applications. While there has been some debate in the industry as to the nature of financial modeling - whether it is a tradecraft, such as welding, or a science - the task of financial modeling has been gaining acceptance and rigor over the years. Typically, financial modeling is understood to mean an exercise in either asset pricing or corporate finance, of a quantitative nature. In other words, financial modeling is about translating a set of hypotheses about the behavior of markets or agents into numerical predictions; for example, a firm's decisions about investments (the firm will invest 20% of assets), or investment returns (returns on "stock A" will, on average, be 10% higher than the market's returns). In corporate finance, investment banking and the accounting profession financial modeling is largely synonymous with cash flow forecasting. This usually involves the preparation of detailed company specific models used for decision making purposes and financial analysis. Applications include:
Business valuation, especially discounted cash flow, but including other valuation problems Scenario planning and management decision making ("what is"; "what if"; "what has to be done")
Capital budgeting Cost of capital (i.e. WACC) calculations Financial statement analysis (including of operating- and finance leases, and R&D) Project finance. Thus a financial model is designed to represent in mathematical terms the relationships among the variables of a financial problem so that it can be used to answer what if questions or make projections. Some of the spreadsheet solutions that people create capture
1|Page
some of these relationships as well and, therefore, can answer what if questions to some extent. But because they are not primarily designed with these objectives in mind, they do not try to capture as many of these interdependencies as possible, and their structures often make it cumbersome to answer what if questions or make projections with them.
In quantitative
finance, financial
modeling entails
the
development
of
sophisticated mathematical model. Models here deal with asset prices, market movements, portfolio returns and the like. A key distinction is between models of the financial situation of a large, complex firm or "quantitative financial management", models of the returns of different stocks or "quantitative asset pricing", models of the price or returns of derivative securities or "financial engineering" and models of the firm's financial decisions or "quantitative corporate finance". Applications include:
Option pricing and calculation of their "Greeks. Other derivatives, especially Interest rate derivatives and Exotic derivatives Modeling the term structure of interest rates (short rate modeling) and credit spreads Credit scoring and provisioning Corporate financing activity prediction problems Portfolio problems Real options Risk modeling and Value at risk. These problems are often stochastic and continuous in nature, and models here thus require complex algorithms, entailing computer simulation, advanced numerical methods (such as numerical differential equations, numerical linear algebra, dynamic programming) and/or the development of optimization models. The general nature of these problems is discussed under Mathematical finance, while specific techniques are listed under Outline of finance: Mathematical tools.
2|Page
In creating financial models, you always have to keep in mind that you want to capture as many of the interdependencies among the variables of the model as possible. In addition, you want to structure your models in such a way that it is easy to ask what if questions, that is, change the values of the independent variables and observe how they affect the values of the key dependent variables. You also should recognize that some of the relationships, as in the case of taxes, are easy to establish and exact; but many others will be approximate or even unknown. You will have to come up with them based on financial theory, analysis of data, and so on, and coming up with these relationships is one of the major challenges of financial modeling. Generally, the more of these relationships you can come up with and incorporate into your model, the more useful your model will be.
3|Page
significant edge in all these respects. The problem that most people have with VBA is that it is one more thing to learn, and they are somehow afraid of trying to learn a programming language. The reality is that if you follow the right method, learning a programming language is not particularly difficultespecially if you selectively learn what you will really use (as we will do in this book) and not let yourself get lost in all the other things you can do with VBA but probably never will. The truth is that you do not need to learn all that much to be able to create very useful and powerful financial models with VBA. What you will need is a lot of practice, which you will get as you go through this book. VBA offers you the best of both worlds: you can take advantage of all the powers of Excel including its ability to easily create excellent outputs, and supplement them with VBAs additional tools and flexibility.
dependent variables. Some of them may be intermediate variables, calculated for use in other calculations. Others are of primary interest to the user and are the output variables of the models. Models are almost always created to observe how the values of the output variables will change with changes in the values of one or more independent variables. Dependent variables are the ones whose values we want to project or determine when we ask what if questions. It is possible to distinguish between intermediate dependent variables and output dependent variables; intermediate dependent variables are used in further calculations, whereas output dependent variables are not. This is generally not a useful distinction, however. It is better to look at the dependent variables of primary interest as the output variables of the model irrespective of whether they are used in further calculations. One must also recognize that, from time to time, some dependent variables that were previously not considered output variables of a model can become so and vice versa.
5|Page
Step 1: Define and Structure the Problem In real life, problems rarely come neatly defined and structured. Unless you take the time upfront to define and structure the problem and agree on them with the user (your boss, for example), you may end up having to extensively change the model you first create. When your boss asks you a question whose answer requires developing a model, she often has only a vague idea of what she is really seeking. As a finance person and a modeler, you are responsible for putting it all in more concrete terms before proceeding. Start by discussing and defining why the model is needed and what decisions, if any, will be made based on its outputthat is, what questions the model is supposed to answer. Then establish how accurate or realistic the outputs need to be. As we discussed, all models have to capture the relationships among their variables, and discovering and quantifying these can take a lot of time. How much effort you put into doing this should depend on how important the project is and how accurate or realistic the outputs need to be. Step 2: Define the Input and Output Variables of the Model Make a list of all the inputs the model will need and decide who will provide them or where they will come from. This is crucial. For example, if you are creating a model to do the business plan for your company, the inputs must come from the business managers. You cannot just guess what sales growth rates they will be able to achieve, how much they will have to spend on plants and equipment to support those sales growths, and so forth. You may not need the actual numbers upfront, but the list of inputs should be established based on your discussions with the business managers so that you can make them independent variables in your model. Otherwise you may have go back later on and change a lot of things in the model. Make a list of the tabular, graphical, and other outputs the model needs to create. To some extent, these should be driven by the decisions that will be made based on them. One advantage of Excel is that a lot of the output can be just printouts of your spreadsheets, provided the spreadsheets have been laid out properly. If you plan ahead and lay out your spreadsheets with the outputs in mind, you will save yourself a lot of time later on.
6|Page
Step 3: Decide Who Will Use the Model and How Often Who will use the model and how often it will be used make a lot of difference. In this book, I am assuming that you are developing the models either for your own use or for use by others who are familiar with Excel and understand the model, at least to some extent. When you create models for others use, it involves much more work. You have to make sure that these people cannot enter data that do not make sense, they cannot accidentally damage parts of the model, and they can get the necessary outputs automatically and so forth. These are collectively called the user interface, and the more elegant, more easy to use, and more robust you want to make a model, the more work it is. You also have to plan for many of these features ahead of time. How frequently a model will be used is another important issue. If a model is going to be used only once in a while, then it does not matter if it takes a long time to run or if it takes some extra work every time to create the outputs. A model that will be used frequently, however, should be designed differently. Step 4: Understand the Financial and Mathematical Aspects of the Model It is important to remember that the computer cannot do any thinking; you have to tell it exactly how all the calculations in the model will have to be done. In most situations, if you do not know how you would do the calculations by hand, you are not going to be able to write the necessary formulas or instructions for the computer to do it. It does not pay to start building the model until you are sure you could solve the problem by hand. It usually takes beginners a lot of time to create a model and they often think that it is their Excel or VBA skills that are slowing things down. This may be partly true, but at least as often the problem is in their understanding of the finance and mathematics of the model they are trying to create. You will save lot of time if you do not even sit down in front of the computer to create a model until you are sure that you know how to solve the problem. Step 5: Design the Model There are two aspects to designing a model. One is to sketch the steps that Excel or VBA will have to follow to solve the problem. For simple models, you may want to write down only the broad steps or perhaps even do it in your head. For more complex problems, 7|Page
however, you should work on paper and use a degree of detail that suits your level of experience and the complexity of the problem. The less experience you have, the more detailed the sketch should be. Once again, remember that this may seem like a waste of time, but ultimately it will save you time compared to plunging into your spreadsheet or VBA program without such a sketch of the model. The other aspect of design is planning how the model will be laid out in Excel or VBA. Are you going to do the entire model in one spreadsheet (or VBA module) or split it into several spreadsheets (or VBA modules or procedures)? Editing an Excel or VBA model is easy. So you do not have to decide every detail ahead of time, but you need to have an overall design in mind or on paper depending on the complexity of the problem and your level of experience. As I discussed before, you also need to think about the kind of user interface you want to create and the reports you want the model to produce. Step 6: Create the Spreadsheets or Write the VBA Codes Step 7: Test the Model Almost no model works correctly the first time it is used; you have to find the problems (bugs) and fix them. The bugs that prevent the model from working at all or produce obviously wrong answers are generally easier to find and fix. However, models often include hidden bugs that create problems only for certain values or certain combinations of values for the input variables. To find them, you have to test a model extensively with a wide range of input variables. You have to take somewhat different approaches to testing and debugging a model depending on whether you are working with Excel or VBA. Both Excel and VBA provide some special tools for this purpose; I will discuss these tools and provide suggestions on how to debug models in Excel and VBA in later chapters. Here are a few helpful hints that apply to both: There is no standard approach to testing and debugging a model. You almost always have to use your ingenuity to figure out what will be the best way to test and debug a particular model. Your ability to do so will improve with experience.
8|Page
The better you understand a problem and a model, the easier it will be to debug it. If you understand how changes in certain independent variables affect the values of certain dependent variables, then you can change the values of the independent variables to see if the dependent variables are changing in the right direction and by the right orders of magnitude. This is one of the best tools, especially for debugging large models, and you should do a lot of testing using this approach. You can also use this approach to hunt down the sources of the problems: Starting from a value that looks wrong, backtrack through the values of the intermediate dependent variables to see where the problem may be originating. This approach may sound somewhat vague and abstract, but with experience you will find that you can locate and fix most bugs rapidly using this approach. Checking a models output against hand-calculated answers is a common and effective approach to debugging. In some situations, doing hand calculations may not be practical, but you may be able to use Excel itself to do some side calculations to test individual parts of the model. Step 8: Protect the Model Once you have completed a model, and especially if you are going to give it to others to use, you should consider protecting it against accidental or unauthorized changes. In addition, you may also want to hide parts of the model so that others cannot see certain formulas, data, and so on. Excel provides several flexible tools that you can use to hide and protect parts or all of your model. A good strategy is to cluster and color code all the input cells of a model and protect and hide everything else in the workbook. There is less need to protect VBA modules because most users do not even know how to open them. Nonetheless, if you think it is necessary, you can protect parts of your VBA models as well. Step 9: Document the Model Documenting a model means putting in writing, diagrams, flowcharts, and so on, the information that someone else (or you yourself in the future) will need to figure out what it does, how it is structured, and what assumptions are built into it. One can then efficiently and effectively make changes to (update) the model if necessary. For large systems (for example, the 9|Page
reservation systems for airlines), the amount of necessary documentation can be enormous; it is often put on CDs for easy access and use. Professional system development organizations have elaborate standards for documentation, because different pieces of large systems are developed by different peoplemany of whom may not be around for very long. Also, it is almost certain that the systems will have to be constantly updated. Over time, anyone who creates models develops his own system of documentation. As long as you keep in mind the objectives I mentioned before, you have a lot of leeway to come up with your own system as well. Both Excel and VBA offer a number of features that let you easily do a lot of the documentation as you work on your model. You should take full advantage of them and do as much of your documentation as possible while creating the model. This is important for two reasons. First, if you write your documentation when things are fresh in your mind, it will save you time later and you will be less likely to forget to document important things. Second, everyone hates (or learns to hate) documentation. It is no fun at all, especially if you try to do it all at once at the end of the project. If you do not work on the documentation until the end, chances are you will never do it. Then, if you have to use the model again a few months later or have to update it, you will end up spending hours or even days trying to figure out what you did. Do your documentation as you go along and finish it immediately after your model is done. You have to take somewhat different approaches to when you document Excel and VBA models. I will discuss how in the appropriate later chapters. Step 10: Update the Model as Necessary This is not a part of the initial model development, but almost all models require updating at some point, either because some things have changed or because you want to adapt it to do something else. This is where the documentation becomes useful. Depending on how much updating is involved, you may want to go through all of the above steps again. You should also thoroughly update the documentation and include in it the information on who updated it, when and why, and what changes were made.
10 | P a g e
11 | P a g e
12 | P a g e
13 | P a g e
14 | P a g e
15 | P a g e
16 | P a g e