Learning Algorithms

Exported

GameTheory.BRDType
BRD

Type representing the best response dynamics model.

Fields

  • N::Int : The number of players.
  • player::Player{2,T} : Player instance in the model.
  • num_actions::Int : The number of actions for players.
source
GameTheory.BRDMethod
BRD(N, payoff_array)

Create a new BRD instance.

Arguments

  • N::Integer : The number of players.
  • payoff_array::Matrix : Payoff array for each player.

Returns

  • ::BRD : The best response dynamics model.
source
GameTheory.KMRType
KMR

Type representing the Kandori Mailath Rob model.

Fields

  • N::Int : The number of players.
  • player::Player : Player instance in the model.
  • num_actions::Int : The number of actions for players.
  • epsilon::Float64 : The probability of strategy flips.
source
GameTheory.KMRMethod
KMR(N, payoff_array, epsilon)

Create a new KMR instance.

Arguments

  • N::Integer : The number of players.
  • payoff_array::Matrix : The payoff array for each player.
  • epsilon::Float64 : The probability of strategy flips.

Returns

  • ::KMR : The Kandori Mailath Rob model.
source
GameTheory.SamplingBRDType
SamplingBRD

Type representing the sampling best response dynamics model.

Fields

  • N::Int : The number of players.
  • player::Player : Player instance in the model.
  • num_actions::Int : The number of actions for players.
  • k::Int : Sample size.
source
GameTheory.SamplingBRDMethod
SamplingBRD(N, payoff_array, k)

Create a new SamplingBRD instance.

Arguments

  • N::Integer : The number of players.
  • payoff_array::Matrix : Payoff array for a player.
  • k::Integer : Sample size.

Returns

  • ::SamplingBRD : The sampling best response dynamics model.
source
GameTheory.playFunction
play([rng=Random.GLOBAL_RNG, ]brd, init_action_dist[, options=BROptions(); num_reps=1])

Return the action distribution after num_reps times iteration

Arguments

  • rng::AbstractRNG : Random number generator used.
  • brd::AbstractBRD : AbstractBRD instance.
  • init_action_dist::Vector{<:Integer} : The initial distribution of players' actions.
  • options::BROptions : Options for best_response method.
  • num_reps::Integer : The number of iterations.

Returns

  • ::Vector{<:Integer} : The action distribution after iterations.
source
GameTheory.FictitiousPlayType
FictitiousPlay(fp[, gain=fp.gain])

Construct a new FictitiousPlay instance from fp.

Arguments

  • fp::AbstractFictitiousPlay : AbstractFictitiousPlay instance.
  • gain::AbstractGain : Argument to specify the gain or step size.

Returns

  • ::FictitiousPlay : The fictitious play model.
source
GameTheory.FictitiousPlayType
FictitiousPlay(g[, gain=DecreasingGain()])

Construct a FictitiousPlay instance from NormalFormGame.

Arguments

  • g::NormalFormGame : NormalFormGame instance.
  • gain::AbstractGain : Argument to specify the gain or step size; DecreasingGain() or ConstantGain(size).

Returns

  • ::FictitiousPlay : The fictitious play model.
source
GameTheory.FictitiousPlayType
FictitiousPlay{N, T, TG}

Type representing a fictitious play model with N players.

Fields

  • players::NTuple{N,Player{N,T}} : Tuple of Player instances.
  • nums_actions::NTuple{N,Int} : Tuple of the numbers of actions, one for each player.
  • gain::TG<:AbstractGain : Gain type.
source
GameTheory.StochasticFictitiousPlayType
StochasticFictitiousPlay(fp[, d=fp.d, gain=fp.gain])

Construct a new StochasticFictitiousPlay instance from fp.

Arguments

  • fp::AbstractFictitiousPlay : AbstractFictitiousPlay instance.
  • d::Distributions.Distribution : Distribution instance from which payoff perturbations are drawn.
  • gain::AbstractGain : Argument to specify the gain or step size.

Returns

  • ::StochasticFictitiousPlay : The stochastic fictitious play model.
source
GameTheory.StochasticFictitiousPlayType
StochasticFictitiousPlay{N, T, TG, TD}

Type representing a stochastic fictitious play model with N players.

Fields

  • players::NTuple{N,Player{N,T}} : Tuple of Player instances.
  • nums_actions::NTuple{N,Int} : Tuple of the numbers of actions, one for each player.
  • gain::TG<:AbstractGain : Gain type.
  • d::TD<:Distributions.Distribution : Distribution instance from which payoff perturbations are drawn.
source
GameTheory.StochasticFictitiousPlayType
StochasticFictitiousPlay(g, d[, gain=DecreasingGain()])

Construct a StochasticFictitiousPlay instance.

Arguments

  • g::NormalFormGame : NormalFormGame instance.
  • d::Distributions.Distribution : Distribution instance from which payoff perturbations are drawn.
  • gain::AbstractGain : Argument to specify the gain or step size; DecreasingGain() or ConstantGain(size).

Returns

  • ::StochasticFictitiousPlay : The stochastic fictitious play model.
source
GameTheory.LocalInteractionType
LocalInteraction{N, T, S, A, TR}

Type representing the local interaction model with N players.

Fields

  • players::NTuple{N,Player{2,T}} : Tuple of Player instances.
  • num_actions::Integer : The number of actions for players.
  • adj_matrix::Array{S,2} : Adjacency matrix of the graph in the model.
  • revision<:AbstractRevision : The way to revise the action profile.
source
GameTheory.LocalInteractionMethod
LocalInteraction(payoff_matrix,
                 adj_matrix[, revision=SimultaneousRevision()])

