Configuration Options - Leeps-Lab/redwood-portfolio-allocation GitHub Wiki

Treatment Options

  • rounds: Number

    The total number of rounds to be simulated for the given period.

    rounds = preSimulatedRounds + practiceRounds + playedRounds

  • preSimulatedRounds: Number

    The number of rounds that are simulated before the subject starts playing. The market lines for these rounds are displayed on the subjects interface.

    The number of pre-simulated rounds is included in the total number of rounds; it is not added to it. So if the total number of rounds is 8 and preSimulatedRounds is 3, then 3 of those 8 rounds are pre-simulated, and the remaining 5 are played by the subject.

  • practiceRounds: Number

    The number of practice rounds to be played by the subject before starting paid rounds.

    Like preSimulatedRounds, the number of practive rounds is included in the total number of rounds; it is not added to it.

  • daysPerRound: Number

    The number of simulated days per round. The number of days is the number of data points on the market line.

  • startingWealth: Number

    NO LONGER USED

    The functionality this was used for has been removed. It has been mostly or should be replaced by wealthPerRound.

  • wealthPerRound: Number

    The amount of tokens/cash/money that the subject starts with at the beginning of each round.

  • bondReturn: Number

    The return rate for bonds.

    For example, if the user allocates 500 to bonds, and bondReturn is 0.035, then at the end of the round the user gains 500 * 0.035 = 17.5 tokens/money.

  • stochasticFunction: URL or String

    Specifies the stochastic function used to simulate the market. It can be one of the following:

    • A URL referring to a csv file containing market value data. The file should be formatted so that each column is a round, and each data entry in that column is a market value for one day.

      For example:

      1000.0,1000.0,1000.0,1000.0
      1012.0,1007.3,993.41,998.32
      1007.9,1015.9,992.62,987.64
      1011.6,1019.9,1010.1,986.67
      1018.5,1038.4,987.12,965.32
      987.21,1024.1,975.47,955.58
      979.89,1023.5,970.00,948.40
      

      This file contains market values for 4 rounds. Each round has 7 days worth of data points.

    • A String containing a javascript function. For example, if stochasticFunction is

      "return x * x;"
      

      then the stochastic function becomes:

      // x is the current day, round is the current round
      function(x, round) {
          return x * x;
      }
      
    • If no URL or function string is provided, or if set to null, then the placeholder function is used:

      // x is the current day, round is the current round
      api.defaultStochasticFunction = function(x, round) {
          return Math.random() * 1000 + 500;
      };
      

Interface Options

  • secondsPerDay: Number

    The number of seconds to wait after simulating each day. Used to control the speed of the simulation.

  • plotMinY: Number

    The lower boundary of the plot view.

  • plotMaxY: Number

    The upper boundary of the plot view.