brd¶
- class quantecon.game_theory.brd.BRD(payoff_matrix, N)[source]¶
Bases:
object
Class representing the best response dynamics model.
- Parameters:
- payoff_matrixarray_like(float, ndim=2)
The payoff matrix of the symmetric two-player game.
- Nscalar(int)
The number of players.
- Attributes:
- Nscalar(int)
The number of players.
- num_actionsscalar(int)
The number of actions.
- playerPlayer
Player instance in the model.
Methods
play
(action, action_dist, **options)Return a new action distribution.
time_series
(ts_length[, init_action_dist])Return a time series of action distributions.
- play(action, action_dist, **options)[source]¶
Return a new action distribution.
- Parameters:
- actionscalar(int)
Pure action of player who takes action.
- action_distndarray(int)
The initial action distribution of players.
- **optionsKeyword arguments passed to the best response method.
- Returns:
- ndarray(int)
New action distribution.
- time_series(ts_length, init_action_dist=None, **options)[source]¶
Return a time series of action distributions. The order of player who takes a action is randomly choosed.
- Parameters:
- ts_lengthscalar(int)
The length of time series.
- init_action_distarray_like(int), optional(default=None)
The initial action distribution. If None, determined randomly.
- **optionsKeyword arguments passed to the best response method and
other methods.
- Returns:
- ndarray(int)
The array representing time series of action distributions.
- class quantecon.game_theory.brd.KMR(payoff_matrix, N, epsilon=0.1)[source]¶
Bases:
BRD
Class representing the Kandori-Mailath-Rob model.
- Parameters:
- payoff_matrixarray_like(float, ndim=2)
The payoff matrix of the symmetric two-player game.
- Nscalar(int)
The number of players.
- epsilonscalar(float), default=0.1
The probability of strategy flips.
- Attributes:
- Nscalar(int)
See parameters.
- num_actionsscalar(int)
The number of actions.
- playerPlayer
Player instance in the model.
- epsilonscalar(float)
See parameters.
Methods
play
(action, action_dist, **options)See play in BRD.
time_series
(ts_length[, init_action_dist])Return a time series of action distributions.
- class quantecon.game_theory.brd.SamplingBRD(payoff_matrix, N, k=2)[source]¶
Bases:
BRD
Class representing the sampling BRD model.
- Parameters:
- payoff_matrixarray_like(float, ndim=2)
The payoff matrix of the symmetric two-player game.
- Nscalar(int)
The number of players.
- kscalar(int), default=2
Sample size.
- Attributes:
- Nscalar(int)
See parameters.
- num_actionsscalar(int)
The number of actions.
- playerPlayer
Player instance in the model.
- kscalar(int), default=2
See parameters.
Methods
play
(action, action_dist, **options)See play in BRD.
time_series
(ts_length[, init_action_dist])Return a time series of action distributions.