Description Usage Arguments Value Author(s) References Examples
View source: R/ffp_opt_solin.R
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.
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"
)
|
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 |
a dataframe that expands the df inputs with additional results.
a list with a dataframe and an array
df_opti - Dataframe with various statistcs related to optimal allocation, all intermediary stats
ar_opti_inpalc - Array where each element is an optimal choice for each individual
ar_opti_expout - Array where each element is the expected outcome given optimal choices for each i
Fan Wang, http://fanwangecon.github.io
https://fanwangecon.github.io/PrjOptiAlloc/reference/ffp_opt_solin_relow.html https://fanwangecon.github.io/PrjOptiAlloc/articles/ffv_opt_solin_relow.html
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.