Description Usage Arguments Value Author(s) References Examples
View source: R/ffp_opt_anlyz.R
Works with linear allocation problems. The function invokes ffp_opt_solin_relow, has parameters that are also required for that function. The addition here is *fl_rho* becomes *ar_rho*
1 2 3 4 5 6 7 8 9 10 11 | ffp_opt_anlyz_rhgin(
df,
svr_id_i,
svr_A_i,
svr_alpha_i,
svr_beta_i,
fl_N_agg,
ar_rho,
svr_inpalc = "optiallocate",
svr_expout = "opti_exp_outcome"
)
|
df |
tibble data table including variables using svr names below each row is potentially an individual who will receive alternative allocations |
svr_id_i |
string name of the identify key for each i, to make sure merging happens properly |
svr_A_i |
string name of the A_i variable, dot product of covariates and coefficients |
svr_alpha_i |
string name of the alpha_i variable, individual-specific (marginal-effects) |
svr_beta_i |
string name of the beta_i variable, relative preference weight for each child |
fl_N_agg |
float total resource avaible for allocation, if not specific, sum by svr_N_i |
ar_rho |
array preferences for equality for the planner, each value from negative infinity to 1 |
svr_inpalc |
string variable name for newly generated input optimal allocation |
svr_expout |
string variable name for newly generated expected outcome |
a dataframe that expands the df inputs with additional results.
a list with a dataframe and an array
df_opti_alloc_all_rho - table with columns for optimal allocation and exp outcome different rhos
mt_opti_alloc_all_rho - a matrix row = indi, col = rho, value = optimal allocation
mt_expc_outcm_all_rho - a matrix row = indi, col = rho, value = exp outcome optimal allocations
mt_gini - a matrix row = rhos, col = opti-allo and exp-out, value = gini
Fan Wang, http://fanwangecon.github.io
https://fanwangecon.github.io/PrjOptiAlloc/reference/ffp_opt_anlyz_rhgin.html https://fanwangecon.github.io/PrjOptiAlloc/articles/ffv_opt_anlyz_rhgin.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | data(df_opt_dtgch_cbem4)
df <- df_opt_dtgch_cbem4
svr_id_i <- 'indi.id'
svr_A_i <- 'A_lin'
svr_alpha_i <- 'alpha_lin'
svr_beta_i <- 'beta'
fl_N_agg <- 10000
ar_rho = c(-50, -10, -0.1, 0.1, 0.5, 0.7)
ls_lin_solu_all_rhos <- ffp_opt_anlyz_rhgin(df, svr_id_i, svr_A_i, svr_alpha_i, svr_beta_i, fl_N_agg, ar_rho)
df_opti_alloc_all_rho <- ls_lin_solu_all_rhos$df_opti_alloc_all_rho
summary(df_opti_alloc_all_rho)
mt_opti_alloc_all_rho <- ls_lin_solu_all_rhos$mt_opti_alloc_all_rho
summary(mt_opti_alloc_all_rho)
mt_expc_outcm_all_rho <- ls_lin_solu_all_rhos$mt_expc_outcm_all_rho
summary(mt_expc_outcm_all_rho)
mt_gini <- ls_lin_solu_all_rhos$mt_gini
summary(mt_gini)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.