Construct a LocalInteraction instance.

Arguments

  • payoff_matrix::Matrix : The payoff matrix of the game.
  • adj_matrix::AbstractMatrix : Adjacency matrix of the graph in the model.
  • revision::AbstractRevision : Arguments to specify the revision method. SimultaneousRevision() or AsynchronousRevision

Returns

  • ::LocalInteraction : The local interaction model.
source
GameTheory.LocalInteractionMethod
LocalInteraction(g, adj_matrix[, revision=SimultaneousRevision()])

Construct a LocalInteraction instance.

Arguments

  • g::NormalFormGame : The game used in the model.
  • adj_matrix::AbstractMatrix : Adjacency matrix of the graph in the model.
  • revision::AbstractRevision : Arguments to specify the revision method; SimultaneousRevision() or AsynchronousRevision().

Returns

  • ::LocalInteraction : The local interaction model.
source
GameTheory.LogitDynamicsType
LogitDynamics{N, T, S}

Type representing the Logit-Dynamics model.

Fields

  • players::NTuple{N,Player{N,T}} : Tuple of Player instances.
  • nums_actions::NTuple{N,Int} : Tuple of the numbers of actions, one for each player.
  • beta<:Real : The level of noise in a player's decision.
  • choice_probs::Vector{Array} : The choice probabilities of each action, one for each player.
source
GameTheory.LogitDynamicsMethod
LogitDynamics(g, beta)

Construct a LogitDynamics instance.

Arguments

  • g::NormalFormGame{N,T} : NormalFormGame instance.
  • beta::S : The level of noise in players' decision.

Returns

  • ::LogitDynamics : The Logit-Dynamics model.
source
GameTheory.play!Method
play!(rng, ld, player_ind, actions)

Return a new action of player indexed by player_ind given each players' choice probabilities.

Arguments

  • rng::AbstractRNG : Random number generator used.
  • ld::LogitDynamics{N} : LogitDynamics instance.
  • player_ind::Integer : A player index who takes an action.
  • actions::Vector{<:Integer} : The action profile.

Returns

  • ::Integer : The new action of the player indexed by player_ind.
source
GameTheory.playMethod
play([rng=Random.GLOBAL_RNG,] ld, init_actions[; num_reps=1])

Return new action profile after num_reps iterations.

Arguments

  • rng::AbstractRNG : Random number generator used.
  • ld::LogitDynamics{N} : LogitDynamics instance.
  • init_actions::PureActionProfile : Initial action profile.
  • num_reps::Integer : The number of iterations.

Returns

  • ::Vector{<:Integer} : New action profile.
source
GameTheory.time_seriesMethod
time_series([rng=Random.GLOBAL_RNG,] ld, ts_length, init_actions)

Return a time series of action profiles.

Arguments

  • rng::AbstractRNG : Random number generator used.
  • ld::LogitDynamics{N} : LogitDynamics instance.
  • ts_length::Integer : The length of time series.
  • init_actions::PureActionProfile : Initial action profile.

Returns

  • ::Matrix{<:Integer} : The time series of action profiles.
source

Internal

GameTheory.time_series!Method
time_series!(rng, brd, out, player_ind_seq, options)

Update the matrix out which is used in time_series method given a player index sequence.

Arguments

  • rng::AbstractRNG : Random number generator used.
  • brd::AbstractBRD : Instance of the model.
  • out::Matrix{<:Integer} : Matrix representing the time series of action profiles.
  • player_ind_seq::Vector{<:Integer} : The vector of player index.
  • options::BROptions : Options for best_response method.

Returns

  • out::Matrix{<:Integer} : Updated out.
source
GameTheory.time_series!Method
time_series!(rng, fp, out[, options=BROptions(); t_init=1])

Update the tuple of matrices out which is used in time_series method.

Arguments

  • rng::AbstractRNG : Random number generator used.
  • fp::AbstractFictitiousPlay{N} : AbstractFictitiousPlay instance.
  • out::NTuple{N,Matrix{<:Real}} : Tuple of matrices which represent the time series of mixed action profile.
  • options::BROptions : Options for best_response.
  • t_init::Integer : The period when the iteration starts.

Returns

  • out::NTuple{N,Matrix{<:Real}} : Updated out.
source
GameTheory.time_series!Method
time_series!(li, out, options, player_ind_seq)

Update the matrix out which is used in time_series method given player index sequence.

Arguments

  • li::LocalInteraction{N} : LocalInteraction instance.
  • out::Matrix{<:Integer} : Matrix representing a time series of action profiles.
  • options::BROptions : Options for best_response method.
  • player_ind_seq::Vector{<:Integer} : Vector representing the index of players to take an action.

Returns

  • out::Matrix{<:Integer} : Updated out.
source
GameTheory.time_series!Method
time_series!(li, out, options)

Update the matrix out which is used in time_series method. All players take their actions simultaneously.

Arguments

  • li::LocalInteraction{N} : LocalInteraction instance.
  • out::Matrix{<:Integer} : Matrix representing a time series of action profiles.
  • options::BROptions : Options for best_response method.

Returns

  • out::Matrix{<:Integer} : Updated out.
source
GameTheory.time_series!Method
time_series!(rng, ld, out, player_ind_seq)

Update the matrix out which is used in time_series method given a player index sequence.

Arguments

  • rng::AbstractRNG : Random number generator used.
  • ld::LogitDynamics{N} : LogitDynamics instance.
  • out::Matrix{<:Integer} : Matrix representing the time series of action profiles.
  • player_ind_seq::Vector{<:Integer} : The sequence of player index, which is determined randomly.

Returns

  • ::Matrix{<:Integer} : Updated out.
source