From 1ef7008be2a72a0847064ad9c2ddcfa16b055482 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 3 May 2019 19:14:15 +0200 Subject: Improve error model fitting Now we have a three stage fitting process for nonconstant error models: - Unweighted least squares - Only optimize the error model - Optimize both Static documentation rebuilt by pkgdown --- docs/articles/web_only/FOCUS_Z.html | 138 ++++++++++++++++++------------------ 1 file changed, 68 insertions(+), 70 deletions(-) (limited to 'docs/articles/web_only/FOCUS_Z.html') diff --git a/docs/articles/web_only/FOCUS_Z.html b/docs/articles/web_only/FOCUS_Z.html index 950e8eab..9e64ae3a 100644 --- a/docs/articles/web_only/FOCUS_Z.html +++ b/docs/articles/web_only/FOCUS_Z.html @@ -88,7 +88,7 @@

Example evaluation of FOCUS dataset Z

Johannes Ranke

-

2019-05-02

+

2019-05-03

@@ -132,11 +132,11 @@

summary(m.Z.2a, data = FALSE)$bpar
##             Estimate se_notrans    t value     Pr(>t)    Lower    Upper
-## Z0_0      9.7015e+01   3.394776 2.8578e+01 6.5093e-21 91.66556 102.3642
-## k_Z0_sink 4.0301e-10   0.225510 1.7871e-09 5.0000e-01  0.00000      Inf
-## k_Z0_Z1   2.2360e+00   0.159161 1.4049e+01 1.1412e-13  1.95303   2.5600
-## k_Z1_sink 4.8212e-01   0.065499 7.3608e+00 5.1791e-08  0.40341   0.5762
-## sigma     4.8041e+00   0.637657 7.5340e+00 3.4468e-08  3.52677   6.0815
+## Z0_0 9.7015e+01 3.393176 2.8591e+01 6.4352e-21 91.66556 102.3642 +## k_Z0_sink 7.2231e-10 0.225254 3.2067e-09 5.0000e-01 0.00000 Inf +## k_Z0_Z1 2.2360e+00 0.159134 1.4051e+01 1.1369e-13 1.95303 2.5600 +## k_Z1_sink 4.8212e-01 0.065454 7.3658e+00 5.1186e-08 0.40341 0.5762 +## sigma 4.8041e+00 0.637618 7.5345e+00 3.4431e-08 3.52677 6.0815

As obvious from the parameter summary (the component of the summary), the kinetic rate constant from parent compound Z to sink is very small and the t-test for this parameter suggests that it is not significantly different from zero. This suggests, in agreement with the analysis in the FOCUS kinetics report, to simplify the model by removing the pathway to sink.

A similar result can be obtained when formation fractions are used in the model formulation:

Z.2a.ff <- mkinmod(Z0 = mkinsub("SFO", "Z1"),
@@ -199,20 +199,18 @@
                      quiet = TRUE)
## Warning in mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin, parms.ini = m.Z.
 ## 5$bparms.ode, : Observations with value of zero were removed from the data
-
## Warning in mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin, parms.ini = m.Z.5$bparms.ode, : Optimisation did not converge:
-## false convergence (8)
-
plot_sep(m.Z.FOCUS)
+
plot_sep(m.Z.FOCUS)

