From 0818986e2d9a0e68d3d1de26ac381836e0cf5a6f Mon Sep 17 00:00:00 2001
From: Johannes Ranke <jranke@uni-bremen.de>
Date: Wed, 18 Sep 2019 12:17:34 +0200
Subject: Add hockey stick formulas to maximum twa vignette

---
 vignettes/twa.Rmd | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

(limited to 'vignettes/twa.Rmd')

diff --git a/vignettes/twa.Rmd b/vignettes/twa.Rmd
index 93b2b372..92a0cd4b 100644
--- a/vignettes/twa.Rmd
+++ b/vignettes/twa.Rmd
@@ -36,6 +36,12 @@ $$c_\textrm{twa} = \frac{c_0}{t} \left(
   \frac{g}{k_1} \left( 1 - e^{- k_1 t} \right) +
   \frac{1-g}{k_2} \left( 1 - e^{- k_2 t} \right)  \right) $$
 
+HS for $t > t_b$:
+
+$$c_\textrm{twa} = \frac{c_0}{t} \left(
+  \frac{1}{k_1} \left( 1 - e^{- k_1 t_b} \right) +
+  \frac{e^{- k_1 t_b}}{k_2} \left( 1 - e^{- k_2 (t - t_b)} \right)  \right) $$
+
 Often, the ratio between the time weighted average concentration $c_\textrm{twa}$
 and the initial concentration $c_0$
 
@@ -60,8 +66,13 @@ $$f_\textrm{twa} = \frac{1}{t} \left(
   \frac{g}{k_1} \left( 1 - e^{- k_1 t} \right) +
   \frac{1-g}{k_2} \left( 1 - e^{- k_2 t} \right)  \right) $$
 
+HS for $t > t_b$:
+
+$$f_\textrm{twa} = \frac{1}{t} \left(
+  \frac{1}{k_1} \left( 1 - e^{- k_1 t_b} \right) +
+  \frac{e^{- k_1 t_b}}{k_2} \left( 1 - e^{- k_2 (t - t_b)} \right)  \right) $$
+
 Note that a method for calculating maximum moving window time weighted average
 concentrations for any model fitted by 'mkinfit', and also for metabolites in
-such models, can be found in the 'pfm' package, which is currently not published on
-CRAN, but available from [github](https://github.com/jranke/pfm) and
-[documented](https://pkgdown.jrwb.de/pfm) at my website.
+such models, is integrated in the 'mkin' package, see the
+[documentation](https://pkgdown.jrwb.de/pfm/reference/max_twa_parent.html) at my website.
-- 
cgit v1.2.1

