Error_general: A general function for calculating the error in some...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

A general function for calculating the error in some parameter

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
Error_general(
  param,
  param_name,
  R_of_param,
  param_of_R,
  Rmin,
  Rmax,
  delta,
  midpoint,
  error_R,
  temp = 295.15
)

Arguments

param

The parameter over which we are calculating error

param_name

The name of the parameter over which we are calculating error

R_of_param

A function that maps from param –> R NOTE: R_of_param must have arguments in the correct ordrer. They should be:

  • "param"

  • "Rmin"

  • "Rmax"

  • "delta"

  • "midpoint"

  • "temperature, in kelvin"

param_of_R

A function that maps from R –> param NOTE: param_of_R must have arguments in the correct order. They should be: #'

  • "R"

  • "Rmin"

  • "Rmax"

  • "delta"

  • "midpoint"

  • "temperature, in kelvin"

Rmin

the minimum possible ratiometric fluorescence

Rmax

the maximum possible ratiometric fluorescence

delta

the ratiometric fluorescence in the first wavelength

midpoint

the sensor's midpoint (e.g. e0 for redox, pKa for pH, pKd for other ligand)

error_R

a function that, given an R, returns the error in that R

temp

the temperature at which measurements were made

Value

A list with (1) 'E', the given redox potential, (2) 'larger_E', the largest possible E, at the given error (3) 'smaller_E', the smallest possible E, at the given error (4) 'max_error' the largest possible difference between the observed and expected E

Examples

1
2
3
4
Error_general(
  param = -275, param_name = "E", R_of_param = R_of_E, param_of_R = sensorOverlord::E,
  Rmin = 1, Rmax = 5, delta = 0.2, midpoint = -275, error_R = function(x) 0.02 * x
)

julianstanley/SensorOverlord documentation built on Oct. 19, 2020, 2:29 p.m.