Skip to contents

This function updates parameters based on different types of changes.

Usage

update_par(par, par_up, change)

Arguments

par

Numeric vector: Original parameter values.

par_up

Numeric vector: Values indicating the update for each parameter.

change

Character scalar: Type of change to apply. Options are "relchg" for relative change, "pctchg" for percentage change, "abschg" for absolute change, and "absval" for setting the absolute value change.

Value

Numeric vector with updated parameter values.

Examples

par <- c(10, 20, 30, 40)
par_up <- c(0.1, 0.2, NA, 0.3)
update_par(par, par_up, "relchg") # Returns updated parameters with relative change applied.
#> [1] 11 24 30 52