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
)
An object of normal_form
class defined by
normal_form()
.
A positive integer specifying the number of samples to be simulated.
A positive integer specifying how many times the game is played within each sample.
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.
Player 1's first strategy. If not specified, a strategy is randomly selected from the player's strategy set.
Player 2's first strategy. If not specified, a strategy is randomly selected from the player's strategy set.
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.
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.
A positive value controlling the weight of the best response to the previous move of the opponent.
A named list of parameters contained in
game$payoff$payoffs1
that should be treated as constants, if any.
A named list of parameters contained in
game$payoff$payoffs2
that should be treated as constants, if any.
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.
A data frame of simulation results.
Simulate plays expected in a normal-form game defined by
normal_form()
.