@@ -18,10 +18,10 @@ Thereafter everything worked fine. This discussion will now focus on the details
Lem provided two algorithms to go with the interface (in algorithms.py), `sapienza_bayes_v1` and `trust_weighted_average_v1`. They both appear to work and give correct results. There is some concern that `sapienza_bayes_v1` has an error because it gives two peaks rather than one when running the [Binned and Continuous Distributions](Binned and Continuous Distributions) example. We will investigate the error, if it is that, and fix it. For now we are concerned with the process of getting algorithms into the interface and uploading them to the main server code.
I added the straight_average algorithm to custom_algo.py. This implements the ideas in [A simple averaging technique to supplement the Bayes equation](A simple averaging technique to supplement the Bayes equation).. It does not handle multiple levels, however, because the averaged output is not automatically the input to the next level (as it is in Bayes). See the discussion in the above link under 'Combining input probabilities in simple averaging' to understand this. Below we discuss a way to handle this problem by using `intermediate_results`.
Also added was Eric's [trust_weighted_histogram algorithm](Dan's-proposal-for-trust-weighted-histograms). This algorithm requires an additional input, the number of bins, so a `misc_input` field was added to `AlgorithmInput` to include this easily. We will discuss this algorithm a little more below since it brings up some ideas worthy of review.
The next algorithm added was `straight_average_intermediate` which is very similar to `straight_average` but uses `intermediate_results` to allow for correctly sending results to the next level up. In essence the `intermediate_results` are just the Sapienza trust-modified probabilities of every source in the sub-group to be analyzed. The sub-group in this case is a node and its direct descendants (children). The average of the group is calculated and the list of probabilities (modified by trust) become the results for the next level. Two examples of a multi-level tree were created manually to test this concept (just run custom_algo.py). In real life transferring results between nodes will be handled by the server code, so this is really just an experiment to see that things are conceptually ok.
I added the straight_average algorithm to custom_algo.py. This implements the ideas in [A simple averaging technique to supplement the Bayes equation](A simple averaging technique to supplement the Bayes equation). It does not handle multiple levels, however, because the averaged output is not automatically the input to the next level (as it is in Bayes). See the discussion in the above link under 'Combining input probabilities in simple averaging' to understand this.
A proposed way to handle this involves the `straight_average_intermediate` algorithm which is very similar to `straight_average` but uses `intermediate_results` to allow for correctly sending results to the next level up. In essence the `intermediate_results` are just the Sapienza trust-modified probabilities of every source in the sub-group to be analyzed. The sub-group in this case is a node and its direct descendants (children). The average of the group is calculated and the list of probabilities (modified by trust) become the results for the next level. Two examples of a multi-level tree were created manually to test this concept (just run custom_algo.py). In real life transferring results between nodes will be handled by the server code, so this is really just an experiment to see that things are conceptually ok.