Skip to contents

One Function To Get all possible Survival Curves

In the following the behaviour of the survivals function is demonstrated. We start by getting some model parameters from the example calibration:

calibration <- kwbGompitz::exampleCalibration()

param <- kwbGompitz:::get_survival_parameters(calibration, "Cast Iron")

alphas <- param$alpha

Standard Survival Curves

args <- list(t = 1:5, bz1 = -1, bz0 = 1, marginal = FALSE, set_attributes = FALSE)

Matrix Output

kwb.utils::callWith(kwbGompitz::survivals, args, alpha = alphas)
kwb.utils::callWith(kwbGompitz::survivals, args, alpha = alphas[1:2])
kwb.utils::callWith(kwbGompitz::survivals, args, alpha = alphas[1])

List Output

args_2 <- kwb.utils::arglist(args, matrix = FALSE)

kwb.utils::callWith(kwbGompitz::survivals, args_2, alpha = alphas)
kwb.utils::callWith(kwbGompitz::survivals, args_2, alpha = alphas[1:2])
kwb.utils::callWith(kwbGompitz::survivals, args_2, alpha = alphas[1])

Marginal Survival Curves

args_3 <- kwb.utils::arglist(args, marginal = TRUE, s = 0.1)

kwb.utils::callWith(kwbGompitz::survivals, args_3, alpha = alphas)
kwb.utils::callWith(kwbGompitz::survivals, args_3, alpha = alphas[1:2])
kwb.utils::callWith(kwbGompitz::survivals, args_3, alpha = alphas[1])

args_4 <- kwb.utils::arglist(args_3, t = 10)

kwb.utils::callWith(kwbGompitz::survivals, args_4, alpha = alphas)
kwb.utils::callWith(kwbGompitz::survivals, args_4, alpha = alphas[1:2])
kwb.utils::callWith(kwbGompitz::survivals, args_4, alpha = alphas[1])