pymarket.statistics.maximum_traded_volume.maximum_traded_volume(bids, *args, reservation_prices={})[source]
Parameters: bids (pd.DataFrame) – Collections of bids reservation_prices (dict of floats or None, (Default value = None)) – A maping from user ids to reservation prices. If no reservation price for a user is given, his bid will be assumed to be his true value. status (str) – Status of the optimization problem. Desired output is ‘Optimal’ objective (float) – Maximum tradable volume that can be obtained variables (dict) – A set of values achieving the objective. Maps a pair of bids to the quantity traded by them.

Examples

>>> bm = pm.BidManager()
0
1
2
>>> s, o, v = maximum_traded_volume(bm.get_df())
>>> s
'Optimal'
>>> o
1.5
>>> v
OrderedDict([((0, 2), 0.5), ((1, 2), 1.0)])

pymarket.statistics.maximum_traded_volume.percentage_traded(bids, transactions, reservation_prices={}, **kwargs)[source]

Calculates from the transaction dataframe the percentage of the total maximum possible traded quantity.

Parameters: (pandas dataframe) (transactions) – Table with all the submited bids (pandas dataframe) – Table with all the transactions that ocurred in the market (dict, optional) (reservation_prices) – Reservation prices of the different participants. If None, the bids will be assumed to be the truthfull values. ratio – The ratio of the maximum social welfare achieved by the collection of transactions. float

Examples

Only bid 0 and 2 trade 1 unit. That represents the 66% of all that could have been traded.

>>> tm = pm.TransactionManager()
>>> bm = pm.BidManager()