From 6281424beafe531c9891670c3227ab12e9a21990 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 5 Jun 2015 14:24:59 +0200 Subject: FOCUS D vignette generated from Makefile --- vignettes/FOCUS_D.html | 331 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 248 insertions(+), 83 deletions(-) (limited to 'vignettes') diff --git a/vignettes/FOCUS_D.html b/vignettes/FOCUS_D.html index ede2b3a0..6573cc7a 100644 --- a/vignettes/FOCUS_D.html +++ b/vignettes/FOCUS_D.html @@ -1,75 +1,229 @@ + + + - +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
+
+ +
print(FOCUS_2006_D)
+
+
##      name time  value
 ## 1  parent    0  99.46
 ## 2  parent    0 102.04
@@ -114,30 +268,62 @@ 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 ccSolve package 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 ccSolve package 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)
-

+ +
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

+

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

-
mkinparplot(fit)
-

-

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

-
summary(fit)
+ +
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 
 ## R version:       3.2.0 
-## Date of fit:     Fri Jun  5 13:36:25 2015 
-## Date of summary: Fri Jun  5 13:36:25 2015 
+## Date of fit:     Fri Jun  5 14:20:31 2015 
+## Date of summary: Fri Jun  5 14:20:31 2015 
 ## 
 ## Equations:
 ## d_parent = - k_parent_sink * parent - k_parent_m1 * parent
@@ -145,7 +331,7 @@ print(FOCUS_2006_D)
## ## Model predictions using solution type deSolve ## -## Fitted with method Port using 153 model solutions performed in 0.576 s +## Fitted with method Port using 153 model solutions performed in 0.621 s ## ## Weighting: none ## @@ -257,30 +443,9 @@ print(FOCUS_2006_D) ## 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