From 01d9de6ff165c64ffc4366f2eeb3d2649b5c74c0 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 22 Jun 2015 06:09:00 +0200 Subject: Version bump, correct benchmark in vignette/compiled_models Reorganisation of the vignette generation in the Makefile. Improved YAML header in the R markdown vignettes. Rebuilt vignettes with the package installed. --- vignettes/FOCUS_D.html | 331 +++++++++++++------------------------------------ 1 file changed, 83 insertions(+), 248 deletions(-) (limited to 'vignettes/FOCUS_D.html') diff --git a/vignettes/FOCUS_D.html b/vignettes/FOCUS_D.html index 074847f0..53711e88 100644 --- a/vignettes/FOCUS_D.html +++ b/vignettes/FOCUS_D.html @@ -1,223 +1,79 @@ - - - - -Example evaluation of FOCUS Example Dataset D - + - - + + + - - - - - - +
+ - - - - - -

Example evaluation of FOCUS Example Dataset D

- -

This is just a very simple vignette showing how to fit a degradation model for a parent -compound with one transformation product using mkin. After loading the -library we look a the data. We have observed concentrations in the column named -value at the times specified in column time for the two observed variables -named parent and m1.

- -
library("mkin")
-print(FOCUS_2006_D)
-
+

This is just a very simple vignette showing how to fit a degradation model for a parent compound with one transformation product using mkin. After loading the library we look a the data. We have observed concentrations in the column named value at the times specified in column time for the two observed variables named parent and m1.

+
library("mkin")
+
## Loading required package: minpack.lm
+## Loading required package: rootSolve
+## Loading required package: inline
+
print(FOCUS_2006_D)
##      name time  value
 ## 1  parent    0  99.46
 ## 2  parent    0 102.04
@@ -262,62 +118,30 @@ print(FOCUS_2006_D)
 ## 41     m1  100  31.04
 ## 42     m1  100  33.13
 ## 43     m1  120  25.15
-## 44     m1  120  33.31
-
- -

Next we specify the degradation model: The parent compound degrades with simple first-order -kinetics (SFO) to one metabolite named m1, which also degrades with SFO kinetics.

- -

The call to mkinmod returns a degradation model. The differential equations represented in -R code can be found in the character vector $diffs of the mkinmod object. If -the gcc compiler is installed and functional, the differential equation model -will be compiled from auto-generated C code.

- -
SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"))
-
- -
## Compiling differential equation model from auto-generated C code...
-
- -
print(SFO_SFO$diffs)
-
- +## 44 m1 120 33.31 +

Next we specify the degradation model: The parent compound degrades with simple first-order kinetics (SFO) to one metabolite named m1, which also degrades with SFO kinetics.

+

The call to mkinmod returns a degradation model. The differential equations represented in R code can be found in the character vector $diffs of the mkinmod object. If the gcc compiler is installed and functional, the differential equation model will be compiled from auto-generated C code.

+
SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"))
+
## Compiling differential equation model from auto-generated C code...
+
print(SFO_SFO$diffs)
##                                                       parent 
 ## "d_parent = - k_parent_sink * parent - k_parent_m1 * parent" 
 ##                                                           m1 
-##             "d_m1 = + k_parent_m1 * parent - k_m1_sink * m1"
-
- +## "d_m1 = + k_parent_m1 * parent - k_m1_sink * m1"

We do the fitting without progress report (quiet = TRUE).

- -
fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
-
- -

A plot of the fit including a residual plot for both observed variables is obtained -using the plot method for mkinfit objects.

- -
plot(fit, show_residuals = TRUE)
-
- -

plot of chunk unnamed-chunk-5

- +
fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
+

A plot of the fit including a residual plot for both observed variables is obtained using the plot method for mkinfit objects.

+
plot(fit, show_residuals = TRUE)
+

Confidence intervals for the parameter estimates are obtained using the mkinparplot function.

- -
mkinparplot(fit)
-
- -

plot of chunk unnamed-chunk-6

- -

A comprehensive report of the results is obtained using the summary method for mkinfit -objects.

- -
summary(fit)
-
- -
## mkin version:    0.9.36 
+
mkinparplot(fit)
+

+

A comprehensive report of the results is obtained using the summary method for mkinfit objects.

+
summary(fit)
+
## mkin version:    0.9.37 
 ## R version:       3.2.1 
-## Date of fit:     Sun Jun 21 18:14:52 2015 
-## Date of summary: Sun Jun 21 18:14:52 2015 
+## Date of fit:     Mon Jun 22 18:45:34 2015 
+## Date of summary: Mon Jun 22 18:45:34 2015 
 ## 
 ## Equations:
 ## d_parent = - k_parent_sink * parent - k_parent_m1 * parent
@@ -325,7 +149,7 @@ objects.

## ## Model predictions using solution type deSolve ## -## Fitted with method Port using 153 model solutions performed in 0.733 s +## Fitted with method Port using 153 model solutions performed in 0.609 s ## ## Weighting: none ## @@ -435,9 +259,20 @@ objects.

## 100 m1 31.04 3.198e+01 -9.416e-01 ## 100 m1 33.13 3.198e+01 1.148e+00 ## 120 m1 25.15 2.879e+01 -3.640e+00 -## 120 m1 33.31 2.879e+01 4.520e+00 -
+## 120 m1 33.31 2.879e+01 4.520e+00
- +
+ + + + + -- cgit v1.2.1