estimate_one: Estimate a key value (either transition or starting RFU) for...

View source: R/add_estimates.R

estimate_oneR Documentation

Estimate a key value (either transition or starting RFU) for a single DSF dataset

Description

A helper function used inside of get_estimates to identify estimates for a single type of value. Types of values include: "major" and "minor" transitions, and "initial" normalized RFU values.

Usage

estimate_one(
  values,
  norm_raw_y,
  norm_raw_x,
  transition = "major",
  low_temp_margin = 5,
  high_temp_margin = 5,
  major_peak_min = 0.01,
  major_peak_max = 10,
  minor_peak_max = 0.001,
  loess_span = 0.1,
  ...
)

Arguments

values

numeric vector containing the values from which the estimates for transitions should be drawn. For DSF applications, should be the first derivative of normalized raw RFU data for "major" and "minor" transition estimates, and normalized raw RFU data for "initial" RFU estimates.

norm_raw_y

numeric vector containing normalized raw data, from which estimates for initial RFU values will be drawn. Is provided in the tidy_estimates output regardless of estimate type, to assist with downstream plotting and assessment of estimates.

norm_raw_x

numeric vector containing the x values corresponding to each measurement. For DSF aplications, should be normalized temperature. Is provided in the tidy_estimates output regardless of estimate type, to assist with downstream plotting and assessment of estimates.

transition

the type of transition to estimate–major transition, minor transtion, or initial value. Defaults to "major".

low_temp_margin

a number, setting the ealiest measurement for which a transition estimate can be made. Defaults to 5, which drops all estimated transitions within the first five measurements. Ensures that estimates are not provided for transitions too close to the edge of the measured region to be reasonably extracted using the downstream model fitting.

high_temp_margin

a number, setting the latest measurement for which a transition estimate can be made. Defaults to 5, which drops all estimated transitions within the last five measurements. Ensures that estimates are not provided for transitions too close to the edge of the measured region to be reasonably extracted using the downstream model fitting.

major_peak_min

a number, defining the minimum dRFU value for which any "major" transition will be returned. Reduces the number of transitions returned for insignificantly small local maxima. The appropriateness of the default value is dependent on the input data being normalied 0 to 1. DSF data containing unusually large or small temperature windows, such that the slope of the normalized value vs normalized temperature data is unusual, should also use the default value with caution.

major_peak_max

a number, defining the maximum dRFU value for any "major" transition will be returned. Provides additional protection for sharp peaks resulting from noise, beyond what is provided by the quantmod package. The appropriateness of the default value is dependent on the input data being normalied 0 to 1. DSF data containing unusually large or small temperature windows, such that the slope of the normalized value vs normalized temperature data is unusual, should also use the default value with caution. Extremely small measured Temperature ranges (e.g. << 70 degrees) may benefit from a decreased value. Extremely large measured Temperatures ranges (e.g. >> 70 degrees) may benefit from an increased value. Because estimates and fitting in dsfworld are performed using normalized temperatures by default, the appropriateness of this estimate depends only on the measured temperature range, not the the number of measurements performed per degree. Robustness to varied numbers of measurements per degree is the primary rationale for the default use of normalized temperatures, rather than raw temperatures, for dsfworld fitting.

minor_peak_max

a number, defining the maximum value in the triple derivative from which a minor transition can be returned. The appropriateness of the default value is dependent on the input data being normalied 0 to 1. DSF data containing unusually large or small temperature windows, such that the slope of the normalized value vs normalized temperature data is unusual, should also use the default value with caution.

loess_span

a number, passed to stats::loess(), as in stats::loess(span = loess_span). Loess is used to smooth the input data prior to estimation.

...

additional arguments, passed to tidy_estimates.

Value

Estimates found for a single transition type ("major", "minor", or "initial"), as output by tidy_estimates.

See Also

tidy_estimates


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