Predict dissolved oxygen from a fitted model
Source:R/metab_model_interface.R, R/metab_Kmodel.R, R/metab_model.predict_DO.R, and 2 more
predict_DO.RdA function in the metab_model_interface. Returns predictions of dissolved
oxygen.
Usage
predict_DO(
metab_model,
date_start = NA,
date_end = NA,
...,
attach.units = deprecated(),
use_saved = TRUE
)
# S3 method for class 'metab_Kmodel'
predict_DO(metab_model, date_start = NA, date_end = NA, ..., use_saved = TRUE)
# S3 method for class 'metab_model'
predict_DO(
metab_model,
date_start = NA,
date_end = NA,
...,
attach.units = deprecated(),
use_saved = TRUE
)
# S3 method for class 'metab_night'
predict_DO(metab_model, date_start = NA, date_end = NA, ..., use_saved = TRUE)
# S3 method for class 'metab_sim'
predict_DO(metab_model, date_start = NA, date_end = NA, ...)Arguments
- metab_model
A metabolism model that implements the
metab_model_interface.- date_start
A
Dateor an object coercible withas.Date(). The first date (inclusive) for which to report DO predictions. IfNA, no filtering is done.- date_end
A
Dateor an object coercible withas.Date(). The last date (inclusive) for which to report DO predictions. IfNA, no filtering is done.- ...
Other arguments passed to class-specific implementations of
predict_DO().- attach.units
Deprecated. A logical indicating whether to attach units to the output.
- use_saved
A logical. Is it OK to use predictions that were saved with the model?
Methods (by class)
predict_DO(metab_Kmodel): Throws an error because models of type 'Kmodel' can't predict DO.metab_Kmodelpredicts K at daily timesteps and usually knows nothing about GPP or ER. So it's not possible to predict DO from this model. Try passing the output to metab_mle and THEN predicting DO.predict_DO(metab_model): This implementation is shared by many model typespredict_DO(metab_night): Generate nighttime dissolved oxygen predictions from a nighttime regression model.metab_nightonly fits ER and K, and only for the darkness hours, so predictions are only generated for those hours.predict_DO(metab_sim): Simulate values for DO.obs (with process and observation error), DO.mod (with process error only), and DO.pure (with no error). The errors are randomly generated on every new call to predict_DO.
See also
Other metab_model_interface:
get_data(),
get_data_daily(),
get_fit(),
get_fitting_time(),
get_info(),
get_param_names(),
get_params(),
get_specs(),
get_version(),
predict_metab()
Examples
dat <- data_metab("3", day_start = 12, day_end = 36)
mm <- metab_night(specs(mm_name("night")), data = dat)
preds <- predict_DO(mm, date_start = get_fit(mm)$date[3])
head(preds)
#> # A tibble: 6 × 8
#> date solar.time DO.obs DO.sat depth temp.water light DO.mod
#> <date> <dttm> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 2012-09-20 2012-09-20 17:55:58 8.07 7.77 0.16 9.76 0 8.07
#> 2 2012-09-20 2012-09-20 18:00:58 8.06 7.78 0.16 9.69 0 8.00
#> 3 2012-09-20 2012-09-20 18:05:58 8 7.80 0.16 9.61 0 7.93
#> 4 2012-09-20 2012-09-20 18:10:58 7.94 7.81 0.16 9.54 0 7.88
#> 5 2012-09-20 2012-09-20 18:15:58 7.91 7.83 0.16 9.46 0 7.83
#> 6 2012-09-20 2012-09-20 18:20:58 7.87 7.84 0.16 9.38 0 7.78