sim_game() simulates plays expected in a normal-form game.

sim_game(
  game,
  n_samples,
  n_periods,
  type = "br",
  init1 = NULL,
  init2 = NULL,
  omega = 0,
  eta = 0.1,
  lambda = 1,
  cons1 = NULL,
  cons2 = NULL,
  plot_range_y = NULL
)

Arguments

game

An object of normal_form class defined by normal_form().

n_samples

A positive integer specifying the number of samples to be simulated.

n_periods

A positive integer specifying how many times the game is played within each sample.

type

A character string to tell what kind of simulation should be run. The available options are "br", "sbr", "abr", and "imitation". With "br", each player chooses the best response to the opponent's choice in the previous period. With "sbr", each player chooses the softly best response to the opponent's choice in the previous periods, With "abr", each player alternately chooses the best response to the other player's previous action. With "imitation", each player imitates the opponent's choice in the previous period. Players randomly choose their strategies or the first period in each of these options.

init1

Player 1's first strategy. If not specified, a strategy is randomly selected from the player's strategy set.

init2

Player 2's first strategy. If not specified, a strategy is randomly selected from the player's strategy set.

omega

A numeric value between 0 and 1 to control the degree of inertia in each player's behavior. If omega = 1, each player does not change their choices over time. If omega = 0, which is the default value, each player does not stick to their previous choice at all.

eta

A numeric value between 0 and 1 to control the degree of randomness in each player's behavior. If eta = 1, each player chooses their strategy completely at random. If eta = 0, each player chooses the best strategy based on the opponent's behavior in the previous period.

lambda

A positive value controlling the weight of the best response to the previous move of the opponent.

cons1

A named list of parameters contained in game$payoff$payoffs1 that should be treated as constants, if any.

cons2

A named list of parameters contained in game$payoff$payoffs2 that should be treated as constants, if any.

plot_range_y

Choose the range of vertical axis for plots. Available choices are "fixed", "full" and "free". If plot_range_y = "free", the range of y-axis depends on simulation results. If plot_range_y = "full", the range defined in game is used for each player, which can be different between players. With "fixed", the same y-axis is used for both players.

Value

A data frame of simulation results.

Details

Simulate plays expected in a normal-form game defined by normal_form().

Author

Yoshio Kamijo and Yuki Yanai yanai.yuki@kochi-tech.ac.jp