# Getting Started with the Decision Tree

A decision tree can be used to plan a strategy, analyze the uncertainties, and come to conclusions. The key elements of a decision tree are called nodes and appear as a square or circle with lines connecting them. A square represents a decision node, a circle represents uncertainty, which is called a 'chance' node. A decision node contains a set of actions that you can take. A chance node contains a set of uncertain events that you do not have controls over. SpiceLogic Decision Tree software offers a special node type called "Parallel" node, which can contain multiple decision nodes and chance nodes that can be considered as parallel decision trees.

The following topics will be introduced in this tutorial.

### Start

When you start the Decision Tree Software, you will be presented with the following screen.

Now, you can start creating the decision tree by adding a start Node. A Start node can be a Decision Node, a Chance node or a parallel node.

### Decision Node as a root node

If you click the Decision Node, you will see the Decision Tree diagram view started as shown in the following screenshot.

### Act or Action Node

Say, you added a few actions in this way. Select an option node, and you will see several buttons in the flyover menu of that option node.

Double-click a node to edit the text of a node.

From the flyover the menu, you see a note option. You can add a note like this.

### Chance node

You can select an option node and from there, you can add a chance node. Once you add a chance node and select the node, you will see the choices valid for that chance node. For example, a chance node can have Uncertain events. So, you will see the menu button for adding an uncertain event.

Once you add some events, the tree may look like the following screenshot.

If you click this button "I know the probability", then you will see a probability slider shows up.

A decision tree can be formed by chaining a decision node, option node, chance node, event node, and finally terminated as a terminal node. Even though, the terminal node is not really necessary for the calculation's perspective, yet, using a terminal node is intuitive.

### What is a "Parallel" node?

A parallel node is a node where it's children are considered simultaneous decision trees. For example, you may think about 2 decision problem at the same time. Or you may have 2 mutually non-exclusive chance events. Then you can use the parallel node.

### Add Payoff to a Node

Now, it is time to analyze the actions numerically. Select an action node (children of a decision node) or an event node (children of a chance node), you will see the option to add a payoff.

Once you click that button to add set a payoff, the Multi-criteria objective wizard will show up. Select "Minimize" from the drop-down menu, and name your criteria "Cost", as shown below. In that way, you define an objective "Minimize Cost".

Then click the "Proceed" button and choose this objective as Money Type. You can choose the "Numerical Type" as well for the simple purpose. Or, choose Subjective if you simply don't want to dig deep with actual numbers.

After that, the following wizard screen will be shown. Simply click no for this simple example.

Then, you will be presented with the following wizard screen. Set the minimum possible cost and maximum possible cost. Let's use the default value shown here and click the proceed button.

Once you click the proceed button, you will be asked if you have any more objective (or criteria). Click "No" for this simple example. Yes, you can add more than one objective. Please visit this page for learning Multi-Criteria modeling.

Once you click "No", you will be taken to the Decision Tree. You will see that the Payoff dialog is opened for you so that you can set the payoff for the selected node. As you have already identified your objectives, next time you click the "payoff" button from a node, you will see this payoff dialog opens up directly without asking you to identify your objectives again.

Now, set the Cost value for the node "Car breaks down". Say, you estimate the cost like 500$. Set it by clicking the number box.

#### Removing Payoff

Once you attach a payoff to a node, you can easily remove that by right-clicking the mouse on a node to show the context menu. Then, from the context menu, you will find a button "Remove Payoff".

### Using a Probability Distribution

Practically, the cost can be a range rather than a fixed number. You can use a probability distribution to model that cost. Click the Probability Distribution button as shown here.

Clicking the Probability Distribution button will show the probability distribution gallery. You can choose a common distribution, or you can click the Custom button to model a custom distribution. For simplicity, let's choose the Normal Distribution. You will see the following window. Say, you think that, on average, your car breaks down cost can be 500$, but it can be as low as 200$ to a maximum 800$.

Click OK, and your decision tree will show the Normal Distribution symbol on the Car breaks down event node.

You can learn more about this built-in **probability distribution tool**.

Now, set the cost for the 'Go by car' node and the 'Go by plane' node. Say, you expect the fuel cost for a "car" is 200$ and a "plane" ticket is 500$. Set the values for these nodes as shown earlier. This time, you won't have to go thru the wizard for setting up objectives again. Simply click the reward button on the flyover menu and set the cost.

Your tree will look like this.

### What about using a Utility Function?

Yes, you can use a utility function for your payoff. Decision Tree Software comes with a rich modeling tool for various utility functions. You can learn more about using a Utility Function. For this simple example, we are avoiding utility functions.

### Result and Decision Criteria

You can see the expected value of a node by hovering the mouse on a node. The tooltip will show metrics.

By default, the Maximize Expected utility criterion is selected. You can change the criterion based on your risk attitude. Notice that, when you change the criterion to "LexiMin", the "Go By Plane" path is highlighted. Maximin payoff criterion is a criterion that evaluates an option based on the Worst Case Scenario (for absolute pessimists). If you go by car, from the above diagram, we can see that the worse case can be a cost of 998.53$. But if you take the plane, the worst case is the same ticket price, which is -500. As 500$ is less than 998.53$, the "Go by plane" option is recommended.

The Result Panel has a lot of analysis features that help you to gain further insights. As this tree contains probability distribution, **Monte Carlo Simulation** was performed automatically, without needing you anything to configure.

### Node Analysis (Risk Profile)

Select a node, and you will see all possible states (Risk Profile) generated base on the **Monte Carlo Simulation**.

### Sensitivity Analysis

Finally, you need to perform a sensitivity analysis, to understand which variable affects more than another variable that can change your decision. Expand the Sensitivity Analysis tab,

Clicking the chart button opens up the variable that is in question.