-
summary(m.Z.FOCUS, data = FALSE)$bpar
+
summary(m.Z.FOCUS, data = FALSE)$bpar
##             Estimate se_notrans t value     Pr(>t)     Lower      Upper
-## Z0_0       96.838619   1.994272 48.5584 4.0282e-42 92.826596 100.850642
-## k_Z0        2.215408   0.118459 18.7018 1.0415e-23  1.989468   2.467007
-## k_Z1        0.478300   0.028257 16.9267 6.2407e-22  0.424701   0.538663
-## k_Z2        0.451618   0.042138 10.7177 1.6308e-14  0.374327   0.544869
-## k_Z3        0.058693   0.015246  3.8498 1.7805e-04  0.034804   0.098981
-## f_Z2_to_Z3  0.471508   0.058352  8.0804 9.6647e-11  0.357725   0.588332
+## Z0_0       96.838607   1.994273 48.5584 4.0283e-42 92.826626 100.850589
+## k_Z0        2.215405   0.118459 18.7018 1.0415e-23  1.989465   2.467003
+## k_Z1        0.478300   0.028257 16.9267 6.2408e-22  0.424701   0.538662
+## k_Z2        0.451618   0.042138 10.7177 1.6308e-14  0.374328   0.544867
+## k_Z3        0.058693   0.015246  3.8498 1.7806e-04  0.034805   0.098978
+## f_Z2_to_Z3  0.471508   0.058352  8.0804 9.6648e-11  0.357735   0.588320
 ## sigma       3.984431   0.383402 10.3923 4.5575e-14  3.213126   4.755736
-
endpoints(m.Z.FOCUS)
+
endpoints(m.Z.FOCUS)
## $ff
 ##   Z2_Z3 Z2_sink 
 ## 0.47151 0.52849 
@@ -225,7 +223,7 @@
 ## Z0  0.31288  1.0394
 ## Z1  1.44919  4.8141
 ## Z2  1.53481  5.0985
-## Z3 11.80962 39.2307
+## Z3 11.80965 39.2308

This fit corresponds to the final result chosen in Appendix 7 of the FOCUS report. Confidence intervals returned by mkin are based on internally transformed parameters, however.

@@ -233,17 +231,17 @@ Using the SFORB model

As the FOCUS report states, there is a certain tailing of the time course of metabolite Z3. Also, the time course of the parent compound is not fitted very well using the SFO model, as residues at a certain low level remain.

Therefore, an additional model is offered here, using the single first-order reversible binding (SFORB) model for metabolite Z3. As expected, the \(\chi^2\) error level is lower for metabolite Z3 using this model and the graphical fit for Z3 is improved. However, the covariance matrix is not returned.

-
Z.mkin.1 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
-                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
-                    Z2 = mkinsub("SFO", "Z3"),
-                    Z3 = mkinsub("SFORB"))
+
Z.mkin.1 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
+                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                    Z2 = mkinsub("SFO", "Z3"),
+                    Z3 = mkinsub("SFORB"))
## Successfully compiled differential equation model from auto-generated C code.
-
m.Z.mkin.1 <- mkinfit(Z.mkin.1, FOCUS_2006_Z_mkin, quiet = TRUE)
+
m.Z.mkin.1 <- mkinfit(Z.mkin.1, FOCUS_2006_Z_mkin, quiet = TRUE)
## Warning in mkinfit(Z.mkin.1, FOCUS_2006_Z_mkin, quiet = TRUE): Observations
 ## with value of zero were removed from the data
-
plot_sep(m.Z.mkin.1)
+
plot_sep(m.Z.mkin.1)

-
summary(m.Z.mkin.1, data = FALSE)$cov.unscaled
+
summary(m.Z.mkin.1, data = FALSE)$cov.unscaled
##                            Z0_0 log_k_Z0_Z1 log_k_Z1_Z2 log_k_Z2_sink
 ## Z0_0                 3.8375e+00  5.4918e-03  3.0584e-02    1.2969e-01
 ## log_k_Z0_Z1          5.4918e-03  2.7613e-03 -1.8820e-04    2.6634e-04
@@ -251,9 +249,9 @@
 ## log_k_Z2_sink        1.2969e-01  2.6634e-04  3.2177e-03    3.4256e-02
 ## log_k_Z2_Z3_free    -2.4223e-02 -2.6169e-04 -1.1845e-03   -8.1134e-03
 ## log_k_Z3_free_sink  -6.5467e-02 -4.0815e-04 -3.2978e-03   -3.6010e-02
