From ef7ccf68e086bac3e75858bd4b97e3a2c6872aa1 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 28 Jun 2016 00:44:48 +0200 Subject: Avoid multicore fits in vignettes for passing CRAN checks Also a small fix to the FOCUS Z vignette, and an update of the static documentation generated by staticdocs. --- vignettes/FOCUS_L.html | 66 ++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 32 deletions(-) (limited to 'vignettes/FOCUS_L.html') diff --git a/vignettes/FOCUS_L.html b/vignettes/FOCUS_L.html index e8e31bce..7026e3ce 100644 --- a/vignettes/FOCUS_L.html +++ b/vignettes/FOCUS_L.html @@ -11,7 +11,7 @@ - + Example evaluation of FOCUS Laboratory Data L1 to L3 @@ -214,7 +214,7 @@ div.tocify {

Example evaluation of FOCUS Laboratory Data L1 to L3

Johannes Ranke

-

2016-06-27

+

2016-06-28

@@ -233,17 +233,17 @@ FOCUS_2006_L1_mkin <- mkin_wide_to_long(FOCUS_2006_L1)

Since mkin version 0.9-32 (July 2014), we can use shorthand notation like "SFO" for parent only degradation models. The following two lines fit the model and produce the summary report of the model fit. This covers the numerical analysis given in the FOCUS report.

m.L1.SFO <- mkinfit("SFO", FOCUS_2006_L1_mkin, quiet = TRUE)
 summary(m.L1.SFO)
-
## mkin version:    0.9.42.9000 
+
## mkin version:    0.9.43 
 ## R version:       3.3.1 
-## Date of fit:     Mon Jun 27 18:23:56 2016 
-## Date of summary: Mon Jun 27 18:23:56 2016 
+## Date of fit:     Tue Jun 28 01:22:22 2016 
+## Date of summary: Tue Jun 28 01:22:22 2016 
 ## 
 ## Equations:
 ## d_parent = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 37 model solutions performed in 0.23 s
+## Fitted with method Port using 37 model solutions performed in 0.253 s
 ## 
 ## Weighting: none
 ## 
@@ -326,10 +326,10 @@ summary(m.L1.SFO)
plot(m.L1.FOMC, show_errmin = TRUE, main = "FOCUS L1 - FOMC")

summary(m.L1.FOMC, data = FALSE)
-
## mkin version:    0.9.42.9000 
+
## mkin version:    0.9.43 
 ## R version:       3.3.1 
-## Date of fit:     Mon Jun 27 18:28:02 2016 
-## Date of summary: Mon Jun 27 18:28:02 2016 
+## Date of fit:     Tue Jun 28 01:22:24 2016 
+## Date of summary: Tue Jun 28 01:22:24 2016 
 ## 
 ## 
 ## Warning: Optimisation by method Port did not converge.
@@ -341,7 +341,7 @@ summary(m.L1.SFO)
## ## Model predictions using solution type analytical ## -## Fitted with method Port using 188 model solutions performed in 1.155 s +## Fitted with method Port using 188 model solutions performed in 1.241 s ## ## Weighting: none ## @@ -423,17 +423,17 @@ plot(m.L2.FOMC, show_residuals = TRUE, main = "FOCUS L2 - FOMC")

summary(m.L2.FOMC, data = FALSE)
-
## mkin version:    0.9.42.9000 
+
## mkin version:    0.9.43 
 ## R version:       3.3.1 
-## Date of fit:     Mon Jun 27 18:32:51 2016 
-## Date of summary: Mon Jun 27 18:32:51 2016 
+## Date of fit:     Tue Jun 28 01:22:27 2016 
+## Date of summary: Tue Jun 28 01:22:27 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.505 s
+## Fitted with method Port using 81 model solutions performed in 0.541 s
 ## 
 ## Weighting: none
 ## 
@@ -493,10 +493,10 @@ plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
      main = "FOCUS L2 - DFOP")

