Saturday, August 22, 2009

Productizing Human Behavior Models

I was alerted to the article The Sims Meet Science, by Franz Dill's great blog on emerging technology. The application domain here is the movement of people through space, for urban and architectural planning, but many of the issues are common to all of the agent-based modeling work I've been involved in...


Complexity
A big part of making the simulations more accurate lies in increasing the intelligence of individual agents representing pedestrians. Xiaolin Hu, assistant professor at Georgia State University, said... The engineering challenge lies in figuring out how to balance complexity, accuracy, and performance. To create more accuracy, researchers want to make the decision-making model of the agents more complex, but this affects performance. Hu said, "You may end up where you add all this extra computation on the decision-making part, but don't gain much from the results point of view."

Calibration

Aside from not adding anything useful to the results, extra complexity introduced to bring a model closer to reality creates more parameters that need to be calibrated, and obtaining the data for calibration is the achilles heel of any behavioral model:
When you need to know how a pedestrian space will work in a particular part of the world, you need to have the measurement data from that part of the world. Otherwise, how can you have confidence in your simulations?" explained Kevin Mannion, CEO of Legion.

Presentation

One of the challenges in building a business around agent-based modeling is, as with any new technology, customer adoption. If a model is going to influence the behavior of decision-makers, they need to have confidence in the model's accuracy. A prerequisite to building this confidence is engaging the decision-makers though an experience of the model. This helps make the abstract concept of mathematical modeling more concrete, building a bridge to the everyday real world:
One of the more exciting trends combines pedestrian simulation with 3D animation. More illustrative and realistic uses of pedestrian simulation could help improve the architectural process by showing a decision maker how people move through a building. [Alex] Schmid [managing director of Savannah Simulations] explained, "First and foremost, these are engineering tools designed for runtime analysis. The graphics are added on after the simulation to make it easier to sell a concept or new design alternative."
Standards

Another challenge in selling modeling is being able to build models at a cost that provides a profit relative to the customers perception of the value. One thing that would help is standardization in the underlying simulation platform, so that domain experts can focus on modeling the domain:

At the moment, all commercial pedestrian-simulation packages are proprietary and run on a Windows PC. But researchers are looking at ways to abstract away the different modeling system levels to give modelers the same freedom that computer operating systems give programmers across different hardware implementations.
Just imagine if every time a business wanted to do something with their data, they had to write their own database software! That's where we are today with simulation. The challenge, in my experience, with standardized platforms for agent-based modeling is that they don't provide enough leverage to be worth using. Handling simulation events, while not trivial, is a small part of the problem. It's like saying you need to be able to save files to implement a database.

A much larger issue is to find an effective way to represent behaviors, modify them, and make them clearly observable to others who have not developed the model. The database analogy would be graphical data modeling tools.

There are some intermediate steps which hold great potential in building the use of agent-based models, and human behavior simulation models in general: Connecting together the models that exist today. I'll discuss that in another post.







Sunday, July 5, 2009

Crowdsourced Simulation

One of the challenges in creating a simulation model of a society is that it is complex, on several fronts:

  1. There are many systems—finance, government, healthcare, education, etc.—each with its own domain of expertise.
  2. There is no one correct way to model human behavior—anything we model in a computer has to be a gross simplification of realty. And we don't even know exactly how minds generate decisions.
  3. Models are often created from a particular point of view, and can have unintentional (or intentional) biases and/or omissions
  4. Models can have mistakes. Mistakes can be easy to spot when the correct behavior of the model is clear, such as simulating the mechanical stresses on a bridge, but not so easy to spot when modeling, for example, how people will respond to a change in tax policy.

I propose addressing these challenges via crowdsourcing. That is, in the spirit of Wikipedia and open-source software, providing a platform on which many people can contribute to a model.


Levels of contribution

There are several levels at which people could contribute to a model, listed below in order of increasing requirements on the skills of the contributor:

  • Testing: Take an existing model and explore how it responds. This may entail examining metrics currently provided by the model, or adding new metrics.
  • Scenarios: A scenario provides a set of initial conditions and external factors for a model. Scenarios may be forecast-oriented, in which case the initial conditions are likely to represent the present, and the external factors represent a possible future. Scenarios might also be education oriented, in which case the initial conditions and external factors might represent a period in real world history, or might be fictional to illustrate a point or test the model.
  • System Structure: Simulation models are often made up of interacting objects, also known as agents or actors. These actors have some type of distribution in space (and perhaps time) for a given simulation. For example, the mortgage model has a population of households and banks, as well as a single national market for mortgages. An example of a structural change would be to change this model to have a separate mortgage market for each state.
  • Behaviors: The actors in a model have a specific set of behaviors, such as buying and selling homes, and refinancing to get better terms or take money out of the home equity. To such a model, someone might want to add a behavior to the household that modeled life events (births, college, marriages, new cars, vacations, etc.) and use these life events to trigger refinancing actions that draw on home equity.
  • Actors: Changing the arrangement or number of actors was mentioned above in “System Structure”. Another way to modify a model is to create new kinds of actors. For example, one might want to add a secondary mortgage market (where banks buy and sell mortgages from other banks).

Each of these levels of contribution requires tools with specific capabilities. I’ll explore ideas around these tools in future posts, and also welcome comments.


Version Control

One challenge that a crowdsourced simulation model poses is version control. The typical open-source software project is convergent—there may be multiple solutions proposed to a particular problem (like file system structure), but a single solution is chosen and built upon by others.

Wikipedia is different— any particular article is constantly changing, and while there is one current version, past versions are available as well. This presents challenges when trying to build something upon Wikipedia content, as the content can change underneath your edifice.

I’m finding it a bit more challenging to think of an example where a crowdsourced effort branches and is not convergent, but this is certainly conceivable in simulation models. For example, there could be two groups with different views on politics (socialism versus capitalism) that build different behaviors into their models. Or, there could be multiple domain specific models (e.g. mortgages and healthcare) which each dive into detail for their specific domain while simplifying or ignoring the other domain.

