evaluate_treaty_cases.Rd
Evaluate whether or not the treaty will be made under multiple scenarios
evaluate_treaty_cases(params_df, return_criteria = "qp", progress_bar = FALSE)
params_df | Data.frame of parameters with each row sent to |
---|---|
return_criteria | Character string containing letters that indicate output variables. See details. |
progress_bar | Show a progress bar. Useful in unconfined aquifers for large N |
Returns a tibble
containing z-values needed for the treaty
and whether or not there is a treaty (i.e., if zRange > 0), as well as output specified by return_criteria
.
If the aquifer in the game is confined (see ?check_params
for how aquifer type is determined) the solution is
exact. If the aquifer is unconfined, the solution is calculated numerically using multiroot
from the rootSolve
package, using default tolerance parameters. This means that there
could be small errors in the results for zMinSwiss
and zMaxFrench
. For unconfined aquifers,
zRange
is rounded to the 6th decimal place to minimize the effect of numerical errors on
the treaty outcome. If necessary, it can be recalculated as zRange = zMaxFrench - zMinSwiss
.
In unconfined aquifers, it is possible that the game converges on a result that allows the aquifer
to be fully depleted for as least one of the players (hi < 0). In this case, the results will included
three additional columns:
AD_fb,AD_nash,AD_cheat
, representing logical values that indicate in which scenario the aquifer was depleted
(first best, nash, or cheat). In the nonlinear game, this *should* only happen in one of two scenarios:
A treaty is signed to maximize join utility, but a cheat pumps more and the aquifer is depleted for the other player. In this case, the treaty is set to "N", even if trust is equal to 1.
The numerical root finder jumps to a value where the aquifer is fully depleted. This is unlikely, as the initial guesses are set to minimize the change of this occurring.
Evaluate the treaty given multiple combinations of social, economic, and geophysical parameters. This function takes a data.frame of parameters, evaluates each row to see if a treaty is signed, and returns a tibble with the results and original params.
The parameter return_criteria
can contain the following letters:
p - will return only parameters different from default. Otherwise all parameters returned
a - return all parameters (i.e., it's redundant to include a AND p)
u - return utilities of each player
d - return depth to water table for each player
Note that the cost of pumping is linear for confined aquifers, and nonlinear for unconfined aquifers, with the nonlinearity depending on the parameter l, with the key feature that the cost become infinite as h -> 0. For l = 0, the cost function is exponential and crosses 0 when h_i = dB_i. As l increases towards 1, the solution becomes more linear when the water table is near the surface. When l == 1, a linear solution is used and the cost remains linear even when the aquifer is fully depleted
#> # A tibble: 2 x 10 #> treaty zRange zMinSwiss zMaxFrench qshat qsstar qsdouble qfhat qfstar qfdouble #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 Y 0.0443 -0.0222 0.0222 6.87 8.74 9.04 6.87 8.74 9.04 #> 2 Y 0.0443 -0.0222 0.0222 6.87 8.74 9.04 6.87 8.74 9.04#> # A tibble: 2 x 30 #> treaty zRange zMinSwiss zMaxFrench qshat qsstar qsdouble qfhat qfstar #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 Y 0.00954 -0.0236 -0.0141 5.98 6.85 6.96 5.09 6.10 #> 2 Y 0.00954 -0.0236 -0.0141 5.98 6.85 6.96 5.09 6.10 #> # … with 21 more variables: qfdouble <dbl>, Us_hat <dbl>, Us_star <dbl>, #> # Us_double <dbl>, Us_hat_double <dbl>, Us_double_double <dbl>, Uf_hat <dbl>, #> # Uf_star <dbl>, Uf_double <dbl>, Uf_hat_double <dbl>, #> # Uf_double_double <dbl>, ds_hat <dbl>, ds_star <dbl>, ds_double <dbl>, #> # ds_hat_double <dbl>, ds_double_double <dbl>, df_hat <dbl>, df_star <dbl>, #> # df_double <dbl>, df_hat_double <dbl>, df_double_double <dbl># with progress bar params <- do.call(rbind,rep(list(example_params_confined),200)) results <- evaluate_treaty_cases(params,"qudp", progress_bar = TRUE)#> | | | 0% | | | 1% | |= | 1% | |= | 2% | |== | 2% | |== | 3% | |== | 4% | |=== | 4% | |=== | 5% | |==== | 5% | |==== | 6% | |===== | 6% | |===== | 7% | |===== | 8% | |====== | 8% | |====== | 9% | |======= | 9% | |======= | 10% | |======= | 11% | |======== | 11% | |======== | 12% | |========= | 12% | |========= | 13% | |========= | 14% | |========== | 14% | |========== | 15% | |=========== | 15% | |=========== | 16% | |============ | 16% | |============ | 17% | |============ | 18% | |============= | 18% | |============= | 19% | |============== | 19% | |============== | 20% | |============== | 21% | |=============== | 21% | |=============== | 22% | |================ | 22% | |================ | 23% | |================ | 24% | |================= | 24% | |================= | 25% | |================== | 25% | |================== | 26% | |=================== | 26% | |=================== | 27% | |=================== | 28% | |==================== | 28% | |==================== | 29% | |===================== | 29% | |===================== | 30% | |===================== | 31% | |====================== | 31% | |====================== | 32% | |======================= | 32% | |======================= | 33% | |======================= | 34% | |======================== | 34% | |======================== | 35% | |========================= | 35% | |========================= | 36% | |========================== | 36% | |========================== | 37% | |========================== | 38% | |=========================== | 38% | |=========================== | 39% | |============================ | 39% | |============================ | 40% | |============================ | 41% | |============================= | 41% | |============================= | 42% | |============================== | 42% | |============================== | 43% | |============================== | 44% | |=============================== | 44% | |=============================== | 45% | |================================ | 45% | |================================ | 46% | |================================= | 46% | |================================= | 47% | |================================= | 48% | |================================== | 48% | |================================== | 49% | |=================================== | 49% | |=================================== | 50% | |=================================== | 51% | |==================================== | 51% | |==================================== | 52% | |===================================== | 52% | |===================================== | 53% | |===================================== | 54% | |====================================== | 54% | |====================================== | 55% | |======================================= | 55% | |======================================= | 56% | |======================================== | 56% | |======================================== | 57% | |======================================== | 58% | |========================================= | 58% | |========================================= | 59% | |========================================== | 59% | |========================================== | 60% | |========================================== | 61% | |=========================================== | 61% | |=========================================== | 62% | |============================================ | 62% | |============================================ | 63% | |============================================ | 64% | |============================================= | 64% | |============================================= | 65% | |============================================== | 65% | |============================================== | 66% | |=============================================== | 66% | |=============================================== | 67% | |=============================================== | 68% | |================================================ | 68% | |================================================ | 69% | |================================================= | 69% | |================================================= | 70% | |================================================= | 71% | |================================================== | 71% | |================================================== | 72% | |=================================================== | 72% | |=================================================== | 73% | |=================================================== | 74% | |==================================================== | 74% | |==================================================== | 75% | |===================================================== | 75% | |===================================================== | 76% | |====================================================== | 76% | |====================================================== | 77% | |====================================================== | 78% | |======================================================= | 78% | |======================================================= | 79% | |======================================================== | 79% | |======================================================== | 80% | |======================================================== | 81% | |========================================================= | 81% | |========================================================= | 82% | |========================================================== | 82% | |========================================================== | 83% | |========================================================== | 84% | |=========================================================== | 84% | |=========================================================== | 85% | |============================================================ | 85% | |============================================================ | 86% | |============================================================= | 86% | |============================================================= | 87% | |============================================================= | 88% | |============================================================== | 88% | |============================================================== | 89% | |=============================================================== | 89% | |=============================================================== | 90% | |=============================================================== | 91% | |================================================================ | 91% | |================================================================ | 92% | |================================================================= | 92% | |================================================================= | 93% | |================================================================= | 94% | |================================================================== | 94% | |================================================================== | 95% | |=================================================================== | 95% | |=================================================================== | 96% | |==================================================================== | 96% | |==================================================================== | 97% | |==================================================================== | 98% | |===================================================================== | 98% | |===================================================================== | 99% | |======================================================================| 99% | |======================================================================| 100%