Menu

#67 beta, prices and quantities process of generation

PredictionMarkets
open
database (16)
5
2012-06-09
2012-06-05
No

We have been checking the code in order to understand your whole project and we have difficulties with some issues. We will be grateful if you could respond to these questions:
1) We know that the cost function of the market follows the LMSR where beta is a pre-determined constant. In the code appears initBetaExplicit as the method to calculate beta but it seems to be deprecated. How zocalo generates beta? (we think is related with the market maker endowment but we don´t know the formula).
2) We know that each time the market maker sells, the price increases but how exactly zocalo generates the purchase price and quantity?
3) It is Eclipse IDE suitable to add functionalities and compile your project?
Thanks in advance

Discussion

  • Chris Hibbert

    Chris Hibbert - 2012-06-06

    1) initBetaExplicit isn't deprecated. It is the code you're looking for. The two commented out lines are intended to clarify the actual calculation, which is obscured by the Quantity/Price code required in order to use BigDecimals.

    // beta = endowment / Math.log(1.0 / minProbability);
    // beta = endowment.div(Quantity.ONE.div(minProbability).absLog());
    setBeta(endowment.div(maxPrice()).div(Quantity.ONE.div(minProbability).absLog()));

    maxPrice is used because some markets (mostly in Experiment configurations) aren't based on prices ranging from zero-one.

    2) The description in the javadoc for MarketMaker is the clearest I have: http://zocalo.sourceforge.net/javadoc/net/commerce/zocalo/market/MarketMaker.html

    The entry points are buyOrSellUpToQuantity, buyUpToQuantity, and buyWithCostLimit. Each figures out how much to buy of which position, based on the implied limits, and then calls purchase() to carry out the exchange.

    3) Eclipse should work just fine, though I don't use it. I use IntelliJ, which has a free license for open source projects. If you're interested in the IntelliJ license and can't figure out how to ask them for a free license, contact me directly, and I'll try to help you get one.

     
  • Gerardo Sabater

    Gerardo Sabater - 2012-06-08

    Thanks for your helpful comments. We understand now how zocalo calculates the closing price in each transaction but we do not know (the implicit formula) how zocalo generates the quantity of coupons purchased when this number is lower than the number of coupons that the user wanted to buy.
    Thanks in advance for your support.

     
  • Chris Hibbert

    Chris Hibbert - 2012-06-09
    • labels: --> database
    • assigned_to: nobody --> hibbert
     
  • Chris Hibbert

    Chris Hibbert - 2012-06-09

    As I mentioned before, the methods buyOrSellUpToQuantity, buyUpToQuantity, and buyWithCostLimit each figures out how much to buy of which position, based on the implied limits, and then calls purchase() to carry out the exchange. The parameters to purchase() include a position and a probability. The probability has been calculated to be the max the user wants or can afford.

    purchase() returns quantityPurchased + complementsBought. In order to understand why, you should read the explanation in the javadoc for MarketMaker: http://zocalo.sourceforge.net/javadoc/net/commerce/zocalo/market/MarketMaker.html The fifth paragraph explains that there are 3 main cases: the user is providing funds and getting coupons, the user has coupons to sell, the user is selling the position and doesn't have coupons (which means they end up buying the complementary position). There are also hybrid situations where the use has N coupons and wants to sell N+M to end up holding the opposite position.

    Basically, the transaction involves buying sets of complentary coupons and trading the coupons the buyer didn't ask for in order to compensate for more shares.

    Robin Hanson's paper on Scoring Rules may also be helpful.

     

Log in to post a comment.

MongoDB Logo MongoDB