Chapter Contents Previous Next
 The DTREE Procedure

## Example 3.1: Oil Wildcatter's Problem with an Insurance

Again consider the oil wildcatter's problem introduced in the "Introductory Example" section. Suppose that the wildcatter is concerned that the probability of a dry well may be as high as 0.5.

The wildcatter has learned that an insurance company is willing to offer him a policy that, with a premium of \$130,000, will redeem \$200,000 if the well is dry. He would like to include the alternative of buying insurance into his analysis. One way to do this is to include a stage for this decision in the model. The following DATA step reads this new decision problem into the STAGEIN= data set named Dtoils4. Notice the new stage named ``Insurance`', which represents the decision of whether or not to buy the insurance. Also notice that the cost of the insurance is represented as a negative reward of \$130,000.

```      /* -- create the STAGEIN= data set                  -- */
data Dtoils4;
input Stage \$12. Stype  \$4. Outcome \$16. Succ \$12.
datalines;
Drill       D   Drill           Insurance              .
.           .   Not_Drill       .                      .
Cost        C   Low             Oil_Deposit            .
.           .   Fair            Oil_Deposit            .
.           .   High            Oil_Deposit            .
Oil_Deposit C   Dry             .                      .
.           .   Wet             .                      .
.           .   Soaking         .                      .
;
```

Probabilities associated with the uncertain events are given in the PROBIN= data set named Dtoilp4. Except for the order of the variables in this data set, it is the same as the Dtoilp1 data set given in the "Introductory Example" section.

```      /* -- create the PROBIN= data set                   -- */
data Dtoilp4;
input (V1-V3) (\$12.) (P1-P3) (8.2);
datalines;
Low         Fair        High        0.2     0.6     0.2
Dry         Wet         Soaking     0.5     0.3     0.2
;
```

The payoffs for this problem are now calculated to include the cost and value of the insurance. The following DATA step does this.

```      /* -- create PAYOFFS= data set                      -- */
data Dtoilu4;
input (Cost Deposit Drill Insuran ) (\$16.) ;
format Payoff dollar12.0;

/* determine the cost for this scenario */
if      Cost='Low'  then Rcost=150000;
else if Cost='Fair' then Rcost=300000;
else                     Rcost=500000;

/* determine the oil deposit and the corresponding  */
/* net payoff for this scenario                     */
if      Deposit='Dry' then Return=0;
else if Deposit='Wet' then Return=700000;
else                       Return=1200000;
```

```         /* calculate the net return for this scenario */
if      Drill='Not_Drill' then Payoff=0;
else                           Payoff=Return-Rcost;

/* determine redeem received for this scenario */
Payoff=Payoff+200000;

/* drop unneeded variables */
drop Rcost Return;

datalines;
Low             Dry             Not_Drill       .
Low             Wet             Not_Drill       .
Low             Soaking         Not_Drill       .
Fair            Dry             Not_Drill       .
Fair            Wet             Not_Drill       .
Fair            Soaking         Not_Drill       .
High            Dry             Not_Drill       .
High            Wet             Not_Drill       .
High            Soaking         Not_Drill       .
;
```

The payoff table can be displayed with the following PROC PRINT statement:

```      /* -- print the payoff table          -- */
title "Oil Wildcatter's Problem";
title3 "The Payoffs";

proc print data=Dtoilu4;
run;
```

The table is shown in Output 3.1.1.

Output 3.1.1: Payoffs of the Oil Wildcatter's Problem with an Insurance Option

 Oil Wildcatter's Problem The Payoffs

To find the optimal decision, call PROC DTREE with the following statements:

```      /* -- PROC DTREE statements                       -- */
title "Oil Wildcatter's Problem";

proc dtree stagein=Dtoils4
probin=Dtoilp4
payoffs=Dtoilu4
nowarning
;

variables / stage=Stage type=Stype outcome=(Outcome)
event=(V1 V2 V3) prob=(P1 P2 P3)
state=(Cost Deposit Drill Insuran)
payoff=(Payoff);

evaluate;

summary / target=Insurance;
```

The VARIABLES statement identifies the variables in the input data sets. The yield of the optimal decision is written to the SAS log as:

```   NOTE: Present order of stages:

Drill(D), Insurance(D), Cost(C), Oil_Deposit(C),
_ENDST_(E).

NOTE: The currently optimal decision yields 140000.
```

The optimal decision summary produced by the SUMMARY statements are shown in Output 3.1.2. The summary in Output 3.1.2 shows that the insurance policy is worth \$240,000 - \$140,000 = \$100,000, but since it costs \$130,000, the wildcatter should reject such an insurance policy.

Output 3.1.2: Summary of the Oil Wildcatter's Problem

 Oil Wildcatter's Problem

 The DTREE Procedure Optimal Decision Summary

 Order of Stages Stage Type Drill Decision Insurance Decision Cost Chance Oil_Deposit Chance _ENDST_ End

 Decision Parameters Decision Criterion: Maximize Expected Value (MAXEV) Optimal Decision Yields: \$140,000

 Optimal Decision Policy Up to Stage Insurance Alternatives or Outcomes Cumulative Reward Evaluating Value Drill Buy_Insurance -130000 \$240,000 Drill Do_Not_Buy 0 \$140,000*

Now assume that the oil wildcatter is risk averse and has an exponential utility function with a risk tolerance of \$1,200,000. In order to evaluate his problem based on this decision criterion, the wildcatter reevaluates the problem with the following statements:

```      reset criterion=maxce rt=1200000;
summary / target=Insurance;
```

The output from PROC DTREE given in Output 3.1.3 shows that the decision to purchase an insurance policy is favorable in the risk-averse environment. Note that an EVALUATE statement is not necessary before the SUMMARY statement. PROC DTREE evaluates the decision tree automatically when the decision criterion has been changed using the RESET statement.

Output 3.1.3: Summary of the Oil Wildcatter's Problem with RT = 1,200,000

 Oil Wildcatter's Problem

 The DTREE Procedure Optimal Decision Summary

 Order of Stages Stage Type Drill Decision Insurance Decision Cost Chance Oil_Deposit Chance _ENDST_ End

 Decision Parameters Decision Criterion: Maximize Certain Equivalent Value (MAXCE) Risk Tolerance: \$1,200,000 Optimal Decision Yields: \$45,728

 Optimal Decision Policy Up to Stage Insurance Alternatives or Outcomes Cumulative Reward Evaluating Value Drill Buy_Insurance -130000 \$175,728* Drill Do_Not_Buy 0 \$44,499

 Chapter Contents Previous Next Top