generate.eq {sigInt} | R Documentation |
Equilibrium analysis of the empirical crisis signaling game
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
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
|
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 |
na.action |
how to deal with |
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
|
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 eithermodel
orpar
. 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
Examples
## 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")