Package: RelationalContracts 0.2.0

RelationalContracts: Characterize relational contracts in repated or stochastic games

Characterize relational contracts in repated or stochastic games. Can also analyse repeated negotiation equilibria.

Authors:Sebastian Kranz

RelationalContracts_0.2.0.tar.gz
RelationalContracts_0.2.0.zip(r-4.5)RelationalContracts_0.2.0.zip(r-4.4)RelationalContracts_0.2.0.zip(r-4.3)
RelationalContracts_0.2.0.tgz(r-4.4-any)RelationalContracts_0.2.0.tgz(r-4.3-any)
RelationalContracts_0.2.0.tar.gz(r-4.5-noble)RelationalContracts_0.2.0.tar.gz(r-4.4-noble)
RelationalContracts_0.2.0.tgz(r-4.4-emscripten)RelationalContracts_0.2.0.tgz(r-4.3-emscripten)
RelationalContracts.pdf |RelationalContracts.html
RelationalContracts/json (API)

# Install 'RelationalContracts' in R:
install.packages('RelationalContracts', repos = c('https://skranz.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/skranz/relationalcontracts/issues

On CRAN:

dynamic-gameeconomicsgame-theoryhold-upnash-equilibriumrepeated-gamestochastic-game

2.48 score 4 stars 15 scripts 154 exports 25 dependencies

Last updated 4 years agofrom:e29d080e8b (on master). Checks:OK: 1 WARNING: 6. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 22 2024
R-4.5-winWARNINGSep 22 2024
R-4.5-linuxWARNINGSep 22 2024
R-4.4-winWARNINGSep 22 2024
R-4.4-macWARNINGSep 22 2024
R-4.3-winWARNINGSep 22 2024
R-4.3-macWARNINGSep 22 2024

Exports:A1A2.to.a.gridadd.action.detailsadd.eqs.labsadd.rel.multistage.compileadd.rne.action.labelsadd.to.rel.defsadd.to.rel.listadvanced.paste.matrix.colsanimate_capped_rne_historyanimate_eq_liapproxeqarms.race.exampleassert.action.namescapped.rne.iterationscapped.rne.multistage.iterationscapped.rne.period.Tcheck.relcheck.rel.colnamescheck.rel.has.colscolnamescompare_eqcompile.sdfcompile.sdf.classiccompute.after.cap.action.indscompute.delta.rhocompute.eq.trans.matcompute.nacompute.optimal.payoffs.from.actionscompute.optimal.payoffs.from.eq.actionscompute.payoff.for.statecompute.rep.game.action.listscompute.rep.game.nash.threatscompute.x.trans.matdeparse1diagnose_transitionsdyngame.sol.to.rel.soleq_combine_xgroupeq_diagrameq_diagram_xgroupeq.a.to.axeq.ax.to.aeq.li.compareeval.rel.expressionexample.relholdexample.rneexamples.diagnoseexamples.eq_diagramexamples.joint_independentexamples.multistageexamples.multistage.spe.truncexamples.rel_state_probsexamples.rel.speexamples.rne_cappedexamples.spe.truncexpand_gridexpand.grid2extend.rangefactor.cols.as.stringsfind.best.reply.payoffsfind.cyclesfind.eq.chain.xfind.eq.li.action.repetitionsfind.same.eqsfind.static.a.for.all.xfind.static.ci.for.all.xfind.static.G.for.all.xfind.static.payoffs.for.all.xfirst.non.nullget_capped_historyget_eqget_mpeget_repgames_resultsget_rneget_rne_detailsget_speget_T_rne_historyget.def.xhas.colhas.colsirvirv_joint_distirv_valmake.ax.labelsmake.rel.dyngamemake.rsg.gamemake.state.lab.amake.state.lab.aimatch.by.colsmpe.examplenlistnon.nullnum.cycles.of.lengthold.make.state.lab.apaste.df.colspaste.matrix.colsplot_eq_payoff_setplot.eqsplot.rne.payoff.setplot.rsg.payoff.setprepare.after.capprepare.for.speprint.relgamequick_dfr_rne_find_actionsr.capped.rne.iterationsr.capped.rne.multistage.iterationsr.pl1.ax.best.reply.payoffsr.pl2.ax.best.reply.payoffsr.which.chunk.maxsrel_after_cap_actionsrel_after_cap_payoffsrel_capped_rnerel_capped_rne_oldrel_change_paramrel_compilerel_eq_as_discounted_sumsrel_first_bestrel_gamerel_is_eq_rnerel_mperel_optionsrel_paramrel_rnerel_rne_from_cappedrel_rne_from_eq_actionsrel_scale_eq_payoffsrel_solve_repgamesrel_sperel_spe_classicrel_staterel_state_probsrel_statesrel_T_rnerel_transitionrel.capped.rne.multistage.oldrep.games.to.rne.dfscale.eq.payoffssimulate.eqsizes.to.chunk.indssolve.weakly.directional.statesolve.x.rep.multistagesolve.x.repgamesolve.x.repgame.externalstatic.nash.eqstudy_convergencestudy_convergene_exampletrans.mat.multtrne_cycle_infotrunc_policy_iterationtrunc.spe.cheating.payoffstrunc.spe.full.dyn.vitrunc.spe.harshest.punishmenttrunc.spe.highest.Uwhich.chunk.maxsxrow.a.to.ax

Dependencies:clicpp11dplyrfansigenericsgluelifecyclemagrittrmatrixStatspillarpkgconfigpurrrR6RcppRelationalContractsCpprestorepointrlangstringistringrtibbletidyrtidyselectutf8vctrswithr

Readme and manuals

Help Manual

Help pageTopics
Use ggplotly to show an animation of the payoff sets of a capped RNE going from t=T to t=1animate_capped_rne_history
Use ggplotly to show an animation of the payoff sets of a list of equilibriaanimate_eq_li
Helper function to find differences between two equilibriacompare_eq
Take a look at the computed transitions for each state using separate data framesdiagnose_transitions
Aggregate equilibrium behavior in games with random active playereq_combine_xgroup
Draws a diagram of equilibrium state transitioneq_diagram
Draws a diagram of equilibrium state transitioneq_diagram_xgroup
Get the last computed equilibrium of game gget_eq
Get the results of all solved repeated games assuming the state is fixedget_repgames_results
Get the last computed RNE of game gget_rne
Retrieve more details about the last computed RNEget_rne_details
Get the last computed SPE of game gget_spe
Get the intermediate steps in from t = T to t = 1 for a T-RNE or capped RNE that has been solved with 'save.history = TRUE'get_T_rne_history
Helper functions to specify state transitionsirv
Helper function to specify state transitionsirv_joint_dist
Helper functions to specify state transitionsirv_val
Show a base R plot of equilibrium payoff setplot_eq_payoff_set
Fix action profiles for the equilibrium path (ae) and during punishment (a1.hat and a2.hat) that are assumed to be played after the cap in period T onwards. The punishment profile a1.hat is the profile in which player 1 already plays a best-reply (in a1 he might play a non-best reply). From the specified action profiles in all states, we can compute the relevant after-cap payoffs U(x), v1(x) and v2(x) assuming that state transitions would continue.rel_after_cap_actions
Specify the SPE payoff set(s) of the truncated game(s) after a cap in period T. While we could specify a complete repeated game that is played after the cap, it also suffices to specify just an SPE payoff set of the truncated game of the after-cap state.rel_after_cap_payoffs
Solve an RNE for a capped version of a gamerel_capped_rne
Add parameters to a relational contracting gamerel_change_param
Compiles a relational contracting gamerel_compile
Translate equilibrium payoffs as discounted sum of payoffsrel_eq_as_discounted_sums
Compute first-best.rel_first_best
Creates a new relational contracting gamerel_game
Checks if an equilibrium eq with negotiation payoffs is an RNErel_is_eq_rne
Tries to find a MPE by computing iteratively best repliesrel_mpe
Set some game optionsrel_options
Add parameters to a relational contracting gamerel_param
Find an RNE for a (weakly) directional gamerel_rne
Scale equilibrium payoffsrel_scale_eq_payoffs
Solves for all specified states the repeated game assuming the state is fixedrel_solve_repgames
Finds an optimal simple subgame perfect equilibrium of g. From this the whole SPE payoff set can be deduced.rel_spe
Compute the long run probability distribution over states if an equilibrium is played for many periods.rel_state_probs
Add one or multiple states. Allows to specify action spaces, payoffs and state transitions via functionsrel_state rel_states
Compute a T-RNErel_T_rne
Add a state transition from one state to one or several states. For more complex games, it may be preferable to use the arguments 'trans.fun' of 'link{rel_states}' instead.rel_transition