It seems like we will need to pick one of two approaches to “version control”

  • Convergent: Some curatorial body will work to integrate the best thinking into a single version of “truth”. Or perhaps a small set of domain specific versions.
  • Embracing diversity: In this case, there would be little or no effort at integrating separate models built on the same platform. Perhaps there would be a way to integrate the response of many different models to a specific scenario. One would still want some level of quality control when choosing models whose results are integrated.

The Power of Crowdsourcing

I believe a crowdsourced approach to a model of society is essential.

  • Different domains each have their own experts,
  • Different approaches to any single aspect of a model each have pros and cons
  • Many sets of eyes can vet a model, uncovering biases, omissions and errors

There are some additional advantages that, in my experience, are very important if not essential is using models to effect changes in behavior:

  • Transparency: People must understand a model before they can trust it. A model that can be tested and changed is transparent.
  • Engagement: Interacting personally with a model, whether simply changing a few external factors or parameters, or building new behaviors, enhances people’s interest the model. It gets them thinking about it, talking about it, contributing to it and ultimately acting in the real world.
  • Understanding: With engagement and interaction comes understanding. One of the best ways to learn is by “doing”, and one of the best ways to “do” is by building a dynamic model.

I welcome comments on crowdsourcing a simulation model, on this blog as well via email (karakots@gmail.com). Have you ever seen this? Have you tried it? Would you participate? How would you like it to work?

Sunday, June 14, 2009

Skill Set for Simulation Designers

This article in the NY Times (ht Bill Parks) provides a concise and cogent description of the skills of successful simulation designers.

The profession draws on expertise in a number of areas and does not fit neatly into any single category... Simulation “overlaps engineering, math and computer science, but it isn’t the same as any one of those,” .... [S]kills include … an aptitude for “conceptualizing the world,” he said. Developing a simulation requires enough native intelligence to view a problem abstractly, research the issues and tease out the myriad key elements. Then they must be incorporated into a model in which they are poked, prodded and tweaked to reach useful solutions.

Two other very important skills for those who use simulations are noted.

- First, as one pares down the real world to its essential elements for a specific model, an equally important skill is understanding the of limits the model—what is left out, what is not well understood, and what is “uncalibrated” (this is, not numerically reconciled with real-world data).

- Second, one needs to be very clear in communicating the correct way in which to interpret results.

Too often there is too much confidence placed in the results of a model, as illustrated in this article, also in the NY Times (ht Franz Dill). In this case, an underestimation of the spread of the Swine Flu, which was officially declared a pandemic by the WHO last week.

Disappointment and back-pedaling occurs when too much confidence is placed in a model. This lowers the credibility of modeling, and also dampens the desire to apply resources to improving the model.

A model should not be an end in itself, but a conversation. It is only through the crucible of testing, critique, discussion and refinement that a model can converge on reality. Key to this process is engaging others to use a model themselves, understand how that model works, and be able to suggest (and ideally implement) changes to improve the model. This is an important goal of the platform we’re developing.

Sunday, May 17, 2009

Economic Model Update

Though I have not posted for a while, a lot of work has been done on the model.

The first step was to build the simulation engine, which has been architected and implemented by Steve Noble. This engine is the platform within which we create populations of the objects: households (people), banks and homes, as well as the markets, government and external factors.

The next step was to create the behaviors for the various objects. We currently have a mortgage market up and running, in which the households request, and banks offer, mortgages. On a given simulated day, each bank evaluates all current household requests for a mortgage, based on the bank’s lending policy, and each requesting household evaluates any mortgages for which it is qualified. Each household and bank has its own unique way to evaluate a mortgage. I’ll describe these in a future positing.

We don't have houses in the model yet—we simply have the households request mortgages and, if the request is filled (the mortgage is preapproved), then the household has a probability of actually buying a house at the preapproved amount of the mortgage. The buying household then pays the down payment to the seller, and pays any points on the loan to the bank. The buyer then makes mortgage payments until the loan is paid off. The current loans are simple fixed interest rate loans.

While the addition of houses will allow for a supply-and-demand variation in housing prices, the current simple model already provides interesting behavior with respect to the business models of the banks. Banks make money on loan interest paid, but to make loans a bank needs deposits and has to pay interest on the deposits. These interest payment seat into the loan profits. The banks are competing for the households’ loan business, so they can’t charge too high an amount for loan interest. But if the deal on the mortgage is too “good” from the perspective of the borrower then the bank will get lots of business but lose money.

This example highlights that even when there is no risk of default in the loans, the banks still must balance offering attractive loans with making enough money to pay interest and turn a profit. If there is just one bank it is easy, but when there are multiple banks competing for the borrowers’ business it is not clear ahead of time which bank will win.

We have some more work to do to finish this first simulation, and plan to put it online within the next two to three weeks. Watch this space for an announcement when we do!

Meanwhile, here's a screenshot of the work in progress...


Thursday, April 16, 2009

Market Signals & Financial Engineering

One of the side effects of building dynamic models is that you learn new things about the system you were modeling. I’m not an economist by training, so while what I’m learning is new to me, I’m not claiming it is new to everyone. Please do keep in mind, though, that an important goal of this modeling work is to help society, most of whom are not experts in economics (or energy or healthcare or …) develop an understanding of how society works and how to make it work better.

This positing at a blog I follow, Franz Dills’s The Eponymous Pickle, pointed to an article Re-thinking Risk Management: Why the Mindset Matters More Than the Model. This got me thinking about how financial firms think about risk.


The Path to the Insight

Since we will be modeling “structured finance” products like Mortgage-Backed Securities (MBS) and Credit Default Swaps (CDS), I need to understand what these are, how they work, and why they are desirable to the parties involved. This led me to the concept of price signals in markets.

An example of a price signal is the price of gas. When it is high, it sends a signal to drivers to drive less in the short term, and consider more efficient vehicles and public transportation in the long term. It is possible for government to send the same signal by a gas tax, even if the price of imported oil is low. The key point is that in a market, signals influence behavior.

Investments have two key signals, price and risk. These are traditionally unified—if an asset is perceived to be riskier, buyers of the asset will demand a higher return to offset the risk (think of “junk bonds”). The risk signal is set by a credit rating agency such as Moody’s, which assigns a rating such as AAA for the safest investments (such as a money market fund) to BBB for a junk bond.

