# Decision Tree Simulation – An Example

Traditional decision trees are characterized by discrete outcomes.  However, Monte Carlo simulation can be combined with a decision tree to have a more rich data set to identify risk.  We will show an example of decision tree simulation for an R&D project to see how this works.

To simulate a tree, a node's value (cost or payoff) is replaced with a random variable.  This random variable is assumed to follow a probability distribution.  For each simulation trial, each random variable in the tree is sampled, and assigned to its node's value.  The tree is then rolled back to determine expected value, utility or certainty equivalent.  This process is repeated thousands of times to determine a risk profile for the tree.

We'll use DTace to create the decision tree, and Simulation Master to simulate the tree.

Before getting into decision tree simulation let's start with the R&D project tree having discrete outcomes as a normal decision tree.

## Traditional Decision Tree for Project

Each end node emanating from a chance node has a probability and payoff associated with the node.  Therefore, each chance node has a discrete number of outcomes based on the probability of each of its child nodes.

Real life is rarely so cut and dried.  Actual outcomes can usually assume a continuous spectrum of possible values.  We can account for this by replacing discrete outcomes with a random variable that follows a probability distribution.

## Decision Tree Simulation Example 1

First, we'll look at the case where we replace the outcomes of a chance node with a single end node.  Since the probability distribution covers all outcomes, we only need one end node.  In the tree below, we've replaced the child nodes of nodes 5.1 and 13.1 with a single end node.

Note that we can only use one end node when all outcomes of a chance node are end nodes.  For example, node 7.1 has an end node and a decision node emanating from it.  We could make the value of node 14.1 a random variable, but we have to keep the 0.7 probability intact.

#### Model and Tree Set-Up

If the product is eventually developed, we will use the triangular probability distribution to model revenue for each year.  For years 3 and 4, we assume a worst-case revenue of 3, most likely of 10, and best case of 15.  In year 5, worst-case of 4, most likely of 11, and best case of 16.  For years 6 and 7, worst-case of 5, most likely of 12, and best case of 17.

These revenue random variables are entered in the worksheet using the Simulation Master function RVTRIANGULAR().  This function samples from the triangular probability distribution, the worksheet calculates present values which the tree uses during roll back.

Variable expenses are assumed to be 50% of revenue plus a fixed cost of 1.

The present value of each year's profit is calculated and we calculate the present value of years 3 through 7 and years 4 through 7.  If we proceed to development in node 5.1, then the payoff in node 9.1 is the present value of years 3-7.  If we proceed to development in node 13.1, then the payoff in node 15.1 is the present value of years 4-7.

#### Simulation Results

Notice from the results that expected value is ≤ 0 24.75% of the time.  This means we would not proceed with the project 24.75% of the time (we would choose node 2.1, since node 1.1 is negative).  We already gained information vs. a normal decision tree because just calculating expected value for discrete values only gives go/no go information.

You may be thinking, we are making a decision to proceed only once, so what does 24.75% of the time have to do with one decision?  This simply means that there is approximately a 24.75% chance of the project having a positive net present value.  How this enters into your thinking depends on your risk tolerance.

We also get more descriptive statistics of the expected value such as mean, maximum, and percentiles.

#### Counting Nodes on the Optimal Path

In the worksheet of the decision tree you'll notice some count values for various nodes in the upper left corner.  These counts are the number of times the node was on the optimal path during the simulation.  This is done with the DTace function NODEOPTCOUNT.  Refer to this tutorial for the nuts and bolts of this function and setting up simulation functions in general.

This is a handy tool to see what goes on during the simulation.  For example, node 6.1 is never on the optimal path.  This tells us that if the results are promising, we should always go ahead with development.

Also, node 2.1 is optimal for 2475/10,000 = .2475 of the 10,000 simulation trials.  This means we should not proceed in 24.75% of the simulation trials which is in agreement with the simulation results.

### Simulating to an Intermediate Node

When we rolled the tree back to the root node for each simulation trial, we either get zero (don't proceed) or a positive number.  If the expected value at node 1.1 is negative, we would choose not to proceed.  This truncates all negative expected values to zero.

Now let's say we choose to proceed with the project and we're at node 1.1.  We've assumed the risk of the project, and now we can have negative expected values.  It would be good to know the risk profile at node 1.1.  This is accomplished by simulating the tree only back to node 1.1.

The results below show this case.

We now have negative expected values.  In fact, 24.67% are ≤ 0 with -1.5 being the worst-case.

You may notice that the percentage of values ≤ 0 differs slightly from the previous simulation.  This is due to the random nature of simulation.  The difference will tend to decrease as the simulation trials are increased.

## Decision Tree Simulation Example 2

In this example we'll build upon the previous example.  Up to now we've assumed the cost for research and product development were based on single point estimates.  We could assume these costs follow a probability distribution as well.  If the costs are known such as a contract where the research and development is outsourced, we wouldn't do this.

For this example, we'll assume that our costs are estimated and subject to error.

After simulating the tree for 10,000 trials we get the following result.

The simulation shows that 72% of the time we would proceed with the project.  We would not proceed with the project is expected value is zero.

We could also simulate to node 1.1 to see the downside potential of proceeding with the project.

## Conclusion

One of the nice things about simulating a decision tree is the extra information we gain.  In our examples, we can see the percentage of times we would proceed with the project.  Traditional decision trees don't give this information.  This can be extended to intermediate nodes as we progress through the tree.

Another advantage is allowing for continuous outcomes instead of discretizing.  We can also allow for variation in single point estimates to account for risk.