screen_mm: Screen Working Variance Models

View source: R/screen.R

screen_mmR Documentation

Screen Working Variance Models

Description

Fit several working variance models to the same Michaelis-Menten curve and order them primarily by quasi-AIC, while also reporting quasi-BIC, RMSE, and weighted residual sums of squares for reference.

Usage

screen_mm(x, y, variance_models = default_variance_models(),
  power_values = NULL, include_auto = FALSE,
  power_selection = c("quasi_aic", "quasi_bic"),
  power_grid = default_power_grid(), interval_level = 0.95,
  allow_zero_substrate = TRUE, km_bounds = NULL, quiet = FALSE,
  variance_functions = NULL)

## S3 method for class 'screen_mm'
print(x, digits = max(3L, getOption("digits") - 2L), ...)

Arguments

x

Numeric vector of substrate concentrations, or a screening object for the print method.

y

Numeric vector of observed reaction velocities.

variance_models

Character vector of built-in variance models to compare. The special value "auto" adds a candidate that compares log(S + 1) with a grid of power functions and keeps the better fit.

power_values

Optional numeric vector of fixed exponents for additional S^power candidates.

include_auto

Logical; if TRUE, add one automatic candidate that selects between log(S + 1) and the supplied power_grid.

power_selection

Criterion used by the automatic candidate: "quasi_aic" or "quasi_bic".

power_grid

Candidate exponents used by the automatic candidate.

interval_level

Confidence level forwarded to fit_mm.

allow_zero_substrate

Logical; if FALSE, substrate concentrations must be strictly positive.

km_bounds

Optional search bounds for K_m.

quiet

Logical; if TRUE, suppress progress messages.

variance_functions

Optional named list of fixed, vectorized positive functions h(S). Names must be unique, non-empty, and distinct from built-in candidate names. Set variance_models = character(0) to compare only these custom candidates.

digits

Number of printed digits.

...

Additional arguments passed to S3 methods.

Details

Custom functions follow the contract in variance_function and are fitted by fit_mm. Their names identify rows in the ranking table and entries in fits. A candidate whose function fails validation is recorded with success = 0 and an error_message; other candidates are still evaluated. Malformed or duplicate candidate names cause an error. Custom functions are added to the outer comparison; they do not change the log/power search performed by include_auto.

All custom shapes are treated as fixed and add no estimated shape parameters. Criteria and intervals do not account for externally estimated function coefficients or for selection uncertainty. Adding more candidates does not guarantee better estimation or interval coverage.

Value

An object of class "screen_mm" with a fitted-model table and the successful fits.

Examples

one_curve <- subset(sdl_demo, enzyme == "1111")
screen <- screen_mm(
  x = one_curve$s_uM,
  y = one_curve$v_uM_per_min,
  power_values = c(0.4, 0.6),
  include_auto = TRUE,
  quiet = TRUE
)

screen$table[, c("model", "selected_model", "quasi_aic", "quasi_bic", "rmse")]

custom_screen <- screen_mm(
  one_curve$s_uM, one_curve$v_uM_per_min,
  variance_models = c("constant", "sqrt"),
  variance_functions = list(
    linear_floor = function(S) 1 + S / 20,
    saturation = function(S) 1 + 9 * S / (20 + S)
  ), quiet = TRUE
)
custom_screen$table[, c("model", "quasi_aic", "success")]

inferMM documentation built on Oct. 30, 2026, 9:06 a.m.