Skip to contents

Propagates p-value uncertainty to consumption predictions using the delta method. Computes numerical derivatives and applies first-order approximation for uncertainty propagation. Suitable when the relationship between p and consumption is approximately linear.

Usage

predict_consumption_delta(
  p_est,
  p_se,
  bio_obj,
  delta_size = 0.001,
  first_day = 1,
  last_day = 365,
  verbose = FALSE
)

Arguments

p_est

Estimated p-value (feeding level parameter)

p_se

Standard error of p-value estimate

bio_obj

Bioenergetic object with simulation settings and environmental data

delta_size

Small increment for numerical derivative computation, default 0.001

first_day

First simulation day, default 1

last_day

Last simulation day, default 365

verbose

Show progress messages, default FALSE

Details

The delta method uses first-order Taylor series approximation: Var(f(X)) ≈ [f'(μ)]² × Var(X)

The linearity check verifies that the derivative times delta_size is small relative to the consumption estimate, indicating local linearity.

Examples

if (FALSE) { # \dontrun{
# Propagate uncertainty from MLE estimate
mle_result <- run_fb4(bio_obj, strategy = "mle", observed_weights = weights)
p_est <- mle_result$summary$p_estimate
p_se <- mle_result$method_data$confidence_intervals$p_se

uncertainty_result <- predict_consumption_delta(
  p_est = p_est,
  p_se = p_se,
  bio_obj = bio_obj      
)
} # }