R/get_fun_idx_offset.R

Defines functions get_fun_idx_offset

get_fun_idx_offset <- function( prob_payoff_funs, fun_args, eval_funs, sim_args, n_sims){
    idx_offset <- lapply(prob_payoff_funs, function(x) {
        if ( any(sim_args %in% fun_args[[x]])){
            return(length(eval_funs[[x]])/n_sims)
        } else {
            return(0)
        }
    })
    names(idx_offset) <- prob_payoff_funs
    return(idx_offset)
}

Try the twig package in your browser

Any scripts or data that you put into this service are public.

twig documentation built on April 12, 2025, 2:08 a.m.