get_params: Extract the metabolism parameters (fitted and/or fixed) from...

View source: R/metab_model_interface.R

get_paramsR Documentation

Extract the metabolism parameters (fitted and/or fixed) from a model.

Description

A function in the metab_model_interface. Returns estimates of those parameters describing the rates and/or shapes of GPP, ER, or reaeration.

Usage

get_params(
  metab_model,
  date_start = NA,
  date_end = NA,
  uncertainty = c("sd", "ci", "none"),
  messages = TRUE,
  fixed = c("none", "columns", "stars"),
  ...,
  attach.units = deprecated()
)

## S3 method for class 'metab_Kmodel'
get_params(
  metab_model,
  date_start = NA,
  date_end = NA,
  uncertainty = c("sd", "ci", "none"),
  messages = TRUE,
  fixed = c("none", "columns", "stars"),
  ...,
  attach.units = deprecated(),
  use_saved = TRUE
)

## S3 method for class 'metab_bayes'
get_params(
  metab_model,
  date_start = NA,
  date_end = NA,
  uncertainty = "ci",
  messages = TRUE,
  ...,
  attach.units = deprecated()
)

## S3 method for class 'metab_model'
get_params(
  metab_model,
  date_start = NA,
  date_end = NA,
  uncertainty = c("sd", "ci", "none"),
  messages = TRUE,
  fixed = c("none", "columns", "stars"),
  ...,
  attach.units = deprecated()
)

## S3 method for class 'metab_sim'
get_params(
  metab_model,
  date_start = NA,
  date_end = NA,
  uncertainty = c("sd", "ci", "none"),
  messages = TRUE,
  fixed = c("none", "columns", "stars"),
  ...,
  attach.units = deprecated()
)

Arguments

metab_model

A metabolism model, implementing the metab_model_interface, to use in predicting metabolism

date_start

Date or a class convertible with as.Date. The first date (inclusive) for which to report parameters. If NA, no filtering is done.

date_end

Date or a class convertible with as.Date. The last date (inclusive) for which to report parameters.. If NA, no filtering is done.

uncertainty

character. Should columns for the uncertainty of parameter estimates be excluded ('none'), reported as standard deviations ('sd'), or reported as lower and upper bounds of a 95 percent confidence interval ('ci')? When available (e.g., for Bayesian models), if 'ci' then the central value will be the median (50th quantile) and the ranges will be the 2.5th and 97.5th quantiles. If 'sd' then the central value will always be the mean.

messages

logical. Should warning and error messages from the fitting procedure be included in the output?

fixed

character. Should values pulled from data_daily (i.e., fixed rather that fitted) be treated identically ('none'), paired with a logicals column ending in '.fixed' ('columns'), converted to character and marked with a leading asterisk ('stars')?

...

Other arguments passed to class-specific implementations of get_params

attach.units

(deprecated, effectively FALSE in future) logical. Should units be attached to the output?

use_saved

logical. Is it OK to use predictions that were saved with the model?

Value

A data.frame of the parameters needed to predict GPP, ER, D, and DO, one row per date

Methods (by class)

  • metab_Kmodel: Make daily re-predictions of K600.daily based on the across-days model of K600.daily versus predictors. Only returns estimates for K600.daily, not any of the other daily parameters

  • metab_bayes: Does a little formatting to convert from Stan output to streamMetabolizer parameter names; otherwise the same as get_params.metab_model

  • metab_model: This implementation is shared by many model types

  • metab_sim: Generates new simulated values for daily parameters if they were described with evaluatable expressions in specs, or returns the fixed values for daily parameters if they were set in data_daily

See Also

predict_metab for daily average rates of GPP and ER

Other metab_model_interface: get_data_daily(), get_data(), get_fitting_time(), get_fit(), get_info(), get_param_names(), get_specs(), get_version(), predict_DO(), predict_metab()

Examples

dat <- data_metab('3', day_start=12, day_end=36)
mm <- metab_night(specs(mm_name('night')), data=dat)
get_params(mm)
get_params(mm, date_start=get_fit(mm)$date[2])

USGS-R/streamMetabolizer documentation built on Aug. 15, 2023, 7:50 a.m.