simulate_k: Simulate k values based on simulation function

simulate_kR Documentation

Simulate k values based on simulation function

Description

A wrapper function for simulation of k values based on using either mc_* functions to simulate data. Note that all parameters not found in parameters and is relevant for the given method will be randomly generated or fixed. Special method dependent parameters such as xi, mmax and q will be fixed if not given in parameters

Usage

simulate_k(
  m = 100,
  method = "sdwinsp",
  parameters,
  to_dt = TRUE,
  parallel = TRUE
)

Arguments

m

The number of simulated k values for each row of parameters

method

The name of the function of type mc_* that you want to simulate k with. Allowed methods are sdwinsp (default), sdwinsp2, sdwdnsp1, sdwdnsp2, sdwdnsp3, or 1, 2, 3, 4, 5 respectively

parameters

A data table or data frame where each row include a set of parameters. To generate a data table of unique combinations for a set of vectors of parameters it may be used to employ CJ() from the data.table package

to_dt

If TRUE resulting k values are gathered into an data table

parallel

If TRUE, parallel computing will be used for each parameter combination instead of each iterations per parameter combination

Value

A list or data table consisting of simulated k values based on generic parameters such as n, R, etc., and method dependent parameters. If to_dt is TRUE, the parameters found in parameters will be attached to the output data table

Examples

simulate_k(m = 1e3, method = 3, parameters = data.frame(n = c(20,30), R = c(3, 3), p = c(0.05, 0.05), mmax = c(5,5)), to_dt = TRUE)

pernille267/commutability.selectivity documentation built on July 20, 2022, 9:11 a.m.