summary(m.L2.DFOP, data = FALSE)
-
## mkin version:    0.9.42.9000 
+
## mkin version:    0.9.43 
 ## R version:       3.3.1 
-## Date of fit:     Mon Jun 27 18:32:53 2016 
-## Date of summary: Mon Jun 27 18:32:53 2016 
+## Date of fit:     Tue Jun 28 01:22:30 2016 
+## Date of summary: Tue Jun 28 01:22:30 2016 
 ## 
 ## Equations:
 ## d_parent = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
@@ -505,7 +505,7 @@ plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 336 model solutions performed in 2.147 s
+## Fitted with method Port using 336 model solutions performed in 2.29 s
 ## 
 ## Weighting: none
 ## 
@@ -570,7 +570,8 @@ FOCUS_2006_L3_mkin <- mkin_wide_to_long(FOCUS_2006_L3)

Use mmkin to 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.

-
mm.L3 <- mmkin(c("SFO", "FOMC", "DFOP"), 
+
# Only use one core here, not to offend the CRAN checks
+mm.L3 <- mmkin(c("SFO", "FOMC", "DFOP"), cores = 1,
                list("FOCUS L3" = FOCUS_2006_L3_mkin), quiet = TRUE)
 plot(mm.L3)

@@ -581,10 +582,10 @@ plot(mm.L3)

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.42.9000 
+
## mkin version:    0.9.43 
 ## R version:       3.3.1 
-## Date of fit:     Mon Jun 27 18:15:11 2016 
-## Date of summary: Mon Jun 27 18:35:29 2016 
+## Date of fit:     Tue Jun 28 01:22:33 2016 
+## Date of summary: Tue Jun 28 01:22:33 2016 
 ## 
 ## Equations:
 ## d_parent = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
@@ -593,7 +594,7 @@ plot(mm.L3)
## ## Model predictions using solution type analytical ## -## Fitted with method Port using 137 model solutions performed in 0.898 s +## Fitted with method Port using 137 model solutions performed in 0.959 s ## ## Weighting: none ## @@ -673,24 +674,25 @@ plot(mm.L3)
parent = c(96.6, 96.3, 94.3, 88.8, 74.9, 59.9, 53.5, 49.0)) FOCUS_2006_L4_mkin <- mkin_wide_to_long(FOCUS_2006_L4)

Fits of the SFO and FOMC models, plots and summaries are produced below:

-
mm.L4 <- mmkin(c("SFO", "FOMC"), 
+
# Only use one core here, not to offend the CRAN checks
+mm.L4 <- mmkin(c("SFO", "FOMC"), cores = 1,
                list("FOCUS L4" = FOCUS_2006_L4_mkin), 
                quiet = TRUE)
 plot(mm.L4)

The χ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 χ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.42.9000 
+
## mkin version:    0.9.43 
 ## R version:       3.3.1 
-## Date of fit:     Mon Jun 27 18:21:35 2016 
-## Date of summary: Mon Jun 27 18:21:36 2016 
+## Date of fit:     Tue Jun 28 01:22:34 2016 
+## Date of summary: Tue Jun 28 01:22:35 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.28 s
+## Fitted with method Port using 46 model solutions performed in 0.302 s
 ## 
 ## Weighting: none
 ## 
@@ -740,17 +742,17 @@ plot(mm.L4)
## DT50 DT90 ## parent 106 352
summary(mm.L4[["FOMC", 1]], data = FALSE)
-
## mkin version:    0.9.42.9000 
+
## mkin version:    0.9.43 
 ## R version:       3.3.1 
-## Date of fit:     Mon Jun 27 18:21:35 2016 
-## Date of summary: Mon Jun 27 18:21:36 2016 
+## Date of fit:     Tue Jun 28 01:22:35 2016 
+## Date of summary: Tue Jun 28 01:22:35 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.422 s
+## Fitted with method Port using 66 model solutions performed in 0.438 s
 ## 
 ## Weighting: none
 ## 
-- 
cgit v1.2.1