The DTREE Procedure |
Continuing with the oil wildcatter's problem, suppose that
in addition to possibly buying insurance to spread the risk of
the venture, the wildcatter is considering sharing the risk
by selling a portion of this venture to other investors.
Now, the decision he faces is whether to buy insurance or not
and what percentage of the investment to divest.
Again, assume that the wildcatter is risk averse with a
risk tolerance of $.
Notice that in the program that follows the
'Divestment'
decision includes possibilities of no divestment
to 100% divestment in 10% increments.
/* -- create the STAGEIN= data set -- */ data Dtoils4; format _STNAME_ $12. _OUTCOM_ $15. _SUCCES_ $12.; input _STNAME_ $ _STTYPE_ $ _OUTCOM_ $ _SUCCES_ $ ; datalines; Divestment Decision No_Divestment Insurance . . 10%_Divestment Insurance . . 20%_Divestment Insurance . . 30%_Divestment Insurance . . 40%_Divestment Insurance . . 50%_Divestment Insurance . . 60%_Divestment Insurance . . 70%_Divestment Insurance . . 80%_Divestment Insurance . . 90%_Divestment Insurance . . 100%_Divestment . Insurance Decision Buy_Insurance Cost . . Do_Not_Buy Cost Cost Chance Low Oil_Deposit . . Fair Oil_Deposit . . High Oil_Deposit Oil_Deposit Chance Dry . . . Wet . . . Soaking . ;
The 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 used in the section "Introductory Example".
/* -- create the PROBIN= data set -- */ data Dtoilp4; input _EVENT1 $ _PROB1 _EVENT3 $ _PROB3 ; datalines; Low 0.2 Dry 0.5 Fair 0.6 Wet 0.3 High 0.2 Soaking 0.2 ; /* -- create the PAYOFFS= data set -- */ data Dtoilu4(drop=i j k l); length _STATE1-_STATE4 $16. ; format _VALUE_ dollar12.0;
/* define and initialize arrays */ array DIVEST{11} $16. _TEMPORARY_ ('No_Divestment', '10%_Divestment', '20%_Divestment', '30%_Divestment', '40%_Divestment', '50%_Divestment', '60%_Divestment', '70%_Divestment', '80%_Divestment', '90%_Divestment', '100%_Divestment' ); array INSUR{3} $16. _TEMPORARY_ ('Do_Not_Buy', 'Buy_Insurance', ' ' ); array COST{4} $ _TEMPORARY_ ('Low', 'Fair', 'High', ' ' ); array DEPOSIT{4} $ _TEMPORARY_ ('Dry', 'Wet', 'Soaking', ' ' ); do i=1 to 10; /* loop for each divestment */ _STATE1=DIVEST{i}; /* determine the percentage of ownership */ /* retained for this scenario */ PCT=1.0-((i-1)*0.1); do j=1 to 2; /* loop for insurance decision */ _STATE2=INSUR{j}; /* determine the premium need to pay */ /* for this scenario */ if _STATE2='Buy_Insurance' then PREMIUM=130000; else PREMIUM=0; do k=1 to 3; /* loop for each well cost */ _STATE3=COST{k}; /* determine the cost for this scenario */ if _STATE3='Low' then _COST_=150000; else if _STATE3='Fair' then _COST_=300000; else _COST_=500000;
do l=1 to 3; /* loop for each deposit type */ _STATE4=DEPOSIT{l}; /* determine the oil deposit and the */ /* corresponding net payoff for this */ /* scenario */ if _STATE4='Dry' then _PAYOFF_=0; else if _STATE4='Wet' then _PAYOFF_=700000; else _PAYOFF_=1200000; /* determine redeem received for this */ /* scenario */ if _STATE2='Buy_Insurance' and _STATE4='Dry' then REDEEM=200000; else REDEEM=0; /* calculate the net return for this */ /*scenario */ _VALUE_=(_PAYOFF_-_COST_-PREMIUM+REDEEM)*PCT; /* drop unneeded variables */ drop _COST_ _PAYOFF_ PREMIUM REDEEM PCT; /* output this record */ output; end; end; end; end; /* output an observation for the scenario */ /* 100%_Divestment */ _STATE1=DIVEST{11}; _STATE2=INSUR{3}; _STATE3=COST{4}; _STATE4=DEPOSIT{4}; _VALUE_=0; output; run;
The Dtoilu4 data set for this problem, which contains 181 observations and 5 variables, is displayed in Output 5.2.1.
Output 5.2.1: Payoffs of the Oil Wildcatter's Problem with Risk Sharingtitle "Oil Wildcatter's Problem"; proc dtree stagein=Dtoils4 probin=Dtoilp4 payoffs=Dtoilu4 criterion=maxce rt=1200000 nowarning; evaluate; summary / target=Divestment; summary / target=Insurance; quit;
The optimal decision summaries in Output 5.2.2 and Output 5.2.3 show the optimal strategy for the wildcatter.
The DTREE Procedure
Optimal Decision Summary
|
The DTREE Procedure
Optimal Decision Summary
|
This information can be illustrated graphically using the GPLOT procedure. Output 5.2.4, produced by the PROC GPLOT statements shown in the following code, provides a clear picture of the effects of the divestment possibilities and the insurance options.
/* create a data set for the return corresponds to each */ /* divestment possibilities and the insurance options */ data Data2g; input INSURE DIVEST VALUE; datalines; 1 0 45728 0 0 44499 1 10 46552 0 10 48021 1 20 46257 0 20 49907 1 30 44812 0 30 50104 1 40 42186 0 40 48558 1 50 38350 0 50 45219 1 60 33273 0 60 40036 1 70 26927 0 70 32965 1 80 19284 0 80 23961 1 90 10317 0 90 12985 1 100 0 0 100 0 ; /* -- define a format for INSURE variable -- */ proc format; value sample 0='Do_Not_Buy' 1='Buy_Insurance'; run; /* -- define title -- */ title h=3 "Oil Wildcatter's Problem"; /* -- set graphics options -- */ goptions lfactor=3; /* define legend -- */ legend1 frame cframe=ligr label=none cborder=black position=center ; /* define symbol characteristics of the data points */ /* and the interpolation line for returns vs divestment */ /* when INSURE=0 */ symbol1 c=cyan i=join v=dot l=1 h=1.5; /* define symbol characteristics of the data points */ /* and the interpolation line for returns vs divestment */ /* when INSURE=1 */ symbol2 c=green i=join v=square l=2 h=1.5; /* -- define axis characteristics -- */ axis1 minor=none label=('Divestment (in percentage)'); axis2 minor=none label=(angle=90 rotate=0 'Certainty Equivalent'); /* plot VALUE vs DIVEST using INSURE as third variable */ proc gplot data=Data2g ; plot VALUE*DIVEST=INSURE / haxis=axis1 vaxis=axis2 legend=legend1 name="dt2" frame cframe=ligr ; format INSURE SAMPLE.; run; quit;
Note that the data input into the Data2g data set is obtained
from the optimal decision
summary as in Output 5.2.3.
The value 1 of the INSURE
variable represents the alternative 'Buy_Insurance'
and the value
represents the alternative 'Do_Not_Buy'
.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.