From 0b98c459c30a0629a728acf6b311de035c55fb64 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 18 Jul 2018 15:18:30 +0200 Subject: Correct references to the Rocke and Lorenzato model Rename 'sigma_rl' to 'sigma_twocomp' as the Rocke and Lorenzato model assumes lognormal distribution for large y. Rebuild static documentation. --- vignettes/FOCUS_D.html | 104 ++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 54 deletions(-) (limited to 'vignettes/FOCUS_D.html') diff --git a/vignettes/FOCUS_D.html b/vignettes/FOCUS_D.html index 84e3748c..bfbe2f7e 100644 --- a/vignettes/FOCUS_D.html +++ b/vignettes/FOCUS_D.html @@ -12,7 +12,7 @@ - + Example evaluation of FOCUS Example Dataset D @@ -70,13 +70,13 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf

Example evaluation of FOCUS Example Dataset D

Johannes Ranke

-

2018-01-14

+

2018-07-17

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", quietly = TRUE)
-print(FOCUS_2006_D)
+print(FOCUS_2006_D)
##      name time  value
 ## 1  parent    0  99.46
 ## 2  parent    0 102.04
@@ -126,13 +126,13 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
 

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 a C compiler (gcc) 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"))
## Successfully compiled differential equation model from auto-generated C code.
-
print(SFO_SFO$diffs)
+
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"

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

-
fit <- mkinfit(SFO_SFO, FOCUS_2006_D, 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_sep method for mkinfit objects, which shows separate graphs for all compounds and their residuals.

plot_sep(fit, lpos = c("topright", "bottomright"))

@@ -141,10 +141,10 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf

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

summary(fit)
-
## mkin version:    0.9.47.1 
-## R version:       3.4.3 
-## Date of fit:     Sun Jan 14 17:50:03 2018 
-## Date of summary: Sun Jan 14 17:50:03 2018 
+
## mkin version used for fitting:    0.9.47.1 
+## R version used for fitting:       3.5.1 
+## Date of fit:     Tue Jul 17 15:54:19 2018 
+## Date of summary: Tue Jul 17 15:54:19 2018 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
@@ -152,7 +152,7 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
 ## 
 ## Model predictions using solution type deSolve 
 ## 
-## Fitted with method Port using 153 model solutions performed in 1.072 s
+## Fitted with method Port using 153 model solutions performed in 0.658 s
 ## 
 ## Weighting: none
 ## 
@@ -219,50 +219,46 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
 ## 
 ## Data:
 ##  time variable observed predicted   residual
-##     0   parent    99.46 9.960e+01 -1.385e-01
-##     0   parent   102.04 9.960e+01  2.442e+00
-##     1   parent    93.50 9.024e+01  3.262e+00
-##     1   parent    92.50 9.024e+01  2.262e+00
-##     3   parent    63.23 7.407e+01 -1.084e+01
-##     3   parent    68.99 7.407e+01 -5.083e+00
-##     7   parent    52.32 4.991e+01  2.408e+00
-##     7   parent    55.13 4.991e+01  5.218e+00
-##    14   parent    27.27 2.501e+01  2.257e+00
-##    14   parent    26.64 2.501e+01  1.627e+00
-##    21   parent    11.50 1.253e+01 -1.035e+00
-##    21   parent    11.64 1.253e+01 -8.946e-01
-##    35   parent     2.85 3.148e+00 -2.979e-01
-##    35   parent     2.91 3.148e+00 -2.379e-01
-##    50   parent     0.69 7.162e-01 -2.624e-02
-##    50   parent     0.63 7.162e-01 -8.624e-02
-##    75   parent     0.05 6.074e-02 -1.074e-02
-##    75   parent     0.06 6.074e-02 -7.382e-04
-##   100   parent       NA 5.151e-03         NA
-##   100   parent       NA 5.151e-03         NA
-##   120   parent       NA 7.155e-04         NA
-##   120   parent       NA 7.155e-04         NA
-##     0       m1     0.00 0.000e+00  0.000e+00
-##     0       m1     0.00 0.000e+00  0.000e+00
-##     1       m1     4.84 4.803e+00  3.704e-02
-##     1       m1     5.64 4.803e+00  8.370e-01
-##     3       m1    12.91 1.302e+01 -1.140e-01
-##     3       m1    12.96 1.302e+01 -6.400e-02
-##     7       m1    22.97 2.504e+01 -2.075e+00
-##     7       m1    24.47 2.504e+01 -5.748e-01
-##    14       m1    41.69 3.669e+01  5.000e+00
-##    14       m1    33.21 3.669e+01 -3.480e+00
-##    21       m1    44.37 4.165e+01  2.717e+00
-##    21       m1    46.44 4.165e+01  4.787e+00
-##    35       m1    41.22 4.331e+01 -2.093e+00
-##    35       m1    37.95 4.331e+01 -5.363e+00
-##    50       m1    41.19 4.122e+01 -2.831e-02
-##    50       m1    40.01 4.122e+01 -1.208e+00
-##    75       m1    40.09 3.645e+01  3.643e+00
-##    75       m1    33.85 3.645e+01 -2.597e+00
-##   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
+## 0 parent 99.46 99.59848 -1.385e-01 +## 0 parent 102.04 99.59848 2.442e+00 +## 1 parent 93.50 90.23787 3.262e+00 +## 1 parent 92.50 90.23787 2.262e+00 +## 3 parent 63.23 74.07320 -1.084e+01 +## 3 parent 68.99 74.07320 -5.083e+00 +## 7 parent 52.32 49.91207 2.408e+00 +## 7 parent 55.13 49.91207 5.218e+00 +## 14 parent 27.27 25.01257 2.257e+00 +## 14 parent 26.64 25.01257 1.627e+00 +## 21 parent 11.50 12.53462 -1.035e+00 +## 21 parent 11.64 12.53462 -8.946e-01 +## 35 parent 2.85 3.14787 -2.979e-01 +## 35 parent 2.91 3.14787 -2.379e-01 +## 50 parent 0.69 0.71624 -2.624e-02 +## 50 parent 0.63 0.71624 -8.624e-02 +## 75 parent 0.05 0.06074 -1.074e-02 +## 75 parent 0.06 0.06074 -7.382e-04 +## 0 m1 0.00 0.00000 0.000e+00 +## 0 m1 0.00 0.00000 0.000e+00 +## 1 m1 4.84 4.80296 3.704e-02 +## 1 m1 5.64 4.80296 8.370e-01 +## 3 m1 12.91 13.02400 -1.140e-01 +## 3 m1 12.96 13.02400 -6.400e-02 +## 7 m1 22.97 25.04476 -2.075e+00 +## 7 m1 24.47 25.04476 -5.748e-01 +## 14 m1 41.69 36.69002 5.000e+00 +## 14 m1 33.21 36.69002 -3.480e+00 +## 21 m1 44.37 41.65310 2.717e+00 +## 21 m1 46.44 41.65310 4.787e+00 +## 35 m1 41.22 43.31312 -2.093e+00 +## 35 m1 37.95 43.31312 -5.363e+00 +## 50 m1 41.19 41.21831 -2.831e-02 +## 50 m1 40.01 41.21831 -1.208e+00 +## 75 m1 40.09 36.44704 3.643e+00 +## 75 m1 33.85 36.44704 -2.597e+00 +## 100 m1 31.04 31.98163 -9.416e-01 +## 100 m1 33.13 31.98163 1.148e+00 +## 120 m1 25.15 28.78984 -3.640e+00 +## 120 m1 33.31 28.78984 4.520e+00
-- cgit v1.2.1