ffp_opt_anlyz_rhgin: Theorem 2, Bounded Linear Allocation solution, loop along a...

Description Usage Arguments Value Author(s) References Examples

View source: R/ffp_opt_anlyz.R

Description

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*

Usage

 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"
)

Arguments

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

Value

a dataframe that expands the df inputs with additional results.

a list with a dataframe and an array

Author(s)

Fan Wang, http://fanwangecon.github.io

References

https://fanwangecon.github.io/PrjOptiAlloc/reference/ffp_opt_anlyz_rhgin.html https://fanwangecon.github.io/PrjOptiAlloc/articles/ffv_opt_anlyz_rhgin.html

Examples

 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)

FanWangEcon/PrjOptiAlloc documentation built on Jan. 25, 2022, 6:55 a.m.