gravityGE {gravityGE} | R Documentation |
Solves one sector Armington-CES gravity model with general equilibrium
Description
Solves one sector Armington-CES gravity model with general equilibrium
Usage
gravityGE(
trade_data,
theta = 4,
beta_hat_name = NULL,
a_hat_name = NULL,
multiplicative = FALSE
)
Arguments
trade_data |
A data frame that contains 'orig', 'dest', and 'flow' named columns, with additional variables as described below. |
theta |
Trade elasticity parameter (default = 4). |
beta_hat_name |
A character name in trade_data for the beta_hat variable. If NULL, a matrix of ones is used. Domestic trade ('orig' == 'dest') must have a value of 0. |
a_hat_name |
A character name in trade_data for the a_hat variable. If NULL, a matrix of ones is used. All values across 'orig' in a_hat must be the same. |
multiplicative |
Logical. If TRUE, the model is multiplicative. If FALSE, the model is additive. Default = FALSE. Additive is recommended when trade data is unbalanced. |
Value
A list containing two data frames. A dyadic ('orig' and 'dest') data frame with the new trade flows, and a unidirectional ('orig') data frame with the welfare effects.
Examples
flows <- expand.grid(LETTERS, LETTERS)
flows$flow <- 1
names(flows)[1:2] <- c("orig", "dest")
# There should be no change in welfare (all ones)
out <- gravityGE::gravityGE(
trade_data = flows,
theta = 4,
beta_hat_name = NULL,
a_hat_name = NULL,
multiplicative = FALSE
)