spsetdist


Purpose
It is used for setting discretized distribution of sprand.
Synopsis
spsetdist(rn: sprand, val: array() of real, prob: array() of real)
spsetdist(rns: set of sprand, val: array() of real, prob: array() of real)
Arguments
rn 
independet stochastic random element
rns 
jointly independet stochastic random elements
val 
discrete values rn(s) may assume
prob 
probabilities with which rn(s) assumes discrete values
Example
Ex 1: Following code shows how to set an sprand's independent distribution
declarations
	val,prob:array(1..3) of real
end-declarations
val:=[10,20,30];prob:=[0.2,0.5,0.3]
spsetdist(rn,val,prob)   			
   
Ex 2: Following code shows how to set joint distribution of set of sprands
! {return('Stock'),return('Bond'),return('Cash')}= [1.20, 1.08, 1.02] w.p 0.3
!                                                = [0.90, 1.03, 1.00] w.p 0.7
     
declarations
	Asset={'Stock','Bond','Cash'}
	return: array(Asset) of sprand
	rns: set of sprand
	val:array(Asset,1..2) of real
	prob:array(1..2) of real
end-declarations

rns:=union(i in Asset) {return(i)};    ! {return('Stock'),return('Bond'),return('Cash')}
val:=[1.20, 0.90,                      ! Stock
      1.08, 1.03,                      ! Bond
      1.02, 1.00];                     ! Cash
prob:=[0.3,                            ! up branch
       0.7];                           ! down branch

spsetdist(rns,val,prob)

   
Further information
1. If rn belongs to first stage then by default it is equal to 0. Its value may however be changed by setting its ditribution corresponding to a discrete value with probability 1.0.
2. If some sprands are jointly distributed then thier discetized distributions can be passed using the overloaded procedures.
3. Tree can be generated by calling spgenexh().
Related topics
spgenexh


If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.