Decision Making

improb.decision.print_rst_solution(pspace, decisions, gambles, credalset, float_format='{0: g}', file=None)

Print tables with detailed calculations for solving a static decision problem.

>>> pspace = ["A", "B", "C"]
>>> decisions = ["left", "right"]
>>> gambles = [[-10, -5, 10], [1, 1, 1]]
>>> credalset = [[0.1, 0.45, 0.45], [0.4, 0.3, 0.3], [0.3, 0.2, 0.5]]
>>> print_rst_solution(pspace, decisions, gambles, credalset)
+-------------------+-----+-----+-----+-------+-------+-------+-------+-------+
|                   | *A* | *B* | *C* | *p0*  | *p1*  | *p2*  | *lpr* | *upr* |
+-------------------+-----+-----+-----+-------+-------+-------+-------+-------+
|        *A*        |                 |  0.1  |  0.4  |  0.3  |               |
+-------------------+                 +-------+-------+-------+               +
|        *B*        |                 |  0.45 |  0.3  |  0.2  |               |
+-------------------+                 +-------+-------+-------+               +
|        *C*        |                 |  0.45 |  0.3  |  0.5  |               |
+-------------------+-----+-----+-----+-------+-------+-------+-------+-------+
|      *left*       | -10 | -5  |  10 |  1.25 | -2.5  |   1   | -2.5  |  1.25 |
+-------------------+-----+-----+-----+-------+-------+-------+-------+-------+
|      *right*      |  1  |  1  |  1  |   1   |   1   |   1   |   1   |   1   |
+-------------------+-----+-----+-----+-------+-------+-------+-------+-------+
| *right* \- *left* |                 | **-** | **+** | **0** | **-** |       |
+-------------------+                 +-------+-------+-------+-------+       +
| *left* \- *right* |                 | **+** | **-** | **0** | **-** |       |
+-------------------+-----+-----+-----+-------+-------+-------+-------+-------+
<BLANKLINE>
+------------+--------+---------+
|            | *left* | *right* |
+------------+--------+---------+
| \- *left*  | **0**  |  **-**  |
+------------+--------+---------+
| \- *right* | **-**  |  **0**  |
+------------+--------+---------+

Previous topic

Set Functions

Next topic

Optimality Operators

This Page