From f39815aa87272849f8e0c808099c4cee780c2a81 Mon Sep 17 00:00:00 2001
From: Johannes Ranke A plot of the fit including a residual plot for both observed variables is obtained using the Confidence intervals for the parameter estimates are obtained using the A comprehensive report of the results is obtained using the fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
plot
method for mkinfit
objects.plot(fit, show_residuals = TRUE)
mkinparplot
function.mkinparplot(fit)
summary
method for mkinfit
objects.summary(fit)
## mkin version: 0.9.44.9000
-## R version: 3.3.1
-## Date of fit: Wed Oct 26 23:18:10 2016
-## Date of summary: Wed Oct 26 23:18:10 2016
+## R version: 3.3.2
+## Date of fit: Wed Nov 2 16:25:22 2016
+## Date of summary: Wed Nov 2 16:25:22 2016
##
## Equations:
## d_parent = - k_parent_sink * parent - k_parent_m1 * parent
@@ -122,7 +125,7 @@
##
## Model predictions using solution type deSolve
##
-## Fitted with method Port using 153 model solutions performed in 0.628 s
+## Fitted with method Port using 153 model solutions performed in 0.665 s
##
## Weighting: none
##
@@ -243,7 +246,7 @@
summary(m.L1.FOMC, data = FALSE)
## mkin version: 0.9.44.9000
-## R version: 3.3.1
-## Date of fit: Wed Oct 26 23:18:12 2016
-## Date of summary: Wed Oct 26 23:18:12 2016
+## R version: 3.3.2
+## Date of fit: Thu Nov 3 17:47:49 2016
+## Date of summary: Thu Nov 3 17:47:49 2016
##
##
## Warning: Optimisation by method Port did not converge.
@@ -166,7 +169,7 @@ FOCUS_2006_L1_mkin <-
summary(m.L2.FOMC, data = FALSE)
## mkin version: 0.9.44.9000
-## R version: 3.3.1
-## Date of fit: Wed Oct 26 23:18:12 2016
-## Date of summary: Wed Oct 26 23:18:12 2016
+## R version: 3.3.2
+## Date of fit: Thu Nov 3 17:47:49 2016
+## Date of summary: Thu Nov 3 17:47:49 2016
##
## Equations:
## d_parent = - (alpha/beta) * 1/((time/beta) + 1) * parent
##
## Model predictions using solution type analytical
##
-## Fitted with method Port using 81 model solutions performed in 0.191 s
+## Fitted with method Port using 81 model solutions performed in 0.189 s
##
## Weighting: none
##
@@ -319,9 +322,9 @@ FOCUS_2006_L2_mkin <-
summary(m.L2.DFOP, data = FALSE)
## mkin version: 0.9.44.9000
-## R version: 3.3.1
-## Date of fit: Wed Oct 26 23:18:13 2016
-## Date of summary: Wed Oct 26 23:18:14 2016
+## R version: 3.3.2
+## Date of fit: Thu Nov 3 17:47:50 2016
+## Date of summary: Thu Nov 3 17:47:50 2016
##
## Equations:
## d_parent = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
@@ -330,7 +333,7 @@ FOCUS_2006_L2_mkin <- t = c(0, 3, 7, 14, 30, 60, 91, 120),
parent = c(97.8, 60, 51, 43, 35, 22, 15, 12))
FOCUS_2006_L3_mkin <- mkin_wide_to_long(FOCUS_2006_L3)
-
- Use mmkin to fit multiple models
+
+ Fit multiple models
As of mkin version 0.9-39 (June 2015), we can fit several models to one or more datasets in one call to the function mmkin
. The datasets have to be passed in a list, in this case a named list holding only the L3 dataset prepared above.
# Only use one core here, not to offend the CRAN checks
mm.L3 <- mmkin(c("SFO", "FOMC", "DFOP"), cores = 1,
@@ -402,15 +405,15 @@ mm.L3 <-
The \(\chi^2\) error level of 21% as well as the plot suggest that the SFO model does not fit very well. The FOMC model performs better, with an error level at which the \(\chi^2\) test passes of 7%. Fitting the four parameter DFOP model further reduces the \(\chi^2\) error level considerably.
-
- Accessing elements of mmkin objects
+
+ Accessing mmkin objects
The objects returned by mmkin are arranged like a matrix, with models as a row index and datasets as a column index.
We can extract the summary and plot for e.g. the DFOP fit, using square brackets for indexing which will result in the use of the summary and plot functions working on mkinfit objects.
summary(mm.L3[["DFOP", 1]])
## mkin version: 0.9.44.9000
-## R version: 3.3.1
-## Date of fit: Wed Oct 26 23:18:15 2016
-## Date of summary: Wed Oct 26 23:18:15 2016
+## R version: 3.3.2
+## Date of fit: Thu Nov 3 17:47:51 2016
+## Date of summary: Thu Nov 3 17:47:52 2016
##
## Equations:
## d_parent = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
@@ -419,7 +422,7 @@ mm.L3 <- \(\chi^2\) error level of 3.3% as well as the plot suggest that the SFO model fits very well. The error level at which the \(\chi^2\) test passes is slightly lower for the FOMC model. However, the difference appears negligible.
summary(mm.L4[["SFO", 1]], data = FALSE)
## mkin version: 0.9.44.9000
-## R version: 3.3.1
-## Date of fit: Wed Oct 26 23:18:15 2016
-## Date of summary: Wed Oct 26 23:18:16 2016
+## R version: 3.3.2
+## Date of fit: Thu Nov 3 17:47:52 2016
+## Date of summary: Thu Nov 3 17:47:52 2016
##
## Equations:
## d_parent = - k_parent_sink * parent
##
## Model predictions using solution type analytical
##
-## Fitted with method Port using 46 model solutions performed in 0.108 s
+## Fitted with method Port using 46 model solutions performed in 0.107 s
##
## Weighting: none
##
@@ -568,16 +571,16 @@ mm.L4 <- summary(mm.L4[["FOMC", 1]], data = FALSE)
## mkin version: 0.9.44.9000
-## R version: 3.3.1
-## Date of fit: Wed Oct 26 23:18:16 2016
-## Date of summary: Wed Oct 26 23:18:16 2016
+## R version: 3.3.2
+## Date of fit: Thu Nov 3 17:47:52 2016
+## Date of summary: Thu Nov 3 17:47:52 2016
##
## Equations:
## d_parent = - (alpha/beta) * 1/((time/beta) + 1) * parent
##
## Model predictions using solution type analytical
##
-## Fitted with method Port using 66 model solutions performed in 0.151 s
+## Fitted with method Port using 66 model solutions performed in 0.148 s
##
## Weighting: none
##
@@ -647,8 +650,8 @@ mm.L4 <- FOMC fit for L2
DFOP fit for L2
- Laboratory Data L3
diff --git a/docs/articles/FOCUS_Z.pdf b/docs/articles/FOCUS_Z.pdf
index bc37c873..6f71d018 100644
Binary files a/docs/articles/FOCUS_Z.pdf and b/docs/articles/FOCUS_Z.pdf differ
diff --git a/docs/articles/compiled_models.html b/docs/articles/compiled_models.html
index e02b9cf3..5a04168e 100644
--- a/docs/articles/compiled_models.html
+++ b/docs/articles/compiled_models.html
@@ -16,13 +16,16 @@
@@ -75,21 +78,21 @@ mb.1 <- micr
print(mb.1)
## Unit: milliseconds
## expr min lq mean median uq
-## deSolve, not compiled 6298.7342 6308.6792 6343.9668 6318.6243 6366.5831
-## Eigenvalue based 871.7379 880.7757 903.5267 889.8135 919.4211
-## deSolve, compiled 724.9025 730.6729 732.9837 736.4432 737.0243
+## deSolve, not compiled 6306.4527 6340.7895 6403.5937 6375.1264 6452.1643
+## Eigenvalue based 918.0808 929.7217 948.9742 941.3626 964.4210
+## deSolve, compiled 736.1337 753.6016 773.5605 771.0696 792.2739
## max neval cld
-## 6414.5420 3 c
-## 949.0287 3 b
-## 737.6054 3 a
+## 6529.2022 3 b
+## 987.4793 3 a
+## 813.4783 3 a
autoplot(mb.1)
-We see that using the compiled model is by a factor of 8.6 faster than using the R version with the default ode solver, and it is even faster than the Eigenvalue based solution implemented in R which does not need iterative solution of the ODEs:
+We see that using the compiled model is by a factor of 8.3 faster than using the R version with the default ode solver, and it is even faster than the Eigenvalue based solution implemented in R which does not need iterative solution of the ODEs:
rownames(smb.1) <- smb.1$expr
smb.1["median"]/smb.1["deSolve, compiled", "median"]
## median
-## deSolve, not compiled 8.579920
-## Eigenvalue based 1.208258
+## deSolve, not compiled 8.267900
+## Eigenvalue based 1.220853
## deSolve, compiled 1.000000
@@ -111,20 +114,20 @@ smb.1["median"]/smbprint(mb.2)
## Unit: seconds
## expr min lq mean median uq
-## deSolve, not compiled 13.265212 13.330161 13.412053 13.395109 13.485473
-## deSolve, compiled 1.322466 1.326851 1.364827 1.331236 1.386007
+## deSolve, not compiled 13.604720 13.667244 13.689764 13.729768 13.732286
+## deSolve, compiled 1.305077 1.311124 1.328943 1.317172 1.340876
## max neval cld
-## 13.575837 3 b
-## 1.440779 3 a
+## 13.734804 3 b
+## 1.364579 3 a
smb.2["median"]/smb.2["deSolve, compiled", "median"]
## median
## 1 NA
## 2 NA
autoplot(mb.2)
-Here we get a performance benefit of a factor of 10.1 using the version of the differential equation model compiled from C code!
+Here we get a performance benefit of a factor of 10.4 using the version of the differential equation model compiled from C code!
This vignette was built with mkin 0.9.44.9000 on
-## R version 3.3.1 (2016-06-21)
+## R version 3.3.2 (2016-10-31)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Debian GNU/Linux 8 (jessie)
## CPU model: Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz
@@ -144,7 +147,7 @@ smb.1["median"]/smb