In the article Regulatory Malfeasance and the Financial System Collapse, economist Joseph R Mason, Senior Fellow at the Wharton School , writes that it is important to understand “the terms and triggers of securitizations to recognize perverse incentives apparent in selling the AAA securities but keeping the risk.”

What structured finance products do, whether intentionally or not, is to obscure the risk signal associated with an investment. This occurs because risk is separated out from the underlying investment. When a MBS is insured by a CDS, the risk is apparently moved from the firm holding the MBS to the firm holding the CDS. But the decoupling or risk and return is an illusion, because the MBS and CDS are both linked to the risk of the underlying real asset—the mortgage. If the mortgage fails, the MBS loses value, and the CDS is supposed to pay. But why did the mortgage fail? Because the economy has problems, and these problems also affect the ability of the holder of the CDS to pay when the mortgage fails. So, while the risk signal of the MBS was changed via financial engineering, the underlying risk remained with the MBS.


The Insight

The insight is that financial risk obeys a kind of “conservation of matter” law. That is, “risk can neither be created nor destroyed”. So, while financial engineering can move risk around, it behooves anyone considering purchasing a structured finance product to understand exactly where the risk is being moved to, and to ensure that the destination of the risk is truly unconnected with the structured finance product being purchased. My hunch is that you can't ever guarantee decoupling, and that structured finance is essentially just an exercise in obfuscation. Once we have the model running, I look forward to tracking the flow of risk.


A note on Financial Engineering

The practice of creating structured finance products is called “financial engineering”. I am trained as an engineer, and grew up viewing engineering as synergistically combining elements from a palette of technologies to create a new capability. These new capabilities add value to the economy, because they either solve a problem that has value or enable some new activity or product, which also has value.

Financial engineering, in contrast, seems to only move things (e.g. risk) around without creating new value. One may argue that securitizing debt (e.g. MBS) allowed many more institutions to sell debt to individual people in the form of mortgages and credit cards, which expanded homeownership and consumer spending. But it seems to me that primary motivation behind securitizing debt was to have new financial products to trade, with a commission being made on every trade. Hosting the trading of assets is a great business model, because “the house always wins” in that every trade generates a commission, whether the buyers and sellers win or lose. In other words, securitization of debt doesn't add any real value to the world; it just allows the institutions that facilitate the trades to siphon value out as commissions.

That doesn't sound like engineering to me.

Saturday, April 11, 2009

Modeling the Meltdown; Part 7: Five Easy Pieces

We currently envision five steps to creating the full mortgage meltdown model. As we implement the model, we’ll likely learn new things that revise how we go about these steps. Our initial plan is outlined below.

1. Mortgage Core: Households, financial firms (banks), homes and mortgages. Also the government and regulations it applies to the mortgage and banking system.2. Employment: Adds businesses that produce goods. Allows for the modeling expenses (buying goods) and income (employment) for households. (The new elements added in each step are highlighted in yellow).3. Investment: Adds a stock market. Each firm issues stock, and households and firms invest in that stock.4. Structured Finance: Adds the secondary debt market, where mortgage and non-mortgage debt is resold to other financial firms. These other firms securitize the debt they buy into structured finance products such as Mortgage-Backed Securities (MBS) and Collateralized Debt Obligations (CDO). Via a market for these vehicles, financial firms buy and sell these structured finance products.5. Financial Insurance: Additional financial firms, such as AIG, create insurance products such as Credit Default Swaps (CDS) to insure the MBS and CDO.
In the next post, we'll start designing the specific behaviors and relationships for the first step, the Mortgage Core model.

Modeling the Meltdown; Part 6: Transparency

One of the goals of our modeling effort is transparency. We want anyone to be able to understand how the models work, so that they can either be confident the model is correct and/or help improve the model. This series of posts is designed to help with transparency by illustrating the process by which we’re creating the model.

Assumptions
An important aspect of transparency is identifying assumptions, which typically means what is left out of the model. Here are some assumptions that we are starting with in this model:

Rent
  • Don't model who owns a rented home
  • Don't model change in rental rates during tenure of renter
  • Assume sufficient supply of rentals
Homes
  • No family owns more than one home
  • Only one mortgage per home
  • Ignore commercial real estate
  • We’ll ignore growth in number of households and new home construction
Home Sales
  • Ignore realtor’s fees when buying & selling a home
Mortgages
  • Assume no “interest only” or “negative amortization” loans.
  • Price appraisals not implemented yet
  • Not modeling cost of marketing a mortgage to buyers/refinancers
  • Assume no fraud (borrowers lying to lenders)
  • Terms for a pre-approved mortgage do not vary while buyer is shopping for a house.
Savings
  • All savings accounts can be withdrawn from at any time
Goods
  • A single good is produced, (though it has variable consumption)
  • No supply chain
  • Ignore accounts receivable and payable
Stocks
  • Stock price does not consider future earnings potential
Government
  • No Taxes
As we identify additional simplifying assumptions, we will add them to this list. Also keep in mind that these assumptions can be explicitly addressed in future versions of the model, after we have the basics implemented.

Building in Steps
The full model will be rather complex—but this does not mean that it will be opaque. To help reduce the complexity, we will start simple and add to the model in steps. Each step will build on the previous step with an incremental amount of functionality. These steps are described in the next post.

Modeling the Meltdown; Part 5: Financial Model Basics

Because we are building an economic model, all proactive agents, and the government, will have a financial model which includes the two standard elements:
  • Income statement: how much the agent is making and spending over a given period of time
  • Balance sheet: the amount of assets and debts (stuff) an agent holds at any specific point in time
Here is a more detailed view of the income statement and balance sheet, in terms of the elements we are using in this model (I’ve omitted the structured finance elements for the moment to keep it simple):

Income statement
  • Income
    • Salary (households), sales (firms), debt interest (financial-firms)
    • Stock dividends
    • Interest paid on cash deposits

  • Expenses
    • Goods purchased (households)
    • Salaries paid to employees (firms)
    • Cost to produce a good (e.g. buying mortgages)
    • Debt servicing (principle + interest)
    • Paying interest on deposits (firm)
    • Rent
  • Profit = Income – expenses
