fictplay¶
- class quantecon.game_theory.fictplay.FictitiousPlay(data, gain=None)[source]¶
Bases:
object
Class representing a fictitious play model.
- Parameters:
- dataNormalFormGame, or array_like
The game played in a fictitious play model. data must be either NormalFormGame or an array. See NormalFormGame.
- gainscalar(float), optional(default=None)
The gain of fictitous play model. If gain is None, the model becomes a decreasing gain model. If gain is a scalar, the model becomes a constant gain model.
- Attributes:
- gNomalFormGame
The game played in the model.
- Nscalar(int)
The number of players in the model.
- playerstuple(Player)
Tuple of the Player instances in the model.
- nums_actionstuple(int)
Tuple of the number of actions, one for each player.
Methods
play
([actions, num_reps, t_init, out])Return a new action profile which is updated by playing the game num_reps times.
time_series
(ts_length[, init_actions, t_init])Return a tuple of arrays representing a time series of mixed action profiles.
- play(actions=None, num_reps=1, t_init=0, out=None, **options)[source]¶
Return a new action profile which is updated by playing the game num_reps times.
- Parameters:
- actionstuple(array_like(float)), optional(default=None)
The action profile in the initial period. If None, selected randomly.
- num_repsscalar(int), optional(default=1)
The number of iterations.
- t_initscalar(int), optional(default=0)
The period when the game starts.
- outtuple(array_like(float)), optional(default=None)
Alternative output tuple of arrays in which to place the result. Must be of the same shape as the expected output.
- **optionsKeyword arguments passed to the best response method and
other methods.
- Returns:
- tuple(ndarray(float, ndim=1))
The mixed action profile after iteration.
- time_series(ts_length, init_actions=None, t_init=0, **options)[source]¶
Return a tuple of arrays representing a time series of mixed action profiles.
- Parameters:
- ts_lengthscalar(int)
The number of iterations.
- init_actionstuple(int), optional(default=None)
The action profile in the initial period. If None, selected randomly.
- t_initscalar(int), optional(default=0)
The period when the game starts.
- **optionsKeyword arguments passed to the best response method and
other methods.
- Returns:
- tuple(ndarray(float, ndim=2))
Tuple of arrays representing time series of mixed action profile.
- class quantecon.game_theory.fictplay.StochasticFictitiousPlay(data, distribution, gain=None)[source]¶
Bases:
FictitiousPlay
Class representing a stochastic fictitious play model.
- Parameters:
- dataNormalFormGame or array_like
The game played in the stochastic fictitious play model.
- distributionscipy.stats object
The distribution of payoff shocks, which is a scipy.stats object.
- gainscalar(scalar), optional(default=None)
The gain of fictitious play model. If gain is None, the model becomes a decreasing gain model. If gain is a scalar, the model becomes a constant gain model.
- Attributes:
- See attributes of `FictitousPlay`.
Methods
play
([actions, num_reps, t_init, out])Return a new action profile which is updated by playing the game num_reps times.
time_series
(ts_length[, init_actions, t_init])Return a tuple of arrays representing a time series of mixed action profiles.