-## log_k_Z3_free_bound -6.0658e-02 -4.4768e-04 -3.0588e-03   -3.9074e-02
-## log_k_Z3_bound_free  4.7821e+00  5.5819e-03  1.0267e-01    1.1956e+00
-## sigma               -1.4345e-08  8.6519e-11 -6.1861e-10   -4.7499e-10
+## log_k_Z3_free_bound -6.0659e-02 -4.4768e-04 -3.0588e-03   -3.9074e-02
+## log_k_Z3_bound_free  5.2844e-01  4.5458e-03  7.9800e-03    4.6274e-02
+## sigma                2.0366e-10 -3.4658e-10  8.9910e-11   -2.5946e-10
 ##                     log_k_Z2_Z3_free log_k_Z3_free_sink
 ## Z0_0                     -2.4223e-02        -6.5467e-02
 ## log_k_Z0_Z1              -2.6169e-04        -4.0815e-04
@@ -262,84 +260,84 @@
 ## log_k_Z2_Z3_free          1.5500e-02         2.1583e-02
 ## log_k_Z3_free_sink        2.1583e-02         7.5705e-02
 ## log_k_Z3_free_bound       2.5836e-02         1.1964e-01
-## log_k_Z3_bound_free      -2.1303e-01        -9.0584e-01
-## sigma                     5.8776e-10         1.0773e-09
+## log_k_Z3_bound_free       5.2534e-02         2.9441e-01
+## sigma                     1.3063e-10         3.4170e-10
 ##                     log_k_Z3_free_bound log_k_Z3_bound_free       sigma
-## Z0_0                        -6.0658e-02          4.7821e+00 -1.4345e-08
-## log_k_Z0_Z1                 -4.4768e-04          5.5819e-03  8.6519e-11
-## log_k_Z1_Z2                 -3.0588e-03          1.0267e-01 -6.1861e-10
-## log_k_Z2_sink               -3.9074e-02          1.1956e+00 -4.7499e-10
-## log_k_Z2_Z3_free             2.5836e-02         -2.1303e-01  5.8776e-10
-## log_k_Z3_free_sink           1.1964e-01         -9.0584e-01  1.0773e-09
-## log_k_Z3_free_bound          6.5902e-01          4.2011e+00  2.1743e-09
-## log_k_Z3_bound_free          4.2011e+00          3.6036e+08  7.2404e-02
-## sigma                        2.1743e-09          7.2404e-02  1.4170e-01
+## Z0_0 -6.0659e-02 5.2844e-01 2.0366e-10 +## log_k_Z0_Z1 -4.4768e-04 4.5458e-03 -3.4658e-10 +## log_k_Z1_Z2 -3.0588e-03 7.9800e-03 8.9910e-11 +## log_k_Z2_sink -3.9074e-02 4.6274e-02 -2.5946e-10 +## log_k_Z2_Z3_free 2.5836e-02 5.2534e-02 1.3063e-10 +## log_k_Z3_free_sink 1.1964e-01 2.9441e-01 3.4170e-10 +## log_k_Z3_free_bound 6.5902e-01 5.4737e+00 -6.7704e-10 +## log_k_Z3_bound_free 5.4737e+00 2.8722e+08 7.2421e-02 +## sigma -6.7704e-10 7.2421e-02 1.4170e-01

Therefore, a further stepwise model building is performed starting from the stage of parent and two metabolites, starting from the assumption that the model fit for the parent compound can be improved by using the SFORB model.

-
Z.mkin.3 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
-                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
-                    Z2 = mkinsub("SFO"))
+
Z.mkin.3 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
+                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                    Z2 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.
-
m.Z.mkin.3 <- mkinfit(Z.mkin.3, FOCUS_2006_Z_mkin, quiet = TRUE)
+
m.Z.mkin.3 <- mkinfit(Z.mkin.3, FOCUS_2006_Z_mkin, quiet = TRUE)
## Warning in mkinfit(Z.mkin.3, FOCUS_2006_Z_mkin, quiet = TRUE): Observations
 ## with value of zero were removed from the data