Balance Sheet
  • Assets
    • Cash
    • Investments
    • Home value (Households)
    • Equipment value (Firm)
    • Goods inventory

  • Liabilities
    • Debt balance (secured & unsecured)

  • Equity = Assets – Liabilities
    • For a household, equity is the net worth
    • Firms will be considered 100% publicly owned, though they can buy their own stock. The fundamental determination of stock price will be equity/# of shares. There will also be a market effect on the stock price

Credit Worthiness
An important aspect of this model will be the ability of one agent to evaluate the credit risk of another agent. The balance sheet and income statements make this possible, because in general a credit rating is better (the risk that the debt will not be repaid is lower) when
  • profit as a percent of income is higher
  • the ratio of assets to liabilities is higher
  • these ratios have been stable or increasing over time
  • the agent has not defaulted (left debt unpaid) in the past
Next, we'll look at how the elements of this specific model will interact.

Modeling the Meltdown; Part 4: Model Elements

We now have enough information to define the building blocks of our model. In our modeling system we call these “elements”. There are a small number of element types, and each element type will support several of the specific elements of our model, as follows:
  • Proactive Agents can initiate actions in response to inputs. The financial meltdown model has two types of proactive agents: Households and businesses. Households can either own or rent. Businesses are either financial or non-financial. The model will have a population (“swarm”) of households and businesses, ultimately implementing a scaled-down representation of the actual population of households and businesses in the US.
  • Stuff elements can't take action on their own, but are owned by and exchanged among proactive agents. Stuff elements for this model include goods (produced by businesses and consumed by households or other businesses), stock (equity that businesses sell to raise capital), homes and debt (including secured credit, such as mortgages, and unsecured credit, such as credit cards). As we model structured finance, goods will include MBS, CDO and CDS, which will be traded among the financial firms. Jobs are also considered “goods”.
  • Markets exist for every good, since goods can be bought and sold. Markets allow multiple buyers to post requests for what they want (“bids”) and multiple sellers to list what they have (“asks”), and a mechanism for connecting buyers and sellers. Markets also generate statistics that can be disclosed to buyers and sellers. These markets are not necessarily auctions. For example, a grocery store is a market which connects buyers and sellers, where the sellers set a fixed price and the buyers choose to buy or not. The markets for this model include the Retail Debt, Housing, Goods, Jobs, Stocks, Secondary Debt, MBS & CDO, and CDS markets.
  • Government: The government creates constraining policies, such as bank capital requirements and consumer debt requirements. The government also sets interest rates, and can inject capital to households and businesses. There will be only one Government element in this model, but it is feasible to extend the government to include state and local governments as well, which would imply a swarm of government elements.

Tuesday, April 7, 2009

Baseball & Scenario Analysis

For a more recreational application of scenario analysis, check out this article in the NY Times. America's favorite pass time meets monte-carlo analysis.

A potential pitfall: optimizing one decision, like when to steal a base, needs to also take into account the opposing team's likelihood to change their behavior in response.

Modeling the Meltdown; Part 3b: Sketching the Model—Other Factors

