SGSolve
RiskSharingGame Class Reference

Two player version of the Kocherlakota (1996) risk sharing game. More...

#include <sgrisksharing.hpp>

Inheritance diagram for RiskSharingGame:
Collaboration diagram for RiskSharingGame:

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
 

Private Attributes

int numEndowments
 
int c2e
 
double persistence
 
vector< double > E
 
int midPoint
 
double eIncr
 
double cIncr
 
vector< vector< double > > stateProbSum
 
vector< int > numActions_total
 
EndowmentMode endowmentMode
 

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...
 

Detailed Description

Two player version of the Kocherlakota (1996) risk sharing game.

Examples
risksharing_maxminmax.cpp.

Member Function Documentation

◆ isEquilibriumAction()

virtual bool RiskSharingGame::isEquilibriumAction ( int  state,
const vector< int > &  actions 
) const
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.

◆ payoffs()

virtual SGPoint RiskSharingGame::payoffs ( int  state,
const vector< int > &  actions 
) const
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.

◆ probability()

virtual double RiskSharingGame::probability ( int  state,
const vector< int > &  actions,
int  statep 
) const
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.


The documentation for this class was generated from the following file: