add_model_fits: Add fits and associated apparent melting temperatures for a...

View source: R/add_model_fits.R

add_model_fitsR Documentation

Add fits and associated apparent melting temperatures for a list of models to nested tibbel

Description

A wrapper function for get_model_fits, which performs the entire fitting workflow for a single model to a nested tibble of dsf data, from starting parameter estimation to extraction of tmas for individaul model components.

Usage

add_model_fits(
  by_var,
  which_models,
  dsfworld_models = TRUE,
  model_pars = NULL,
  model_formula = NULL,
  model_lower_bound = NULL,
  ...
)

Arguments

by_var

A nested tibble, as output by tidy_for_tmas. Contains at least two columns; .var, a character column containing unique identifiers for each dataset, by which by_var is nested, and data, a nested tibble containing numeric columns corresponding to normalized temperature, value, and the first derivative of the normalized value. Default names are "Temperature_norm", "value_norm", and "drfu_norm", corresponding to the names output by tidy_for_tmas. However, alternative column names may used by supplying them in the ... argument. These names are passed to get_estimates.

which_models

the names of the models from the set of dsfworld models, to be fit. Model options are: "model_1", "model_2" . . . to "model_6"

dsfworld_models

a boolean. If TRUE, indicates that fits will be performed to the provided dsfworld models. If false, all model information must be provided by the user. I haven't worked through an example of what this would actually look like in the full workflow, so I suspect that this wrapper function wouldn't adapt seamlessly to an external model without at least some minor adaptations.

model_pars

an argument required only if the user wants to provide their own model, rather than using the dsfworld models.

model_formula

an argument required only if the user wants to provide their own model, rather than using the dsfworld models.

model_lower_bound

an argument required only if the user wants to provide their own model, rather than using the dsfworld models.

...

additional arguments, passed to the downstream functions: add_estimates, add_start_pars, add_nls, add_model_stats, add_model_preds, add_model_tmas.

Value

A nested tibble, as described by get_model_fits. Each model gets it's own row.


taiawu/dsfworld_package documentation built on June 18, 2024, 5:39 a.m.