estimate_params: Estimate the parameters for a given data set and model

Description Usage Arguments Value Examples

View source: R/estimate.R

Description

Estimate the parameters for a given data set and model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
estimate_params(
  data,
  init_params = c(beta_A = 0.25, beta_B = 0.25, gamma_A = 0.5, gamma_B = 0.5, tau_1 = 0,
    tau_2 = 0),
  n_boot = 100,
  GIA_fn = base_GIA,
  S_fn = calc_S_base,
  fn_list = NULL,
  alpha = 0.05,
  verbose = FALSE
)

Arguments

data

data frame with the following columns

  • dose_Adose A mg/mL

  • dose_Bdose B mg/mL

  • GIAGIA

init_params

named vector of parameters, that correspond to those used in 'GIA_fn'. These will be used as the initial guesses. A default is provided.

n_boot

number of boot straps to use to estimate confidence intervals of the parameters, GIA estimates, and values of S. The default is 100. If n_boot = 0, then no bootstraps will be run and only the point estimates will be returned.

GIA_fn

function to calculate the GIA from dose_A and dose_B combinations and given set of parameters. Default is base_GIA

S_fn

Function to calculate S. Default is calc_S_base

fn_list

additional arguments to pass to GIA_fn

alpha

alpha level used to produce CIs. The bootstrap will use a two-tailed method. The default is .05 to produce a 95% CI

verbose

logical indicating whether we should print where we are in the process. Default is FALSE.

Value

a list with the following elements

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
df <- loewesadditivity::cyrpa_ripr
df$dose_A <- df$CyRPA
df$dose_B <- df$RIPR
data <- fortify_gia_data(df)
model_params <- c("beta_A" = .5, "beta_B" = .5,
                 "gamma_A" = .5, "gamma_B" = .5,
                 "tau_1" = 0, "tau_2" = 0)
n_boot <- 10
GIA_fn <- base_GIA
S_fn <- calc_S_base
fn_list <- NULL
alpha <- .05
verbose <- FALSE
out <- estimate_params(data = data,
init_params = model_params,
n_boot = n_boot,
GIA_fn = GIA_fn,
S_fn = S_fn,
fn_list = fn_list,
alpha = alpha,
verbose = verbose)
names(out)

loewesadditivity documentation built on March 26, 2020, 8:14 p.m.