Commit 7efcad0b authored by Erkka Rinne's avatar Erkka Rinne
Browse files

Do not change the original scenario probabilities

Fixes #106
parent 0e19d318
......@@ -98,7 +98,7 @@ Parameters
p_msft_probability(mType, s, f, t) "Probability of forecast"
p_sProbability(s) "Probability of sample"
$if defined scenario
p_scenProbability(scenario) "Probability of scenarios"
p_scenProbability(scenario) "Original probability of scenario"
$if declared p_scenProbability
......@@ -49,14 +49,13 @@ else
loop(mft_lastSteps(mSolve, f, t), // Select last time step
// Select each scenario and the leaf sample of the scenario (using non-reduced msft)
loop((scenario, msft(mSolve, s_, f, t))$s_scenario(s_, scenario),
// Set scen. probability to the prob. of leaf sample
p_scenProbability(scenario) = p_msProbability(mSolve, s_);
// Drop scenarios with zero probability
s_scenario(s, scenario)$(not p_scenProbability(scenario)) = no;
s_scenario(s, scenario)$(not p_msProbability(mSolve, s_)) = no;
// Build scenarios starting from the leaf samples
Option clear = s_prev; s_prev(s_) = yes;
tmp = 0;
while(not tmp and p_scenProbability(scenario),
// Re-construct scenarios left from reduction
while(not tmp and p_msProbability(mSolve, s_),
loop(ss(s__, s)$s_prev(s__),
s_scenario(s, scenario) = yes$p_msProbability(mSolve, s);
Option clear = s_prev; s_prev(s) = yes;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment