Skip to contents

fit_dynamic_inactivation() estimates selected parameters of a dynamic Weibull-Peleg inactivation model by minimizing the residual sum of squares against observed data.

Usage

fit_dynamic_inactivation(
  data,
  profile,
  time,
  response,
  start,
  estimate = NULL,
  fixed = NULL,
  lower = NULL,
  upper = NULL,
  model = "weibull_peleg",
  secondary = "constant",
  dt = 0.01,
  method = "rk4",
  temperature = "temperature",
  optimizer = "L-BFGS-B",
  control = list(),
  ...
)

Arguments

data

Data frame with observed microbial counts.

profile

A dynamic_profile() object or compatible data frame.

time, response

Column names in data containing observation time and microbial response.

start

Named list of starting parameter values passed to predict_dynamic_growth(). Numeric scalar entries are candidates for estimation.

estimate

Character vector of parameter names to estimate. If NULL, all numeric scalar entries in start except those listed in fixed are estimated.

fixed

Optional named list of parameters to keep fixed during fitting.

lower, upper

Optional named numeric vectors or lists with lower and upper bounds for estimated parameters.

model, secondary, dt, method, temperature

Arguments passed to predict_dynamic_inactivation().

optimizer

Optimization method passed to stats::optim().

control

Optional control list passed to stats::optim().

...

Additional arguments passed to predict_dynamic_growth().

Value

A predmicror_dynamic_fit object.

Examples

profile <- dynamic_profile(time = c(0, 10), temperature = c(60, 60))
obs <- data.frame(time = c(0, 5, 10), logN = c(7, 6, 5))
fit <- fit_dynamic_inactivation(
  obs,
  profile = profile,
  time = "time",
  response = "logN",
  start = list(logN0 = 7, b = 0.15, n = 1),
  estimate = "b",
  dt = 0.25
)
coef(fit)
#> logN0     b     n 
#>   7.0   0.2   1.0