generate.eq: Equilibrium analysis of the empirical crisis signaling game

Description Usage Arguments Details Value See Also Examples

View source: R/generate.eq.r

Description

This method uses a formula and fixed data/parameters to allow for analysis of the crisis signaling game under specific settings. This function is very similar to predict.sigfit, but it is designed for analysis outside of conducting counterfactuals on a fitted model.

Usage

1
2
3
4
5
6
7
8
9
generate.eq(
  formulas,
  data,
  theta,
  type = c("actions", "outcomes"),
  na.action = na.omit,
  control = list(),
  parallel = FALSE
)

Arguments

formulas

a Formula object with no left-hand side and seven separate (7) right-hand sides. See "Details" and examples below.

data

a data frame containing the variables in the model Each row of the data frame describes an individual game d = 1, 2, ..., D. Each row d should be a summary of all of the within-game observations for game d. If the model is all constants, then this argument should be left empty.

theta

a data frame with one or more rows where each row is a parameter vector.

type

whether to provide probabilities over actions (default, returns p_C, p_R, and p_F) or outcomes (returns SQ, CD, SF, and BD).

na.action

how to deal with NAs in data.

control

list of options describing the grid search method. See "Details" for more information

parallel

logical. Should the comparative statics be computed in parallel, requires the parallel package be installed. Parallelization is done using parSapply.

Details

This function is used to consider comparative statics in the crisis signaling game, where the model of interest has pre-defined parameters. As such, it requires, at minimum, a seven-part formula and parameters. How this function behaves has to do with how data and theta are specified.

When the model is all constants (every part of the formula argument is either 0 or 1), then data is ignored. In these cases, equilibria are computed for every parameter vector, which are supplied as rows in a data frame to theta.

When there is one or more covariate in the model, then a data frame must be supplied to data. In these cases both data or theta must have at least one row. However, only one of these arguments can have multiple rows. In other words, only data or theta may vary, but not both.

For additional implementation details see predict.sigfit.

Value

An object of class sigProb containing three elements:

predicted

data frame of predicted probabilities. The first column of this data frame is called Row, which corresponds to the rows in either model or par. In the event of multiple equilibria, this column allows for mapping data and parameters to all computed equilibria.

model

data frame of covariates used to produce the predicted probabilities.

par

data frame of parameters used to produce the predicted probabilities.

See Also

plot.sigProb, predict.sigfit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## An example with one covariate
ftest1 <-  ~ 0 | #SA
             1 | #VA
             0 | #CB
             1 | #barWA
             x1 | #barWB
             1| #bara
             1 #VB
             
theta <- data.frame(VA = 1, barWA = -1.9, barWB = -2.9,
                    barWB1 = 0.1, bara = -1.2, VB = 1)
data <- data.frame(x1 = seq(from = -1,to = 2, length.out = 101))
test <- generate.eq(ftest1, data = data, theta = theta)
plot(test, prob = "pr")

## An example with all constants
ftest2 <-  ~ 0 | #SA
             1 | #VA
             0 | #CB
             1 | #barWA
             1 | #barWB  
             1 | #bara
             1 #VB
             
theta <- data.frame(VA = 1, barWA = -1.9, 
                    barWB = seq(-2.9, -2.2, length.out = 15),
                    bara = -1.2,
                    VB = 1)
test <- generate.eq(ftest2, theta = theta)
plot(test, prob = "pr")

sigInt documentation built on Jan. 11, 2020, 9:20 a.m.

Related to generate.eq in sigInt...