Description Usage Arguments Value Author(s) References Examples
View source: R/ffp_opt_sobin.R
This does not solve for the full solution, just the targeting queue, individual position on queue.
1 2 3 4 5 6 7 8 | ffp_opt_sobin_rev(
ar_queue_optimal,
ar_bin_observed,
ar_A,
ar_alpha,
ar_beta,
fl_rho
)
|
ar_queue_optimal |
optimal targeting array index of ranking from 1 to N targetting queue |
ar_bin_observed |
observed vector of binary zeros and ones |
ar_A |
float array of expected effect of provision for each i of N |
ar_alpha |
float array of planner bias |
ar_beta |
string name of the A_i variable, any nonlinear or linear evaluated expected outcome |
fl_rho |
float preference for equality for the planner, negative infinity to 1 |
an float value for resource equivalent variation, see Theorem 1
Fan Wang, http://fanwangecon.github.io
https://fanwangecon.github.io/PrjOptiAlloc/reference/ffp_opt_sobin_rev.html https://fanwangecon.github.io/PrjOptiAlloc/articles/ffv_opt_sobin_rev.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(tibble)
library(dplyr)
library(tidyr)
fl_rho <- -1
ar_alpha <- c(0.1,1.5,2.5,4 ,9,1.2,3,2,8)
ar_A <- c(0.5,1.5,3.5,6.5,1.9,3,4,6,4)
ar_beta <- rep(0, length(ar_A)) + 1/length(ar_A)
mt_alpha_A <- cbind(ar_alpha, ar_A, ar_beta)
ar_st_varnames <- c('alpha', 'A', 'beta')
tb_alpha_A <- as_tibble(mt_alpha_A) %>% rename_all(~c(ar_st_varnames))
tb_alpha_A
ar_rho <- c(-1)
for (it_rho_ctr in seq(1,length(ar_rho))) {
fl_rho <- ar_rho[it_rho_ctr]
ls_ranks <- ffp_opt_sobin_target_row(tb_alpha_A[1,], fl_rho, ar_A, ar_alpha, ar_beta)
it_rank <- ls_ranks$it_rank
ar_it_rank <- ls_ranks$ar_it_rank
ar_fl_rank_val <- ls_ranks$ar_fl_rank_val
cat('fl_rho:', fl_rho, 'ar_it_rank:', ar_it_rank, '\n')
}
ar_bin_observed <- c(0,1,0,1,0,0,1,1,0)
ar_queue_optimal <- ar_it_rank
ffp_opt_sobin_rev(ar_queue_optimal, ar_bin_observed, ar_A, ar_alpha, ar_beta, fl_rho)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.