Learn R Programming

biogrowth (version 1.0.8)

make_guess_coupled: Initial guesses for fitting the Baranyi-Ratkowsky model

Description

[Experimental]

The function uses some heuristics to provide initial guesses for the parameters of the Baranyi-Ratkowsky model selected that can be used with fit_coupled_growth().

Usage

make_guess_coupled(fit_data, mode = "two_steps")

Value

A named numeric vector of initial guesses for the model parameters

Arguments

fit_data

Tibble (or data.frame) of data for the fit. The shape of the data will depend on the fitting mode (see fit_coupled_growth())

mode

the type of model fitting approach. Either two_steps (fitted from the values of mu and lambda) or one_step (fitted from logN)

Examples

Run this code
## Example 1: Two-steps fitting-------------------------------------------------

data(example_coupled_twosteps)

guess <- make_guess_coupled(example_coupled_twosteps)


show_guess_coupled(example_coupled_twosteps, guess)

my_fit <- fit_coupled_growth(example_coupled_twosteps, 
                             start = guess,
                             mode = "two_steps")

print(my_fit)
coef(my_fit)
summary(my_fit)
plot(my_fit)

## Example 2: One-step fitting--------------------------------------------------

data("example_coupled_onestep")

guess <- make_guess_coupled(example_coupled_onestep, mode = "one_step")

show_guess_coupled(example_coupled_onestep,
                   guess,
                   "one_step")

my_fit <- fit_coupled_growth(example_coupled_onestep,
                             start = guess,
                             mode = "one_step")

print(my_fit)
coef(my_fit)
summary(my_fit)
plot(my_fit)

 

Run the code above in your browser using DataLab