Conversation
|
Hi, the idea is nice. I want to run some tests on it first :) |
|
Hi @DanieleGioia, do you want me write some tests for this? I initially wanted to do this, and have actually also tested this locally, and it works for my use cases (fixing the tails), but I tried to clone your repo but couldn't get the tests to run. |
|
Well, yeah why not. Have you had problems with PyTest? Sometimes, it can be a nasty package. |
|
Hi again @DanieleGioia, I have added some unit tests, but I can't seem to make them run on my computer. Can you give it a go? |
|
Hi @henrikfoss, sorry for the late answer, but Christmas was in the middle, and I wanted to check out what you did more carefully. Even if your proposal is kinda sound computationally (see second comment), it doesn't convince me theoretically.
Since you fixed some "u"s a-priori, I think this is broken and should be managed differently and fixed scenarios should be included somehow. For example, by adding an additional loop for computing the minimum distance matrix w.r.t. the fixed scenarios before starting the actual algorithm, but I should think about it. Another problem I think is that you do Thus, if the first u is already in the indxR, will be added twice. Same with the for loop afterwards.
It should depend on the first u, checking if it was in the mandatory set already. Looking at the positives, once J is fixed, the redistribution of the weights is optimal according to Theorem 2.1. (Heitsch, Römisch 2003). Thus, redistribution should work fine :) What do you think, do you agree? |
I propose adding support to fix certain scenarios to always be selected. This feature is particularly useful for cases where it is important to retain specific scenarios, such as the tails of a distribution, which often contain the most significant risks to be modeled.
Example Usage
outcomes_reduced, probabilities_reduced = FFreducer.reduce(np.inf, num_bins, keep_idx=[0, len(outcomes_original) - 1])Benefits
Enhanced Functionality: This change introduces additional functionality while maintaining backward compatibility.
Risk Management: By allowing specific scenarios to be fixed, users can better model and manage risks located in the tails of the distribution.