Purpose
It is used for setting values of random elements and their conditional probabilities at all the nodes in a stage.
Synopsis
spsetprobcond(p: array(range) of real)
spsetprobcond(t: integer, p: array(range) of real)
spsetprobcond(rn: sprand, v: array(range) of real)
Arguments
t
|
stage number belonging to {1..T}, where T is number of stages
|
p
|
conditional probability distribution of visiting nodes in the tth stage
|
rn
|
stochastic random element
|
v
|
realized values of rn at nodes in the tth stage, where t is the stage number of rn
|
Example
Ex 1:
! rn(2),...,rn(T) distributed with {10 w.p 0.3, 20 w.p 0.7}
spcreatetree(2) !create binary tree
val:=[10,20]
forall(t in 2..T) spsetrand(rn(t),val)
prob:=[0.3,0.7] !conditional probabilities
spsetprobcond(3,prob)
Ex 2:
branches:=[2,4] ! 8 scenarios
spcreatetree(branches) ! create a 3-stage tree with 2 branches from
! first stage node,
! and 4 branches from second nodes.
val1to2:=[50,100] !realized value of rn(2) at nodes in stage 2
spsetrand(rn(2),val1to2)
prob1to2:=[0.5,0.5] ! conditional probabilities of visting stage 2
! nodes from stage 1
spsetprobcond(2,prob1to2)
val2to3:=[5,10,15,20] ! realized value of rn(3) at nodes in stage 3
spsetrand(rn(3),val2to3)
prob2to3:=[0.2,0.3,0.4,0.1] ! conditional probabilities of visting
! stage 3 nodes from stage 2
spsetprobcond(3,prob2to3)
Further information
1. This procedure is useful when scenario tree structure is stage-wise symmetric, i.e., all the nodes in a stage have the same
conditional probability distributions of visting their children.
2. Tree can be generated by setting values of sprands in the tree and probabilities of visting nodes or scenarios, followed by
calling spgentree().
Related topics
If you have any comments or suggestions about these pages,
please send mail to docs@dashoptimization.com.