library(ggplot2)
library(dplyr)

Let's start with a concave function describing some relationship to CO2. It's sensitivity (local derivative) is referred to as $\beta$. Motivated by the functional form of enzyme kinetics in the FvCB model, the functional form can be described by a Michaelis-Menton curve

$$ y = a \frac{x}{x+b} $$

myfunc <- function(x, a=1, b=30){
  # out <- a * x / (x + b)
  out <- a * log(x)
  return(out)
}
ggplot(data = tibble(x = 0), aes(x = x)) +
  stat_function(fun = myfunc) + 
  xlim(0,100) +
  geom_vline(xintercept = 10, col = "red")

The slope $\beta = \partial y / \partial x$ and it obviously decreases towards higher values of $x$. If $\beta$ is calculated as the linear approximation given by $\Delta x / \Delta y$, then its value depends on the basis over which it's qunatified: $$ \beta \simeq \frac{\Delta y}{\Delta x} = \frac{y_1 - y_0}{x_1 - x_0} $$ Let $x_0$ and $y_0$ be zero and vary $x_1$ (and consequently $y_1$) from zero to 100. The correspondingly approximated $\beta$ is:

beta_approx <- function(x1, x0 = 10){
  out <- (myfunc(x1) - myfunc(x0))/(x1 - x0)
  return(out)
}
ggplot(data = tibble(x = 0), aes(x = x)) +
  stat_function(fun = beta_approx) + 
  xlim(10,100)

Can this (unwanted) decrease in $\beta$ be mitigated by taking $\beta_\text{log}$? It's defined as: $$ \beta_\text{log} = \frac{y_1/y_0 - 1}{\log(x_1/x_0)} $$

beta_log_approx <- function(x1, x0 = 10){
  out <- (myfunc(x1)/myfunc(x0) - 1)/log(x1/x0)
  return(out)
}
ggplot(data = tibble(x = 0), aes(x = x)) +
  stat_function(fun = beta_log_approx) + 
  xlim(10,100)

Quite a bit, yes.



stineb/rbeni documentation built on Feb. 24, 2023, 5:40 a.m.