## Warning: package 'dplyr' was built under R version 3.6.2
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## New names:
## * `Tumor1*` -> `Tumor1*...5`
## * `Tumor1*` -> `Tumor1*...6`
## * `Tumor1*` -> `Tumor1*...7`
## * `Tumor1*` -> `Tumor1*...8`
## * `Tumor2*` -> `Tumor2*...9`
## * ...
## New names:
## * `` -> ...1
## * `` -> ...2
## * `` -> ...3
## * `` -> ...4
## * `` -> ...5

## [1] 0.09632952

\[A_t = A \times exp(-k_1t) - A \times exp(-k_2t) +\epsilon\]

\[k_{1i} = exp(\beta_1 + b_{1i}) \]

\[k_{2i} = exp(\beta_2 + b_{2i}) \]

\[b_{1i} \sim N(0,\sigma_1^2)\]

\[b_{2i} \sim N(0,\sigma_2^2)\] \[\epsilon \sim N(0,\sigma_0^2)\]

\[\sigma_1^2 = 0.0716, \sigma_2^2 = 0.2357, \sigma_2^2 = 10, \beta_1 = -4.840, \beta_2 = -0.715\]

volumn = exp( rnorm(n,3.25,1.46) )

gamma = | t-distribution(df = 5) * 2 | + 0.2

A0 = volumn * gamma

t1: 4 + normal(mean = 0, sd = 3)

t2: (24,36,48) + normal(mean = 0, sd = 3)

t3: (84,96,108) + normal(mean = 0, sd = 3)

t4: (144,156,168) + normal(mean = 0, sd = 3)

leave one out prediction

\[Model \ 1: AUC \sim A_t \times t + A_t \times t^2\]

\[Model \ 2: \frac{AUC}{volumn} \sim \frac{A_t}{volumn} \times t + \frac{A_t}{volumn} \times t^2\]

\[Model\ 3 (monoexponential + LSE) find \ T: \frac{AUC}{v} \sim \frac{A_t}{v} \times \frac{2^{\frac{t}{T}}T}{log(2)} \] \[Model\ 30 (monoexponential + LSE) find \ T: argmin \sum_{i=1}^n (AUC - A_t \times \frac{2^{\frac{t}{T}}T}{log(2)})^2/\sqrt{AUC+100} \]

\[Model\ 4 (monoexponential + LSE + scale) find \ T,\gamma: \frac{AUC}{v} \sim \gamma \times\frac{A_t}{v} \times \frac{2^{\frac{t}{T}}T}{log(2)} \]

\[Model\ 40 (monoexponential + LSE+ scale) find \ T,\gamma: argmin \sum_{i=1}^n (AUC - \gamma \times A_t \times \frac{2^{\frac{t}{T}}T}{log(2)})^2/\sqrt{AUC+100} \]

\[Model\ 5 (biexponential + LSE) find \ k_1,k_2: \frac{AUC}{v} \sim \frac{A_t}{v} \times (\frac{ \frac{1}{k_1} - \frac{1}{k_2} }{exp(-k_1t) - exp(-k_2t) }) \]

\[Model\ 5 (biexponential + LSE) find \ k_1,k_2: \sum_{i=1}^n [AUC - \gamma \times A_t \times (\frac{ \frac{1}{k_1} - \frac{1}{k_2} }{exp(-k_1t) - exp(-k_2t) })]^2/\sqrt{AUC+100} \]

Model 2,3,4,5’s outcomes are AUC / volumn. But one question is when volumn is small, the 1/volumn will be extremely big and give that sample a big weight.

Model 30, 40,50 assume that tumor with bigger AUC have bigger variance (variance \(\propto\) AUC, rather than \(AUC^2\)), thus put less weight on tumor with bigger AUC.

## [1] 3.255399
## [1] 1.464226

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.2162  1.0677  1.6406  2.1353  2.7088 11.0043
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.2117  0.8316  1.5873  2.0451  2.7676 15.3467

calculate the A estimation based on least square estimation; get the “golden value” of AUC

\[ A_i = argmin \ Loss_i= argmin \ \sum_{j=1}^4 (A_{t_{ij}} - pred(t_{ij}))^2\]

\[AUC_i = A_i \times (\frac{1}{k_1} - \frac{1}{k_2})\]

## Least square estimation