As we create our model, we need to ensure we are covering the contributing factors referred to in Part 1. Let’s look at each of these:
  • Cheap Money: For each element of a model, we need to decide whether we are going to model it, or provide it as an input to the model (also known as an “external factor” or “externality” in economic jargon). If we were to model the generation of interest rates, we would need to implement the rules by which the Fed sets these rates. The Fed’s logic borders on inscrutable, so we are better off defining interest rates as an external factor. This is also a good idea because as we run the model forward, we’ll want to test it under conditions of different interest rates.

  • Lowered savings and increased borrowing: We would hope to see this as an emergent behavior by consumers. The specific rules that would generate this behavior have yet to be defined.

  • Loose loaning standards: These standards are a set of regulatory requirements (or lack thereof) that are asserted by a governing body on the mortgage industry. We can lump all governing bodies together in the “government” actor in this model. The mortgage lending regulations can then be seen as parameters on the government object: minimum down payment required, proof of income required, etc. These parameters should be implemented as external factors. When there are no requirements set by the government, then the choice of how risky to be in granting loans falls on the “bank” actors. The choices the banks make result from an internal calculation based on some set of logical rules (just as consumers’ decisions how much to borrow and save), yet to be defined.

  • Financial engineering:

    • MBS: There is a specific way that MBSs are constructed. We can think of the financial businesses that build them as factories that take in mortgages as a raw material. The MBS are then sold as products to other financial businesses (possibly even banks that originate mortgages), as well as investments that consumers make (stocks and mutual funds). There again need to be some logic rules about how the characteristics of mortgages translate into MBS products. The characteristics of the MBS products will also depend on which risk tranche the specific product is derived from.

    • CDS: These are different than MBSs, because a CDS is not a product but a contract (a legally binding agreement). A contract has two parties, on of which pays the other some amount based on some condition occurring. For CDS contracts, the “seller” of the contract agrees to pay the “buyer” a specific amount if an MBS named in that specific contract has too many defaults on its underlying mortgages. It may be possible to resell a CDS to a third party, but we will avoid this complexity in this model. (Sidebar: Selling a CDS would be akin to buying a life insurance policy on yourself, and then selling it to someone else so that you could spend some of the money now before you die. You can see that this can generate a conflict of interest when someone else benefits from your death. Similarly, a purchaser of a CDS that does not own the MBS which that specific CDS insures would benefit if the MBS went bad. One perverse causal chain would be for a bank issuing sub-prime mortgages to ultimately buy a CDS insuring those mortgages, after already having sold those mortgages. Then the worse the mortgages were, the more likely the bank would be to profit. I have not heard of this occurring… yet).


  • Leverage: Recall that leverage was being applied in many areas—foremost in amplifying the popping of the real estate bubble into global financial crisis.

    • Recall that homeowners leverage by placing a small down payment relative to the price of a house. We have this covered above under “loose loaning standards.”

    • Banks can leverage when making loans to a level specified by the government, called the “capital requirement”. While complex in its details, it can be expressed as a single number (currently about 6%). This, like interest rates, is set by the Federal Reserve. (Sidebar: In fact, the capital requirement is a strong tool at the Fed’s disposal. The lower it is, the more money banks can lend without taking on more deposits, which increases the money available in the economy. It's like printing money, but more easily undone when the money supply must be decreased again).

    • Non-bank financial businesses generally can apply as much leverage as they see fit. When there are public shareholders, there are consequences (e.g. the CEO “Perp Walk”) if those businesses don't act in the best interests of shareholders, and accounting standards to enforce prudent behavior. But for private financial businesses, like hedge funds, the only limit to leverage is how much they can get away with (see the story of Long Term Capital Management, aka LTCM, for a lesson on the consequences of this behavior). In our model we’ll likely provide a range of leverage levels across these private financial businesses based on real-world data. We might add an external factor capping leverage rates in the future, as this is a regulation the government is contemplating.
So, through a combination of internal logic and external factors, we are beginning to fully capture what we need to model. The modeler’s creed, credited to Einstein, is to “make everything as simple as possible, but no simpler.” That’s more of an art than a science, and the next step in building our model.

Modeling the Meltdown; Part 3a: Sketching the Model—Actors

So far in our exploration of the financial crisis, we’ve outlined the contributing factors and how those influenced the actions of various players in the US economy. The next step to building the model is to extract the underlying structure of actors, behaviors, objects and interactions. One way to do this is to read through the previous two postings and note these elements as we encounter them.

The following can be extracted from the previous post with the 12 numbered paragraphs. The numbers in parenthesis represent the paragraph in which the element was first mentioned.

Actors
  • Households
    • Renters (7)
      • Rent cost
      • Desire to buy
    • Homeowners (1)
      • Default rate (2)
    • Credit rating (2)
    • Sense of wealth (4)
    • Non-mortgage debt (4)
    • Savings (4)
    • Stocks (5)
    • Employment status (6)

  • Financial businesses
    • Type
      • Banks (mortgage originators) (1)
      • Non-banks (2)
    • Balance Sheet (5)
    • MBS owned (8)
    • Leverage (8)
    • CDS bought/sold and with whom (8)
    • Stock

  • Non-financial businesses
    • Sales
    • Employment
    • Stock

  • Government (10)
    • Capital injections (10)
    • Debt/equity in capital recipients (10)
    • Accounting regulations for financial institutions (12)
      • Mark to market rule (12)

Behaviors
  • Buy home (1)
  • Sell Home (1)
  • Refinance (1)
  • Default (1)
  • Foreclose (1)
  • Short Sale (1)
  • Borrow or pay down non-mortgage debt (5)
  • Add or remove money from savings (5)
  • Buy or sell stocks (5)

Objects
  • Mortgages (1)
    • Down payment (1)
    • Proof of employment (1)
    • Starting interest rate (1)
    • Final interest rate (1)
    • Mortgage sale rate (2)
    • Above/under water (3)
    • Callable by the bank (4)

  • Homes (1)
    • Price (2)
    • Mortgage(s) (1)
    • Owner (1)
    • Supply (2)

  • Mortgage Back Securities (2)
    • Tranches (2)
    • Credit rating (2)
    • Price (8)

  • Credit Default Swaps (2)
    • Seller of contract (8)
    • Buyer of contract (8)

  • Stock Market
    • Dow Index
    • Company performance (5)
      • Non-financial businesses
      • Financial businesses
    • Commodity demand (6)
    • Mutual funds
      • (can buy MBS if AAA rated)

Interactions
  • Housing market (2)
  • Supply and demand (2)
  • Defaults drive home prices lower (3)
  • Stock market response to supply and demand for stocks (5)
  • Stock market response to consumer spending (5)
  • Layoff response to consumer spending (6) (job market?)
  • Impact of housing market on rent costs (7)
  • MBS price change as a result of defaults (8)
  • Financial business stock price in response to balance sheet (10)
Next up, we’ll look at the “other factors” from part 1.

Thursday, April 2, 2009

Modeling the Meltdown; Part 2: Putting the elements in motion

In part 1, we were introduced to the ingredients of this recipe for a meltdown: Cheap money, lowered savings and borrowing, loose loaning standards, financial engineering and leverage. Let's see how this all can produce an explosive (toxic?) result…
  1. The riskiest of the mortgages started to default. These were mortgages where the buyer put no money down, did not have to supply proof of employment, and the interest rate was artificially low at the start. When this artificially low “teaser” rate ended, the “homeowner” (and I use the term loosely here) could not longer afford the mortgage, so he or she stopped paying on it, and was eventually evicted. The house goes back to the bank (foreclosure) and the bank puts the house back on the market (called a “short sale”). Short sales often occur at below-market prices.

  2. Housing prices start to drop. Aside from short sales typically being "below market", the law of supply and demand says that as the supply of houses goes up, the price will drop. If there are a small number of defaults, there is not much impact to the market. But the number of risky loans was not small, partially because there was a lack of regulation, and also because mortgage companies had little incentive to avoid writing risk loans. The loans were being sold as soon as they were written, which meant that the mortgage company writing the loan had no long-term interest in the results. Like a game of “hot potato”, the loans were passed from the mortgage company to the financial business that turned them into MBSs, divvied them into tranches, insured them with CDSs and sold them off the others who though they were buying AAA-rated investments.

  3. Once prices started to drop, less risky, but still subprime, loans started to go “underwater.” In other words, the house was worth less than what the borrower paid. Some of these borrowers defaulted, increasing the number of foreclosures and resulting short sales, which drove prices lower. You can see the positive feedback loop forming (where dropping housing prices cause further drops in housing prices).

  4. As prices drop, people who are not defaulting start to feel less wealthy. The psychological factors that encouraged them to borrow more and spend more when housing prices and stocks were rising start to work the other way and they start to spend less. For some people, the decrease in spending can be applied to paying down debt (credit cards and Home Equity Lines Of Credit, aka HELOC). But others (who were increasing their debt each month, but maybe more slowly than their homes and stocks were appreciating) may stop borrowing to spend, but can't pay back the debt. The consumer debt issue is somewhat of a sidebar here, except that as the housing market began to drop, some HELOCs were “called” by the banks—this means the borrows had to pay back the money. Not all borrowers can afford to do this. Those who can pay it back probably took it out of the stock market. Those who can’t probably defaulted.

  5. The stock market too follows the law of supply and demand. Even if the performance of all companies is unchanged, if people need to sell stocks to get money, the prices for the stocks will go down. This adds to people feeling less wealthy because stock prices are falling, and so they decrease their spending further. Unfortunately, because people have been decreasing their spending, company performance is not unchanged—it is decreasing. This puts additional downward pressure on stocks. (As we’ll see in step 8, the banks are getting into trouble, which also depresses stock prices).

  6. Another effect of decreasing company performance is cost cutting, which comes in the form of layoffs and decreased purchase of supplies. So unemployment goes up, and the price of the raw materials (commodities, another popular investment) goes down. And unemployment drives more defaults, which drive lower home prices.

  7. While all this is going on, potential first time homebuyers become reluctant to enter the market. First, because housing prices are dropping, one does not want to buy a house today that will be worth 20% less next year. Second, with a deteriorating economy, people do not feel secure enough to commitment to large mortgage debt. So there is less demand for houses, further driving down prices, generating more defaults, creating more unemployment… You get the picture.

  8. Meanwhile, what’s happening with the banks? MBSs are dropping in value faster than expected, because there are a lot more defaults than expected, and the CDSs don't work, because banks that were insuring each other needed to pay up to each other but can’t, so their AAA rated sub-prime tranches are decreasing in value. By the way, remember leverage? Those with leveraged positions in MBSs might lose 10% of their investment for every 1% drop in value for the MBS. Once the MBSs drop more than 10%, things start to look bad—so bad that these financial institutions now face bankruptcy. They would like to sell these toxic assets before they drop further, but no one wants to buy them, which makes them worth even less-- another positive feedback loop. This lowers the value of bank stocks, which drive the stock market lower (as mentioned in step 5).

  9. But wait; there is a night in shining armor—AIG to the rescue! It turns out that to "reduce risk", when one bank insured another through a CDS, they often bought insurance on this insurance policy. This is called “reinsurance”, and AIG was one of the biggest providers of reinsurance. But everyone wanted their reinsurance payout from AIG at the same time, and AIG could not pay up. (While the inability to pay up had nothing to do with bonuses, those highly bonused managers at AIG were ultimately proved incompetent at their prime responsibility to their customers: reducing risk). With the inability to sell the toxic assets (the MBSs), the banks' assets drop below the federally regulatd minimum, making the banks technically insolvent (unable to meet their financial obligations). The government can;t let this occur, as it is generally accepted that the economy can't function without a solvent banking system.

  10. Enter the bailout, where the government prints money (technically it does not print money), gives it to AIG, who then gives it to the banks that were insured (known as AIG’s “counterparties”). The government also gives money directly to the banks. Now the banks are solvent again-- sort of. With all the money being handed out, there are responsibilities generated to pay it back. But if the banks gets a loan, then its finances still look bad (more on this below in step 11). So it would be better for the banks to give the government equity (stock) for the money they receive instead of debt. But this would mean that the government starts to own the banks (nationalization). This is not something the banks want, nor the government wants.

  11. Strangely, the banks actually had enough money all along—it was only “on paper” that the banks looked insolvent, because they held investments that showed a huge loss. But the loss is not realized until the assets are sold. Think of it like this: If you hold a stock that is down now, until you sell the stock you have only lost money in theory. If you wait until the stocks go back up, you can sell at a gain, and life is good. You did not lose anything, and your life proceeded normally while your stocks were low. Likewise, if the banks just wait until housing prices recover, everything will be OK. But, housing prices might not recover, and banks have regulations that say they have to account for their assets at the current market price (called “mark to market”). So the bank’s financial statements (called balance sheets) show the banks to be in bad shape. The bailout money can help “shore up” the balance sheets and make the banks look solvent, but as mentioned in step 10, this starts to look like the government owning the banks. What to do?

  12. One possible solution to taking the pressure off the banks is to no longer require them to “mark to market”. In other words, they don't have to account for their “toxic” assets at the current low price. Rather, they can just wait it out, like we did with our stocks in the example is step 11. Another solution is for the government to buy, or to subsidize purchase by private parties, the toxic assets (which by the way now have been given the euphemistic name “legacy assets”) at a price higher than what they are currently worth. Then the bank balance sheets get healthy without the government owning the banks. Both of these solutions have their own problems, among which they tend to be rewarding risky behavior by the banks.

You probably have a sense that this is pretty complicated and, though in hindsight the sequence of events looks logically plausible, nobody noticed it before it all came down. Likewise, the solutions for the bank’s problems, described in steps 10 through 12 above, can have unintended side effects. And once we patch up the current problem, we need to change the rules to prevent it form occurring again.

The model we are building will
  • Improve the explanation above, because the moving parts will need to produce the real-world outcome, which will highlight anything we’re missing
  • Reveal possible side effects of the short-term fixes to the financial market
  • Be a test bed for future policy and regulations designed to prevent a repeat performance, to make sure that the regulations not only achieve their goal, but don't allow other undesirable outcomes down the road
Stay tuned as we create the model!

Modeling the Meltdown; Part 1: Setting the Stage

The first step in building a model is to understand how the system to be modeled works in the real world. I’ve summarized what I know about the financial meltdown the following story. A caveat: I’m not an economist, and there are certainly errors in the description below. I encourage knowledgeable readers to provide comments to help improve the accuracy.

The economic situation that the US finds itself in today has resulted from the interaction of a number or processes that created in a “positive feedback loop” of declining home prices (in other words, falling home prices cause home prices to fall further. I’ll try to avoid jargon, or at least define it when it is used). Falling home prices generated additional undesirable side effects such as failing banks and unemployment. Here’s how:

  • Cheap money: After the burst of the Internet bubble, the federal reserve bank (“the Fed”) decreased interest rates to historic lows. The idea was keep the economy vibrant by making it inexpensive to borrow money, which lowers the risk of new investment in everything from starting a business to buying a home to spending on credit cards. As these lower interest rates stimulate more demand for things like houses, prices rise because supply is limited. This is called inflation. Between 2002 and 2007, there was very high inflation in the price of homes, oil and stocks. There was not much inflation in food, durable goods, and services—the traditional measures of inflation. Hence, no one (not the public, the media, or the government) reacted to the rise in housing prices, energy and stocks as if it was inflation. If we had reacted to inflation, the Fed would have probably raised interest rates, which would have slowed down demand. While this might have been fiscally appropriate, it was not politically palatable.
  • Lowered savings and increased borrowing. Many people judge their wealth by their home equity and stock investments. Thus, as home and stock prices increased, people felt wealthier. One result of feeling wealthier was a decrease in savings. Why put your “disposable” income (money you earn but don't need to meet your basic living expenses each month) in a savings account that increases by 3% per year when your house and stocks are increasing by 20% per year. Why not spend this disposable income? And, why not spend a little bit of your “winnings” in home equity and stocks too, by borrowing against your home equity and low-interest credit cards? After all, spending is god for the economy.
  • Loose loaning standards. As money became easier to access, so did mortgages. I’m not sure if there were any regulations that were relaxed to make it easier to borrow—that was not required in order for the following to have occurred: Mortgage companies would get a loan filled, and then sell it. Normally, a risky loan would be hard to sell to anyone unless the interest rate (paid by the borrower) was high (to offset the risk). But rather than make the interest rates high, which would have made it more difficult to get borrowers, the loans were made to appear to be low risk. This was done via financial engineering, the explicit design of investments derived from other investments (a.k.a. derivatives).
  • Financial Engineering: There are two derivative investments that played a big role: Mortgage-backed securities (MBS) and credit default swaps (CDS). Here’s how they work:
MBS: Financial business “B” buys a collection of loans from a number of mortgage companies. This portfolio of loans runs the gamut from low risk to high risk. The collection is divided in slices (known as “tranches”, French for “slice”) based on risk. The lowest-risk tranche is sold off with a rating of “AAA”, the highest credit rating. The next tranche would have a lower credit rating, such as AA, A, B, etc. The low-risk loans are called “prime” and the higher-risk loans are called “sub-prime”. It is harder to sell something with a lower credit rating—you need to offer a higher interest rate to offset the risk. Also, mutual funds can only buy assets rated AAA, so there is a whole big market to which you don't have access if you are selling risky investments. But thanks to the magic of financial engineering, you can turn a risky tranche into a AAA tranche by insuring it. This insurance is called a credit default swap.

CDS: The basic idea is that financial business “A” offers to insure a tranche. The contract states that if some amount of the mortgages in financial business B’s tranche default (the borrows stop paying the mortgage), then A will pay B. With this insurance the sub-prime tranche can be transformed into an investment rated AAA, and sold to anyone looking for a low-risk investment. This works fine as long as, in a given tranche, no more than the expected number of loans go into default. One of the ways this insurance was used was by having two banks insure each other. I agree you pay you if the defaults on your risky tranche get too high, and you agree to pay me if the defaults on my risky tranche get too high. We’re swapping insurance on mortgage (credit) defaults. We’re fine as long as both of our investments don’t fail simultaneously.
  • Leverage: The idea of leverage is that you borrow money to invest, with the expectation that your investment return will exceed the cost of borrowing money. For example, a consumer buys a house with 20% down—this means that four times as much money is being borrowed as is being invested. The consumer gets to keep the gain, so it is a great investment—If I buy a house for $100K, I put down $20K. If the house goes up by 20%, to $120K, and I sell it, I end up with $40K, a 100% profit, while I was paying less that 10% per year in interest. Who wouldn't take that deal? Financial firms also use leverage. There are various regulations—Mutual funds can typically not be leveraged, banks (such as bank of America, Citicorp, Wachovia, etc.) can be leveraged to (what was believed to be) a conservative degree, and investment banks (such as bear Stearns, Goldman Sachs and Morgan Stanley) and hedge funds have no regulations I am aware of on how much they can be leveraged—they just have to be able to convince someone else to lend them the money.
In Part 2, we’ll look at how these ingredients reacted to form the financial meltdown.

Modeling the Financial Meltdown and its Reshaping; Part 0: Introduction

This is the first of a series of posts providing an inside view in the development of an economic model. I’m part of a small team of developers creating a new kind of tool—one that will help non-experts understand important real-world systems (such as energy and the financial market), and will also help guide experts in developing policies for these systems.

We’ll be creating models in public and encouraging input and debate as we build these models, with the goal of harnessing the collective “wisdom of the crowds.” Beyond a public vetting of these models, our hope is that these models will enable a collective vision of how we, as individuals, want our society to work. With a shared vision, we can address policy-makers with a much more knowledgeable and unified voice, building the world we want in the spirit of true democracy.

In this first model we’ll be looking at how the financial crisis came about, what can be done to recover, and to make the economy more resistant to this and other challenges in the future.

Monday, March 16, 2009

Battle of the Brands

To evaluate a business strategy, you need to define not only your strategy but also that of your competition. This is notoriously difficult for companies to do, for a couple of reasons
  • Human nature leads one to overestimate one’s own strategy and underestimate the competition
  • There are multiple significant competitors in a market, and it is difficult to “get inside the head” of each
  • It feels overwhelming to combine the uncertainty of competitor options and external factors

One way I’ve found effective is through a business war-gaming workshop called “Battle of the Brands.” Using a market simulation program, a model of the product category is built. This includes
  • The major competitors, brands and products
  • Consumer segments, their preference for attributes, perception of brands, and sensitivity to price and media
  • The relevant distribution media channels

A team of business managers is then brought together, with each manager in the role of controlling one of the competitors with the goal beating everyone else. Each “player” creates an annual plan, and the simulation is run for each quarter of that year, with the ability of the players to adjust their plans each quarter. Typically this is repeated several times, because with every “round” the players become more creative, building their knowledge of where the leverage points and risks lie.

The result is, as you would expect, a much more realistically competitive set of competitors. And, somewhat more surprisingly, there are also typically epiphanies that start with “why are we doing…?” and “why haven’t we ever tried…?” The team invariably wants to stay longer and try out “just one more idea.”

Workshops provide valuable insight, but to harness this insight there needs to be some change in behavior that results from the activity. In Battle of the Brands, the software model used in the workshop is made available to participants afterwards for continued exploration. More importantly, the model can transition from workshop to operational tool, in which it is calibrated to produce answers that are not just realistic, but accurate enough to be incorporated in the real-world planning process.

Saturday, February 28, 2009

What If?

The point of simulations, and models in general, is to get some understanding about what will happen if we try something. By understanding the consequences of our actions, we can optimize them to have the best chance of getting the results we want. The process of doing this is called scenario analysis. Here’s a short tutorial and an example “ripped from today’s headlines”.

Scenario Analysis
Scenarios tell us what will happen if factors outside our control act in our favor, or against it. These factors might be specific competitors or adversaries, the inanimate world (e.g. natural disasters), or the emergent behavior of the collection of others just like us (e.g. the economy). Whatever the nature of these external influences, we want to know how these will affect our plan and the attainment of its goals.

Our ability to forecast the future using models and scenarios depends on three things:
  1. The accuracy of the model
  2. The amount of uncertainty in how we expect influencing factors to behave
  3. The number of influencing factors we are including
So, even if we have a perfectly accurate model for history, we can't have a perfect forecast because of #2. Furthermore, any model we create is an simplified approximation of the real world, which guarantees that (#1) our model is not perfect and (#3) we will omit some influencing factors.

Though not perfect, scenario analysis allows us to develop
  • a sufficient understanding of the risks and rewards of a several alternative courses of action,
  • an understanding of what we need to watch out for, and
  • contingency plans in case a problem arises
In his now classic book The Art of the Long View, Peter Schwartz describes the purpose of scenario analysis as the systematic exploration of several possible futures. Schwartz notes that scenarios are tools "for ordering one's perceptions about alternative future environments. The end result... is not an accurate picture of tomorrow, but better decisions about the future." No matter how things might actually turn out, both the analyst and the policy maker will have "on the shelf" a scenario (or story) that resembles a given future and that will have helped them think through both the opportunities and the consequences of that future. Such a story "resonates with what [people] already know, and leads them from that resonance to re-perceive the world... Scenarios open up your mind to policies [and choices] that you might not otherwise consider."
There are a number of techniques for scenario analysis. A few of the more common ones are described below.

Worst-Case Analysis
You describe what you think is most likely to happen (known as the “baseline”
), and what will happen if things go really bad (the “worst case”). Of course, things can go really well too, but that’s a situation we don't usually spend a lot of time analyzing.

Monte Carlo Analysis

You identify all the variables that influence your results, and the likely range (including good and bad) that they will cover. You then generate a large number of scenarios (hundreds to millions, de
pending on the number of variables) by picking values at random for each of the variables. You then evaluate your plan for each of the scenarios, average all the results and call that the “expected value.” If you compare the expected value (the return) and standard deviation (the risk) among multiple plans, you can choose the point you want to be on in the risk/reward spectrum. Typically a higher expected value has more risk associated with it.

War Gaming
This is typically a multi-player and turn-based situation in which real people take on the roles of competitors or adversaries (hence the “war” part of the name) and compete with each other
in a virtual environment. This is an excellent approach for strategic decisions, because real people who are experienced in a domain (a market or a theatre of war) will pose much more realistic challenges to your plan. Furthermore, the turn-based aspect of war gaming means that the players can adapt to changes.

Vignettes
In this approach, people work together to identify the factors that can affect a system. These drivers are put into a common framework, which might be conceptual or a concrete software model. There are usually too many variables (influencing factors) initially, and the team works to pare this list down in two ways
  1. Developing a consensus as to which variables are independent (as opposed to variables that directly influence each other)
  2. Determining which of the variables from #1 are most influential in the behavior of the system.
Once there is a reasonable number of variables, the scenarios are fleshed out. Usually the variables are boiled down to two, which form the x and y axis of a plane. Each quadrant of the plane is given a name. For example, the x axis might range from dictatorship to democracy, and the y axis from socialism to capitalism, giving you a socialist dictatorship, a capitalistic democracy, and so on.

With these scenarios defined, the team discusses what the implications are in these situations. What opportunities and risks arise? Which do we want? How do we get there? Etc.

A Relevant Example
The current economic crisis provides a great real-time case study of scenario analysis. This is because the US government will, over the next several weeks, be subjecting major banks to a “capital assessment”, more commonly called the “Stress Test”. This is a “What If?” analysis in which:
"Each participating financial institution has been instructed t o analyze potential firm‐wide losses, including in its loan and securities portfolios, as well as from any off‐balance sheet commitments and contingent liabilities/exposures… The capital assessment will cover two economic scenarios: a baseline scenario and a more adverse scenario."
The two scenarios are known as “baseline” and “more adverse”. The baseline scenario “is intended to represent a consensus view about the depth and duration of the recession.” The variables in the scenarios are GDP (Gross Domestic Product, a measure of the total economic output of the US), unemployment, and housing prices. The more adverse scenario looks at situations that are believed to be 10% likely for each individual variable, and assumes that all three variables fall reach this pessimistic value. The charts below show the three variables for each metric.
The government chose worst-case analysis for a few reasons.
  • First of all, evaluating a $100B bank’s balance sheet against a scenario is a very involved task, and time and manpower is short. So, the number of scenarios needs to be limited and Monte Carlo is out.
  • Since the government is the only “agent” that can take any action to stabilize the economy, there isn’t really any competitor or adversary (other than the “invisible hand”). So war-gaming is out.
  • Finally, there’s no need to explore where the system (the economy) might go—that’s pretty well known. The influencing factors are well known too. So no need for Vignettes.

What will the government do when the stress test is complete? Stay tuned as we all find out…

Sunday, February 22, 2009

Not quite a simulation...

... but better than words alone, this animated explanation of the genesis of the financial meltdown is both entertaining and explanatory. We see the motivations of the various agents, the behaviors these motivations generate, the interactions that ensue, and the unintended consequences when the whole thing is put into action. Truly inspired, and inspiring!


The Crisis of Credit Visualized from Jonathan Jarvis on Vimeo.

Imagine if a simulation generated this kind of an output.