-
plot_sep(m.Z.mkin.3)
+
plot_sep(m.Z.mkin.3)

This results in a much better representation of the behaviour of the parent compound Z0.

Finally, Z3 is added as well. These models appear overparameterised (no covariance matrix returned) if the sink for Z1 is left in the models.

-
Z.mkin.4 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
-                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
-                    Z2 = mkinsub("SFO", "Z3"),
-                    Z3 = mkinsub("SFO"))
+
Z.mkin.4 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
+                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                    Z2 = mkinsub("SFO", "Z3"),
+                    Z3 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.
- +
## Warning in mkinfit(Z.mkin.4, FOCUS_2006_Z_mkin, parms.ini = m.Z.mkin.
 ## 3$bparms.ode, : Observations with value of zero were removed from the data
-
plot_sep(m.Z.mkin.4)
+
plot_sep(m.Z.mkin.4)

The error level of the fit, but especially of metabolite Z3, can be improved if the SFORB model is chosen for this metabolite, as this model is capable of representing the tailing of the metabolite decline phase.

-
Z.mkin.5 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
-                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
-                    Z2 = mkinsub("SFO", "Z3"),
-                    Z3 = mkinsub("SFORB"))
+
Z.mkin.5 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
+                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                    Z2 = mkinsub("SFO", "Z3"),
+                    Z3 = mkinsub("SFORB"))
## Successfully compiled differential equation model from auto-generated C code.
- +
## Warning in mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin, parms.ini = m.Z.mkin.
 ## 4$bparms.ode[1:4], : Observations with value of zero were removed from the
 ## data
-
plot_sep(m.Z.mkin.5)
+
plot_sep(m.Z.mkin.5)

The summary view of the backtransformed parameters shows that we get no confidence intervals due to overparameterisation. As the optimized is excessively small, it seems reasonable to fix it to zero.

- +
## Warning in mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin, parms.ini = c(m.Z.mkin.
 ## 5$bparms.ode[1:7], : Observations with value of zero were removed from the
 ## data
-
plot_sep(m.Z.mkin.5a)
+
plot_sep(m.Z.mkin.5a)

As expected, the residual plots for Z0 and Z3 are more random than in the case of the all SFO model for which they were shown above. In conclusion, the model is proposed as the best-fit model for the dataset from Appendix 7 of the FOCUS report.

A graphical representation of the confidence intervals can finally be obtained.

-
mkinparplot(m.Z.mkin.5a)
+
mkinparplot(m.Z.mkin.5a)

The endpoints obtained with this model are

-
endpoints(m.Z.mkin.5a)
+
endpoints(m.Z.mkin.5a)
## $ff
 ##   Z0_free_Z1        Z1_Z2      Z2_sink   Z2_Z3_free Z3_free_sink 
 ##      1.00000      1.00000      0.46344      0.53656      1.00000 
 ## 
 ## $SFORB
 ##     Z0_b1     Z0_b2     Z3_b1     Z3_b2 
-## 2.4471329 0.0075123 0.0800074 0.0000000 
+## 2.4471381 0.0075124 0.0800075 0.0000000 
 ## 
 ## $distimes
 ##      DT50   DT90 DT50_Z0_b1 DT50_Z0_b2 DT50_Z3_b1 DT50_Z3_b2
-## Z0 0.3043 1.1848    0.28325     92.268         NA         NA
+## Z0 0.3043 1.1848    0.28325     92.267         NA         NA
 ## Z1 1.5148 5.0320         NA         NA         NA         NA
 ## Z2 1.6414 5.4526         NA         NA         NA         NA
 ## Z3     NA     NA         NA         NA     8.6635        Inf
-- cgit v1.2.1