ffp_opt_solin_relow: Theorem 1, Binary Optimal Allocation solution, for one...

Description Usage Arguments Value Author(s) References Examples

View source: R/ffp_opt_solin.R

Description

This is the solution to the linear optimal allocation problem. Relative allocations, summed splined, inversion. solin, solution linear. relow, relative to the lowest allocation algoritm.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ffp_opt_solin_relow(
  df,
  svr_A_i,
  svr_alpha_i,
  svr_beta_i,
  fl_N_agg,
  fl_rho,
  svr_inpalc = "optiallocate",
  svr_expout = "optiexpoutcm"
)

Arguments

df

tibble data table including variables using svr names below each row is potentially an individual who will receive alternative allocations

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

fl_rho

float preference for equality for the planner

svr_inpalc

string variable name for newly generated input optimal allocation, single word no dash

svr_expout

string variable name for newly generated expected outcome, single word no dash

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_solin_relow.html https://fanwangecon.github.io/PrjOptiAlloc/articles/ffv_opt_solin_relow.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(df_opt_dtgch_cbem4)
df <- df_opt_dtgch_cbem4
svr_A_i <- 'A_lin'
svr_alpha_i <- 'alpha_lin'
svr_beta_i <- 'beta'
fl_N_agg <- 10000
fl_rho <- -30
ls_lin_solu <- ffp_opt_solin_relow(df, svr_A_i, svr_alpha_i, svr_beta_i, fl_N_agg, fl_rho)
df_opti <- ls_lin_solu$df_opti
ar_opti_inpalc <- ls_lin_solu$ar_opti_inpalc
ar_opti_expout <- ls_lin_solu$ar_opti_expout
summary(df_opti)
print(ar_opti_inpalc)
print(ar_opti_expout)

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