The GrowthFit
class contains a growth model fitted to data under
static or dynamic conditions. Its constructor is fit_growth()
.
It is a subclass of list with the items:
environment: type of environment as in fit_growth()
algorithm: type of algorithm as in fit_growth()
data: data used for model fitting
start: initial guess of the model parameters
known: fixed model parameters
primary_model: a character describing the primary model
fit_results: an instance of modFit or modMCMC with the results of the fit
best_prediction: Instance of GrowthPrediction with the best growth fit
sec_models: a named vector with the secondary models assigned for each
environmental factor. NULL
for environment="constant"
env_conditions: a tibble with the environmental conditions used for model
fitting. NULL
for environment="constant"
niter: number of iterations of the Markov chain. NULL
if algorithm != "MCMC"
logbase_mu: base of the logarithm for the definition of parameter mu (check the relevant vignette)
logbase_logN: base of the logarithm for the definition of the population size (check the relevant vignette)
# S3 method for GrowthFit
print(x, ...)# S3 method for GrowthFit
coef(object, ...)
# S3 method for GrowthFit
summary(object, ...)
# S3 method for GrowthFit
predict(object, times = NULL, env_conditions = NULL, ...)
# S3 method for GrowthFit
residuals(object, ...)
# S3 method for GrowthFit
vcov(object, ...)
# S3 method for GrowthFit
deviance(object, ...)
# S3 method for GrowthFit
fitted(object, ...)
# S3 method for GrowthFit
logLik(object, ...)
# S3 method for GrowthFit
AIC(object, ..., k = 2)
# S3 method for GrowthFit
plot(
x,
y = NULL,
...,
add_factor = NULL,
line_col = "black",
line_size = 1,
line_type = 1,
point_col = "black",
point_size = 3,
point_shape = 16,
ylims = NULL,
label_y1 = NULL,
label_y2 = add_factor,
label_x = "time",
line_col2 = "black",
line_size2 = 1,
line_type2 = "dashed"
)
# S3 method for GrowthFit
predictMCMC(
model,
times,
env_conditions,
niter,
newpars = NULL,
formula = . ~ time
)
An instance of MCMCgrowth.
The object of class GrowthFit to plot.
ignored.
an instance of GrowthFit
Numeric vector of storage times for the predictions.
Tibble with the (dynamic) environmental conditions during the experiment. It must have one column named 'time' with the storage time and as many columns as required with the environmental conditions.
penalty for the parameters (k=2 by default)
ignored
whether to plot also one environmental factor.
If NULL
(default), no environmental factor is plotted. If set
to one character string that matches one entry of x$env_conditions,
that condition is plotted in the secondary axis. Ignored if environment="constant"
Aesthetic parameter to change the colour of the line geom in the plot, see: ggplot2::geom_line()
Aesthetic parameter to change the thickness of the line geom in the plot, see: ggplot2::geom_line()
Aesthetic parameter to change the type of the line geom in the plot, takes numbers (1-6) or strings ("solid") see: ggplot2::geom_line()
Aesthetic parameter to change the colour of the point geom, see: ggplot2::geom_point()
Aesthetic parameter to change the size of the point geom, see: ggplot2::geom_point()
Aesthetic parameter to change the shape of the point geom, see: ggplot2::geom_point()
A two dimensional vector with the limits of the primary y-axis.
NULL
by default
Label of the primary y-axis.
Label of the secondary y-axis. Ignored if environment="constant"
Label of the x-axis
Same as lin_col, but for the environmental factor. Ignored if environment="constant"
Same as line_size, but for the environmental factor. Ignored if environment="constant"
Same as lin_type, but for the environmental factor. Ignored if environment="constant"
An instance of GrowthFit
Number of iterations.
A named list defining new values for the some model parameters.
The name must be the identifier of a model already included in the model.
These parameters do not include variation, so defining a new value for a fitted
parameters "fixes" it. NULL
by default (no new parameters).
A formula stating the column named defining the elapsed time in
env_conditions
. By default, . ~ time.
print(GrowthFit)
: print of the model
coef(GrowthFit)
: vector of fitted model parameters.
summary(GrowthFit)
: statistical summary of the fit.
predict(GrowthFit)
: vector of model predictions.
residuals(GrowthFit)
: vector of model residuals.
vcov(GrowthFit)
: variance-covariance matrix of the model, estimated
as 1/(0.5*Hessian) for regression and as the variance-covariance of the draws
for MCMC
deviance(GrowthFit)
: deviance of the model.
fitted(GrowthFit)
: vector of fitted values.
logLik(GrowthFit)
: loglikelihood of the model
AIC(GrowthFit)
: Akaike Information Criterion
plot(GrowthFit)
: compares the fitted model against the data.
predictMCMC(GrowthFit)
: prediction including parameter uncertainty