SGSolve
|
Two player version of the Kocherlakota (1996) risk sharing game. More...
#include <sgrisksharing.hpp>
Public Types | |
enum | EndowmentMode { Consumption, Endowment } |
Public Member Functions | |
RiskSharingGame (double delta, int _numEndowments, int _c2e, double _persistence, EndowmentMode _mode) | |
virtual SGPoint | payoffs (int state, const vector< int > &actions) const |
The payoff function. More... | |
virtual double | probability (int e, const vector< int > &actions, int ep) const |
Transition probabilities. More... | |
virtual bool | isEquilibriumAction (int state, const vector< int > &actions) const |
Public Member Functions inherited from SGAbstractGame | |
SGAbstractGame (int _numPlayers, double _delta, int _numStates, vector< vector< int > > _numActions) | |
Constructor for the pure virtual class. | |
SGAbstractGame (double _delta, int _numStates, vector< vector< int > > _numActions) | |
Constructor for the pure virtual class. More... | |
virtual bool | constrained (int player) const |
Returns true if the given player is incentive constrained. More... | |
SGPoint | payoffs (int state, int action) const |
An overloaded version of payoffs that uses a linear action index. More... | |
double | probability (int state, int action, int statep) const |
bool | isEquilibriumAction (int state, int action) const |
int | getNumPlayers () const |
Returns the number of players. | |
double | getDelta () const |
Returns the discount factor. | |
double | getNumStates () const |
Returns the number of states. | |
const vector< vector< int > > | getNumActions () const |
Returns the number of actions array. | |
Private Member Functions | |
double | consumption (int e, int t) const |
double | cdf (double x) const |
double | probHelper (int e, int t, int ep) const |
Additional Inherited Members | |
Protected Member Functions inherited from SGAbstractGame | |
vector< int > | indexToActions (int index, int state) const |
Converts a linear index to multiindex. More... | |
Protected Attributes inherited from SGAbstractGame | |
int | numPlayers |
The number of players, always 2. | |
double | delta |
The discount factor. | |
int | numStates |
The number of states. | |
vector< vector< int > > | numActions |
The numbers of actions in each state. More... | |
Two player version of the Kocherlakota (1996) risk sharing game.
|
inlinevirtual |
Returns true if the given action pair can be played in equilibrium
The default definition of this method always returns true, so that all action pairs can be played in equilibrium. By redefining this method, the user can create models in which only a subset of action pairs are played on the equilibrium path.
Reimplemented from SGAbstractGame.
|
inlinevirtual |
The payoff function.
A class that is derived from SGAbstractGame must define the payoffs method, which returns, for a given state and action pair, the flow payoffs that the players receive as an SGPoint.
Implements SGAbstractGame.
|
inlinevirtual |
Transition probabilities.
A class that derives from SGAbstractGame must define the probability method, which gives, for each state and action pair and new state, the probability of reaching the new state tomorrow when starting from the given state and when the given action pair is played.
Implements SGAbstractGame.