R/compute_sim_offset.R

Defines functions compute_sim_offset

compute_sim_offset <- function(n_sims, prob_payoff_funs, sim_offset0) {

    sim_offset <- matrix(NA, nrow = n_sims, ncol = length(prob_payoff_funs), dimnames = list(NULL, prob_payoff_funs))
    for (fun in prob_payoff_funs){
        sims <- 1:n_sims
        sim_offset[, fun] <- (sims - 1) * sim_offset0[[fun]]
    }
    return(sim_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.