## We first need to fit some models
data("example_cardinal")
sec_model_names <- c(temperature = "Zwietering", pH = "CPM")
known_pars <- list(mu_opt = 1.2, temperature_n = 1,
pH_n = 2, pH_xmax = 6.8, pH_xmin = 5.2)
my_start <- list(temperature_xmin = 5, temperature_xopt = 35,
pH_xopt = 6.5)
fit1 <- fit_secondary_growth(example_cardinal, my_start, known_pars, sec_model_names)
known_pars <- list(mu_opt = 1.2, temperature_n = 2,
pH_n = 2, pH_xmax = 6.8, pH_xmin = 5.2)
fit2 <- fit_secondary_growth(example_cardinal, my_start, known_pars, sec_model_names)
## We can now pass the models to the constructor
comparison <- compare_secondary_fits(list(`n=1` = fit1,
`n=2` = fit2))
## The function includes several S3 methods for model selection and comparison
print(comparison)
plot(comparison)
plot(comparison, type = 2)
## The numerical indexes can be accessed using coef and summary
coef(comparison)
summary(comparison)
Run the code above in your browser using DataLab