Chapter Contents |
Previous |
Next |
The DTREE Procedure |
Divestment
' decision includes possibilities of no divestment
to 100% divestment in 10% increments. /* -- create the STAGEIN= data set -- */ data Dtoils4; input _STNAME_ $16. _STTYPE_ $12. _OUTCOM_ $16. _SUCCES_ $16. ; 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 "Introductory Example" section.
/* -- create the PROBIN= data set -- */ data Dtoilp4; input _EVENT1 $12. _PROB1 8.2 _EVENT3 $12. _PROB3 8.2; 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 on the following pages.
Output 3.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 3.2.2 and Output 3.2.3 show the optimal strategy for the wildcatter.
|
|
/* 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 3.2.3.
The value 1 of the INSURE
variable represents the alternative `Buy_Insurance
' and the value 0
represents the alternative `Do_Not_Buy
'.
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.