summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2010-03-30 19:49:44 +0000
committerjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2010-03-30 19:49:44 +0000
commit12934520d7ec3218ce1505787b6066334a24a562 (patch)
treee3d3439a63260dfe8fc01037ef297e09e876cc67
Initial import of the kinfit package developed from 2008-07 to 2010-03 at
Harlan Laboratories Ltd (former RCC Ltd). Supports fitting of parent data with the usual FOCUS kinetic models. git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/kinfit@2 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
-rw-r--r--DESCRIPTION11
-rw-r--r--R/DFOP.R5
-rw-r--r--R/FOMC.R4
-rw-r--r--R/HS.R6
-rw-r--r--R/SFO.R4
-rw-r--r--R/kinerrmin.R21
-rw-r--r--R/kinfit.R94
-rw-r--r--R/kinobject.R11
-rw-r--r--R/kinobjects.R14
-rw-r--r--R/kinplot.R66
-rw-r--r--R/kinreport.R47
-rw-r--r--R/kinresplot.R14
-rw-r--r--R/kinresults.R74
-rw-r--r--R/kinwrite.KinGUI.R11
-rw-r--r--data/FOCUS_2006_A.rdabin0 -> 229 bytes
-rw-r--r--data/FOCUS_2006_A_SFO_ref.tex11
-rw-r--r--data/FOCUS_2006_B.rdabin0 -> 227 bytes
-rw-r--r--data/FOCUS_2006_C.rdabin0 -> 211 bytes
-rw-r--r--data/FOCUS_2006_D.rdabin0 -> 397 bytes
-rw-r--r--data/FOCUS_2006_DFOP_ref_A_to_B.rdabin0 -> 723 bytes
-rw-r--r--data/FOCUS_2006_E.rdabin0 -> 251 bytes
-rw-r--r--data/FOCUS_2006_F.rdabin0 -> 264 bytes
-rw-r--r--data/FOCUS_2006_FOMC_ref_A_to_F.rdabin0 -> 1266 bytes
-rw-r--r--data/FOCUS_2006_HS_ref_A_to_F.rdabin0 -> 1304 bytes
-rw-r--r--data/FOCUS_2006_SFO_ref_A_to_F.rdabin0 -> 1097 bytes
-rw-r--r--inst/doc/FOCUS_2006_FOMC_F_total_ref.tex0
-rw-r--r--inst/doc/KinGUI/A_DFOP_report.txt63
-rw-r--r--inst/doc/KinGUI/A_FOMC_report.txt61
-rw-r--r--inst/doc/KinGUI/A_HS_report.txt63
-rw-r--r--inst/doc/KinGUI/A_KinGUI.txt13
-rw-r--r--inst/doc/KinGUI/A_SFO_report.txt59
-rw-r--r--inst/doc/KinGUI/B_DFOP_report.txt63
-rw-r--r--inst/doc/KinGUI/B_FOMC_report.txt61
-rw-r--r--inst/doc/KinGUI/B_HS_report.txt63
-rw-r--r--inst/doc/KinGUI/B_KinGUI.txt13
-rw-r--r--inst/doc/KinGUI/B_SFO_report.txt59
-rw-r--r--inst/doc/KinGUI/C_DFOP_report.txt64
-rw-r--r--inst/doc/KinGUI/C_FOMC_report.txt62
-rw-r--r--inst/doc/KinGUI/C_HS_report.txt64
-rw-r--r--inst/doc/KinGUI/C_KinGUI.txt14
-rw-r--r--inst/doc/KinGUI/C_SFO_report.txt60
-rw-r--r--inst/doc/KinGUI/D_DFOP_report.txt77
-rw-r--r--inst/doc/KinGUI/D_FOMC_report.txt75
-rw-r--r--inst/doc/KinGUI/D_HS_report.txt77
-rw-r--r--inst/doc/KinGUI/D_KinGUI.txt27
-rw-r--r--inst/doc/KinGUI/D_SFO_report.txt73
-rw-r--r--inst/doc/KinGUI/F_system_DFOP_report.txt64
-rw-r--r--inst/doc/KinGUI/F_system_FOMC_report.txt62
-rw-r--r--inst/doc/KinGUI/F_system_HS_report.txt64
-rw-r--r--inst/doc/KinGUI/F_system_KinGUI.txt14
-rw-r--r--inst/doc/KinGUI/F_system_SFO_report.txt60
-rw-r--r--inst/doc/KinGUI/F_water_DFOP_report.txt64
-rw-r--r--inst/doc/KinGUI/F_water_FOMC_report.txt62
-rw-r--r--inst/doc/KinGUI/F_water_HS_report.txt64
-rw-r--r--inst/doc/KinGUI/F_water_KinGUI.txt14
-rw-r--r--inst/doc/KinGUI/F_water_SFO_report.txt60
-rw-r--r--inst/doc/Rplots.pdf813
-rw-r--r--inst/doc/header.tex31
-rw-r--r--inst/doc/kinfit.Rnw933
-rw-r--r--inst/doc/kinfit.pdfbin0 -> 282336 bytes
-rw-r--r--inst/doc/references.bib38
-rw-r--r--inst/doc/run.bat5
-rw-r--r--man/DFOP.Rd37
-rw-r--r--man/FOCUS_2006_A.Rd29
-rw-r--r--man/FOCUS_2006_B.Rd29
-rw-r--r--man/FOCUS_2006_C.Rd30
-rw-r--r--man/FOCUS_2006_D.Rd33
-rw-r--r--man/FOCUS_2006_DFOP_ref_A_to_B.Rd43
-rw-r--r--man/FOCUS_2006_E.Rd32
-rw-r--r--man/FOCUS_2006_F.Rd32
-rw-r--r--man/FOCUS_2006_FOMC_ref_A_to_F.Rd42
-rw-r--r--man/FOCUS_2006_HS_ref_A_to_F.Rd43
-rw-r--r--man/FOCUS_2006_SFO_ref_A_to_F.Rd41
-rw-r--r--man/FOMC.Rd49
-rw-r--r--man/HS.Rd35
-rw-r--r--man/SFO.Rd30
-rw-r--r--man/kinerrmin.Rd43
-rw-r--r--man/kinfit.Rd77
-rw-r--r--man/kinobject.Rd29
-rw-r--r--man/kinobjects.Rd29
-rw-r--r--man/kinplot.Rd50
-rw-r--r--man/kinreport.Rd48
-rw-r--r--man/kinresplot.Rd49
-rw-r--r--man/kinresults.Rd45
-rw-r--r--man/kinwrite.KinGUI.Rd47
-rw-r--r--tests/test_FOCUS_2006_A.R25
-rw-r--r--tests/test_FOCUS_2006_A.Rout.save79
87 files changed, 4878 insertions, 0 deletions
diff --git a/DESCRIPTION b/DESCRIPTION
new file mode 100644
index 0000000..da36b4f
--- /dev/null
+++ b/DESCRIPTION
@@ -0,0 +1,11 @@
+Package: kinfit
+Type: Package
+Title: Routines for fitting kinetic models to chemical degradation data
+Version: 1.0
+Date: 2009-10-05
+Author: Johannes Ranke
+Maintainer: Johannes Ranke <jranke@harlan.com>
+Description: Simple calculation routines based on the FOCUS Kinetics
+ Report (2006)
+License: GPL
+LazyLoad: yes
diff --git a/R/DFOP.R b/R/DFOP.R
new file mode 100644
index 0000000..4cac735
--- /dev/null
+++ b/R/DFOP.R
@@ -0,0 +1,5 @@
+DFOP <- function(t, parent.0, k1, k2, g)
+{
+ parent = g * parent.0 * exp(-k1 * t) +
+ (1 - g) * parent.0 * exp(-k2 * t)
+}
diff --git a/R/FOMC.R b/R/FOMC.R
new file mode 100644
index 0000000..9358bee
--- /dev/null
+++ b/R/FOMC.R
@@ -0,0 +1,4 @@
+FOMC <- function(t, parent.0, alpha, beta)
+{
+ parent = parent.0 / (t/beta + 1)^alpha
+}
diff --git a/R/HS.R b/R/HS.R
new file mode 100644
index 0000000..0755c90
--- /dev/null
+++ b/R/HS.R
@@ -0,0 +1,6 @@
+HS <- function(t, parent.0, k1, k2, tb)
+{
+ parent = ifelse(t <= tb,
+ parent.0 * exp(-k1 * t),
+ parent.0 * exp(-k1 * tb) * exp(-k2 * (t - tb)))
+}
diff --git a/R/SFO.R b/R/SFO.R
new file mode 100644
index 0000000..a91625c
--- /dev/null
+++ b/R/SFO.R
@@ -0,0 +1,4 @@
+SFO <- function(t, parent.0, k)
+{
+ parent = parent.0 * exp(-k * t)
+}
diff --git a/R/kinerrmin.R b/R/kinerrmin.R
new file mode 100644
index 0000000..8ce30a3
--- /dev/null
+++ b/R/kinerrmin.R
@@ -0,0 +1,21 @@
+kinerrmin <- function(kinfits, kinmodel = "SFO", alpha = 0.05)
+{
+ m = kinfits[[kinmodel]]
+
+ kindata <- data.frame(t = kinfits[[kinmodel]]$model$t,
+ parent = kinfits[[kinmodel]]$model$parent)
+ kindata.means <- aggregate(kindata, list(kindata$t), mean)
+ kindata.means.mean <- mean(kindata.means$parent, na.rm=TRUE)
+
+ n.parms = length(coef(m))
+ df = length(kindata.means$parent) - n.parms
+ kindata.means$est <- predict(m, kindata.means)
+
+ f <- function(err)
+ {
+ (sum((kindata.means$parent - kindata.means$est)^2/((err*kindata.means.mean)^2)) -
+ qchisq(1 - alpha,df))^2
+ }
+ err.min <- optimize(f, c(0.01,0.9))$minimum
+ return(err.min)
+}
diff --git a/R/kinfit.R b/R/kinfit.R
new file mode 100644
index 0000000..42a6520
--- /dev/null
+++ b/R/kinfit.R
@@ -0,0 +1,94 @@
+kinfit <- function(kindata, kinmodels = c("SFO"),
+ parent.0.user = NA,
+ start.SFO = list(parent.0 = NA, k = NA),
+ start.FOMC = list(parent.0 = NA, alpha = NA, beta = NA),
+ start.DFOP = list(parent.0 = NA, k1 = NA, k2 = NA, g = NA),
+ start.HS = list(parent.0 = NA, k1 = NA, k2 = NA, tb = NA),
+ algorithm = "port")
+{
+ kindata <- subset(kindata, !is.na(kindata$parent))
+ kinfits <- list()
+
+ if (!is.na(parent.0.user)) {
+ start.SFO$parent.0 = parent.0.user
+ start.FOMC$parent.0 = parent.0.user
+ }
+
+ lmlogged = lm(log(parent) ~ t, data = kindata)
+
+ for (kinmodel in kinmodels)
+ {
+
+ if (kinmodel == "SFO") {
+ if (is.na(start.SFO$parent.0)) {
+ start.SFO$parent.0 = max(kindata$parent)
+ }
+ if (is.na(start.SFO$k)) {
+ start.SFO$k = - coef(lmlogged)[["t"]]
+ }
+ kinfits[[kinmodel]] = try(
+ nls(parent ~ SFO(t, parent.0, k),
+ data = kindata, model = TRUE,
+ start = start.SFO,
+ algorithm = algorithm), silent=TRUE)
+ }
+ k.est = ifelse(is.na(coef(kinfits$SFO)[["k"]]),
+ -coef(lmlogged)[["t"]],
+ coef(kinfits$SFO)[["k"]])
+ if (kinmodel == "FOMC") {
+ if (is.na(start.FOMC$parent.0)) {
+ start.FOMC$parent.0 = max(kindata$parent)
+ }
+ if (is.na(start.FOMC$alpha)) {
+ start.FOMC$alpha = 1
+ }
+ if (is.na(start.FOMC$beta)) {
+ start.FOMC$beta = start.FOMC$alpha / k.est
+ }
+ kinfits[[kinmodel]] = try(
+ nls(parent ~ FOMC(t, parent.0, alpha, beta),
+ data = kindata, model = TRUE,
+ start = start.FOMC,
+ algorithm = algorithm), silent=TRUE)
+ }
+ if (kinmodel == "DFOP") {
+ if (is.na(start.DFOP$parent.0)) {
+ start.DFOP$parent.0 = max(kindata$parent)
+ }
+ if (is.na(start.DFOP$k1)) {
+ start.DFOP$k1 = k.est * 2
+ }
+ if (is.na(start.DFOP$k2)) {
+ start.DFOP$k2 = k.est / 2
+ }
+ if (is.na(start.DFOP$g)) {
+ start.DFOP$g = 0.5
+ }
+ kinfits[[kinmodel]] = try(
+ nls(parent ~ DFOP(t, parent.0, k1, k2, g),
+ data = kindata, model = TRUE,
+ start = start.DFOP,
+ algorithm = algorithm), silent=TRUE)
+ }
+ if (kinmodel == "HS") {
+ if (is.na(start.HS$parent.0)) {
+ start.HS$parent.0 = max(kindata$parent)
+ }
+ if (is.na(start.HS$k1)) {
+ start.HS$k1 = k.est
+ }
+ if (is.na(start.HS$k2)) {
+ start.HS$k2 = k.est / 10
+ }
+ if (is.na(start.HS$tb)) {
+ start.HS$tb = 0.05 * max(kindata$t)
+ }
+ kinfits[[kinmodel]] = try(
+ nls(parent ~ HS(t, parent.0, k1, k2, tb),
+ data = kindata, model = TRUE,
+ start = start.HS,
+ algorithm = algorithm), silent=TRUE)
+ }
+ }
+ return(kinfits)
+}
diff --git a/R/kinobject.R b/R/kinobject.R
new file mode 100644
index 0000000..de6f6af
--- /dev/null
+++ b/R/kinobject.R
@@ -0,0 +1,11 @@
+kinobject <- function(parent, type, system,
+ layers = NA, sampling_times = NA)
+{
+ kinobject <- list(parent = parent,
+ type = type, system = system)
+ if (!is.na(layers[1])) kinobject$layers = layers
+ if (!is.na(sampling_times[1])) {
+ kinobject$sampling_times = layers
+ }
+ return(kinobject)
+}
diff --git a/R/kinobjects.R b/R/kinobjects.R
new file mode 100644
index 0000000..a767cea
--- /dev/null
+++ b/R/kinobjects.R
@@ -0,0 +1,14 @@
+kinobjects<- function(parent, type, systems,
+ layers = NA, sampling_times = NA)
+{
+ kinobjects <- list()
+ for (system in systems) {
+ kinobjects[[system]] <- kinobject(parent = parent,
+ type = type, system = system)
+ if (!is.na(layers[1])) kinobjects[[system]]$layers = layers
+ if (!is.na(sampling_times[1])) {
+ kinobjects[[system]]$sampling_times = layers
+ }
+ }
+ return(kinobjects)
+}
diff --git a/R/kinplot.R b/R/kinplot.R
new file mode 100644
index 0000000..ace1270
--- /dev/null
+++ b/R/kinplot.R
@@ -0,0 +1,66 @@
+kinplot <- function(kinobject,
+ xlab = "Time [days]", ylab = "Parent [% of applied radioactivity]",
+ ylim = c("auto", "auto"),
+ lpos = "topright")
+{
+ kindata <- na.omit(kinobject$data)
+ kinfits <- kinobject$fits
+ if (ylim[1] == "auto") ylim[1] <- 0
+ if (ylim[2] == "auto") ylim[2] <- max(kindata$parent)
+ ylim <- as.numeric(ylim)
+
+ plot(kindata$t, kindata$parent,
+ xlab = xlab,
+ ylab = ylab,
+ ylim = ylim
+ )
+ n.m <- length(kinfits)
+ colors <- ltys <- 1:n.m
+ names(colors) <- names(ltys) <- names(kinfits)
+ ltext <- paste(kinobject$parent, "measured")
+ for (kinmodel in names(kinfits))
+ {
+ m = kinfits[[kinmodel]]
+ if(class(m) == "nls") {
+ switch(kinmodel,
+ SFO = curve(SFO(x,
+ coef(m)[["parent.0"]],
+ coef(m)[["k"]]),
+ from = min(kindata$t), to = max(kindata$t), add=TRUE,
+ col = colors[[kinmodel]],
+ lty = ltys[[kinmodel]]),
+ FOMC = curve(FOMC(x,
+ coef(m)[["parent.0"]],
+ coef(m)[["alpha"]],
+ coef(m)[["beta"]]),
+ from = min(kindata$t), to = max(kindata$t), add=TRUE,
+ col = colors[[kinmodel]],
+ lty = ltys[[kinmodel]]),
+ HS = curve(HS(x,
+ coef(m)[["parent.0"]],
+ coef(m)[["k1"]],
+ coef(m)[["k2"]],
+ coef(m)[["tb"]]),
+ from = min(kindata$t), to = max(kindata$t), add=TRUE,
+ col = colors[[kinmodel]],
+ lty = ltys[[kinmodel]]),
+ DFOP = curve(DFOP(x,
+ coef(m)[["parent.0"]],
+ coef(m)[["k1"]],
+ coef(m)[["k2"]],
+ coef(m)[["g"]]),
+ from = min(kindata$t), to = max(kindata$t), add=TRUE,
+ col = colors[[kinmodel]],
+ lty = ltys[[kinmodel]]))
+ ltext <- c(ltext, paste("Fitted", kinmodel, "model"))
+ } else {
+ ltext <- c(ltext, paste(kinmodel, "model failed"))
+ ltys[[kinmodel]] <- NA
+ }
+ }
+ legend(lpos, bty="n", inset = 0.05,
+ legend = ltext,
+ pch = c(1, rep(NA, n.m)),
+ lty = c(NA, ltys),
+ col = c(1, colors))
+}
diff --git a/R/kinreport.R b/R/kinreport.R
new file mode 100644
index 0000000..4156803
--- /dev/null
+++ b/R/kinreport.R
@@ -0,0 +1,47 @@
+kinreport <- function(kinobject, file = NA, vcov = FALSE, endpoint.digits = 1)
+{
+ if (!is.na(file)) {
+ sink(file, split=TRUE)
+ }
+
+ cat("Parent compound: ", kinobject$parent, "\n")
+ if (!is.null(kinobject$label)) cat("Label position:\t\t", kinobject$label, "\n")
+ cat("Study type: ", kinobject$type, "\n")
+ cat("System: ", kinobject$system, "\n")
+ if (!is.null(kinobject$source)) {
+ cat("Source: ", kinobject$source, "\n")
+ }
+ cat("\n")
+ fit.names <- names(kinobject$fits)
+ for (kinmodel in fit.names)
+ {
+ m <- kinobject$fits[[kinmodel]]
+ if (!(class(m) == "try-error")) {
+ cat("\n\n---\n")
+ cat("Nonlinear least squares fit of the", kinmodel, "model\n\n")
+ cat("Parameter estimation:\t")
+ s <- summary(m)
+ df <- s$df[2]
+ p <- 1 - pt(s$parameters[,3], df = df)
+ parms <- cbind(s$parameters[,c(1,2,3)], "Pr(>t)" = p)
+ cat("\n")
+ print(parms, digits=3)
+ cat("\n")
+ if(vcov)
+ {
+ cat("Variance-covariance matrix:\n")
+ print(vcov(m))
+ cat("\n")
+ }
+ cat("Chi2 error estimation:\t",
+ round(100 * kinobject$results$stats[kinmodel, "err.min"], digits=2),
+ " %\n", sep="")
+ cat("\n")
+ }
+ }
+ cat("\n\n---\n")
+ cat("Endpoint estimates\n\n")
+ print(round(kinobject$results$results, digits=endpoint.digits))
+
+ if (!is.na(file)) sink()
+}
diff --git a/R/kinresplot.R b/R/kinresplot.R
new file mode 100644
index 0000000..be0a85d
--- /dev/null
+++ b/R/kinresplot.R
@@ -0,0 +1,14 @@
+kinresplot <- function(kinobject, kinmodel,
+ xlab = "Time [days]", ylab = "Residual [% of applied radioactivity]",
+ maxabs = "auto")
+{
+ m <- kinobject$fits[[kinmodel]]
+ t <- m$model$t
+ residuals <- residuals(m)
+ if (maxabs == "auto") maxabs = max(abs(residuals))
+ plot(t, residuals,
+ xlab = xlab,
+ ylab = ylab,
+ ylim = c( -1.2 * maxabs, 1.2 * maxabs))
+ title(paste("Residuals of", kinmodel, "fit"), font.main = 1)
+}
diff --git a/R/kinresults.R b/R/kinresults.R
new file mode 100644
index 0000000..6bbff28
--- /dev/null
+++ b/R/kinresults.R
@@ -0,0 +1,74 @@
+kinresults <- function(kinfits, alpha = 0.05, SFORB=TRUE)
+{
+ kindata <- data.frame(t = kinfits[[1]]$model$t, parent = kinfits[[1]]$model$parent)
+ kindata.means <- aggregate(kindata, list(kindata$t), mean)
+ kindata.means.mean <- mean(kindata.means$parent, na.rm=TRUE)
+ n.times <- length(kindata.means$parent)
+ parms <- list()
+ df <- err.min <- RSS <- vector()
+ DT50 <- DT90 <- vector()
+ f <- list()
+ for (kinmodel in names(kinfits))
+ {
+ m = kinfits[[kinmodel]]
+ if(class(m) == "nls") {
+ kindata.means$est <- predict(m, kindata.means)
+ parms[[kinmodel]] <- switch(kinmodel,
+ SFO = list(parent.0 = coef(m)[["parent.0"]],
+ k = coef(m)[["k"]]),
+ FOMC = list(parent.0 = coef(m)[["parent.0"]],
+ alpha = coef(m)[["alpha"]],
+ beta = coef(m)[["beta"]]),
+ HS = list(parent.0 = coef(m)[["parent.0"]],
+ k1 = coef(m)[["k1"]],
+ k2 = coef(m)[["k2"]],
+ tb = coef(m)[["tb"]]),
+ DFOP = list(parent.0 = coef(m)[["parent.0"]],
+ k1 = coef(m)[["k1"]],
+ k2 = coef(m)[["k2"]],
+ g = coef(m)[["g"]]))
+ if(kinmodel == "DFOP" & SFORB) {
+ k1 = coef(m)[["k1"]]
+ k2 = coef(m)[["k2"]]
+ g = coef(m)[["g"]]
+ parms[["SFORB"]] =
+ list(parent.0 = coef(m)[["parent.0"]],
+ k1out = g * k1 + (1 - g) * k2,
+ k21 = k1 * k2 / (g * k1 + (1 - g) * k2),
+ k12 = (g * (1 - g) * (k1 - k2)^2) / (g * k1 + (1 - g) * k2))
+ }
+ n.parms = length(coef(m))
+ f[[kinmodel]] = switch(kinmodel,
+ HS = function(t, x) {
+ (HS(t, coef(m)[["parent.0"]],
+ coef(m)[["k1"]], coef(m)[["k2"]], coef(m)[["tb"]]) -
+ (1 - x/100) * coef(m)[["parent.0"]])^2
+ },
+ DFOP = function(t, x) {
+ (DFOP(t, coef(m)[["parent.0"]],
+ coef(m)[["k1"]], coef(m)[["k2"]], coef(m)[["g"]]) -
+ (1 - x/100) * coef(m)[["parent.0"]])^2
+ }
+ )
+ coef(m)
+
+ df[[kinmodel]] = n.times - n.parms
+ RSS[[kinmodel]] = sum(summary(m)$residuals^2)
+ DT50[[kinmodel]] = switch(kinmodel,
+ SFO = log(2)/coef(m)[["k"]],
+ FOMC = coef(m)[["beta"]] * (2^(1/coef(m)[["alpha"]]) - 1),
+ HS = optimize(f[[kinmodel]], c(0, max(kindata$t)), x=50)$minimum,
+ DFOP = optimize(f[[kinmodel]], c(0, max(kindata$t)), x=50)$minimum)
+ DT90[[kinmodel]] = switch(kinmodel,
+ SFO = log(10)/coef(m)[["k"]],
+ FOMC = coef(m)[["beta"]] * (10^(1/coef(m)[["alpha"]]) - 1),
+ HS = optimize(f[[kinmodel]], c(0, max(kindata$t)), x=90)$minimum,
+ DFOP = optimize(f[[kinmodel]], c(0, max(kindata$t)), x=90)$minimum)
+ err.min[[kinmodel]] <- kinerrmin(kinfits, kinmodel)
+ }
+ }
+ stats <- data.frame(n.times = n.times, df = df, mean.means = kindata.means.mean,
+ RSS = RSS, err.min = err.min)
+ results <- data.frame(DT50 = DT50, DT90 = DT90)
+ list(parms = parms, stats = stats, results = results)
+}
diff --git a/R/kinwrite.KinGUI.R b/R/kinwrite.KinGUI.R
new file mode 100644
index 0000000..bf94f49
--- /dev/null
+++ b/R/kinwrite.KinGUI.R
@@ -0,0 +1,11 @@
+kinwrite.KinGUI <- function(kinobject, file, comment=NA)
+{
+ sink(file)
+ cat("Version:\t1.1\n")
+ cat("Project:\t", kinobject$parent, "\n", sep = "")
+ cat("Testsystem:\t", kinobject$type, "\n", sep = "")
+ cat("Comment:\t", comment, "\n", sep = "")
+ write.table(kinobject$data, sep = "\t", na = "NaN",
+ quote = FALSE, row.names = FALSE)
+ sink()
+}
diff --git a/data/FOCUS_2006_A.rda b/data/FOCUS_2006_A.rda
new file mode 100644
index 0000000..c9498f6
--- /dev/null
+++ b/data/FOCUS_2006_A.rda
Binary files differ
diff --git a/data/FOCUS_2006_A_SFO_ref.tex b/data/FOCUS_2006_A_SFO_ref.tex
new file mode 100644
index 0000000..a63cf65
--- /dev/null
+++ b/data/FOCUS_2006_A_SFO_ref.tex
@@ -0,0 +1,11 @@
+ACSL & 109.20 & 0.0372 & 18.63 & 61.90 & A \\
+Excel & 109.15 & 0.0372 & 18.62 & 61.87 & A \\
+Kinetica & 109.11 & 0.0371 & 18.66 & 62.00 & A \\
+Madonna & 109.20 & 0.0372 & 18.63 & 61.90 & A \\
+Mathematica & 109.15 & 0.0372 & 18.62 & 61.87 & A \\
+MatLab & 109.15 & 0.0372 & 18.63 & 61.87 & A \\
+ModelMaker & 109.10 & 0.0371 & 18.68 & 62.06 & A \\
+ModelManager & 109.15 & 0.0372 & 18.62 & 61.86 & A \\
+PRISM & 109.20 & 0.0372 & 18.63 & 61.90 & A \\
+Statistica & 109.15 & 0.0372 & 18.63 & 61.90 & A \\
+Tablecurve & 109.15 & 0.0372 & 18.62 & 61.87 & A \\
diff --git a/data/FOCUS_2006_B.rda b/data/FOCUS_2006_B.rda
new file mode 100644
index 0000000..79a475a
--- /dev/null
+++ b/data/FOCUS_2006_B.rda
Binary files differ
diff --git a/data/FOCUS_2006_C.rda b/data/FOCUS_2006_C.rda
new file mode 100644
index 0000000..1344bf3
--- /dev/null
+++ b/data/FOCUS_2006_C.rda
Binary files differ
diff --git a/data/FOCUS_2006_D.rda b/data/FOCUS_2006_D.rda
new file mode 100644
index 0000000..c0fbebd
--- /dev/null
+++ b/data/FOCUS_2006_D.rda
Binary files differ
diff --git a/data/FOCUS_2006_DFOP_ref_A_to_B.rda b/data/FOCUS_2006_DFOP_ref_A_to_B.rda
new file mode 100644
index 0000000..8b9dc9f
--- /dev/null
+++ b/data/FOCUS_2006_DFOP_ref_A_to_B.rda
Binary files differ
diff --git a/data/FOCUS_2006_E.rda b/data/FOCUS_2006_E.rda
new file mode 100644
index 0000000..e90baed
--- /dev/null
+++ b/data/FOCUS_2006_E.rda
Binary files differ
diff --git a/data/FOCUS_2006_F.rda b/data/FOCUS_2006_F.rda
new file mode 100644
index 0000000..be28c57
--- /dev/null
+++ b/data/FOCUS_2006_F.rda
Binary files differ
diff --git a/data/FOCUS_2006_FOMC_ref_A_to_F.rda b/data/FOCUS_2006_FOMC_ref_A_to_F.rda
new file mode 100644
index 0000000..c0ff69d
--- /dev/null
+++ b/data/FOCUS_2006_FOMC_ref_A_to_F.rda
Binary files differ
diff --git a/data/FOCUS_2006_HS_ref_A_to_F.rda b/data/FOCUS_2006_HS_ref_A_to_F.rda
new file mode 100644
index 0000000..b50a5fc
--- /dev/null
+++ b/data/FOCUS_2006_HS_ref_A_to_F.rda
Binary files differ
diff --git a/data/FOCUS_2006_SFO_ref_A_to_F.rda b/data/FOCUS_2006_SFO_ref_A_to_F.rda
new file mode 100644
index 0000000..411c536
--- /dev/null
+++ b/data/FOCUS_2006_SFO_ref_A_to_F.rda
Binary files differ
diff --git a/inst/doc/FOCUS_2006_FOMC_F_total_ref.tex b/inst/doc/FOCUS_2006_FOMC_F_total_ref.tex
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/inst/doc/FOCUS_2006_FOMC_F_total_ref.tex
diff --git a/inst/doc/KinGUI/A_DFOP_report.txt b/inst/doc/KinGUI/A_DFOP_report.txt
new file mode 100644
index 0000000..b887a46
--- /dev/null
+++ b/inst/doc/KinGUI/A_DFOP_report.txt
@@ -0,0 +1,63 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\A_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k1: 0.1000 0.0000 Inf
+ Parent_k2: 0.0100 0.0000 Inf
+ Parent_g: 0.5000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 9.6600 NaN
+ Kinetic Model: dfop sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k1 0.0373 185.8206 0.4999
+ Parent_k2 0.0372 160.9856 0.4999
+ Parent_g 0.4780 >1000.0000 0.5000
+ Parent_FFS 1.0000
+ Parent_M(0) 109.2019 6.5416
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 18.6130 NaN
+ DT90: 61.8309 NaN
+ Kinetic model: dfop sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 101.2400 109.2019 -7.9619 NaN 0.0000 NaN
+ 3.0 99.2700 97.6587 1.6113 NaN 11.5432 NaN
+ 7.0 90.1100 84.1431 5.9669 NaN 25.0589 NaN
+ 14.0 72.1900 64.8345 7.3555 NaN 44.3674 NaN
+ 30.0 29.7100 35.7303 -6.0203 NaN 73.4716 NaN
+ 62.0 5.9800 10.8517 -4.8717 NaN 98.3502 NaN
+ 90.0 1.5400 3.8252 -2.2852 NaN 105.3768 NaN
+ 118.0 0.3900 1.3483 -0.9583 NaN 107.8536 NaN
+
diff --git a/inst/doc/KinGUI/A_FOMC_report.txt b/inst/doc/KinGUI/A_FOMC_report.txt
new file mode 100644
index 0000000..dbd9182
--- /dev/null
+++ b/inst/doc/KinGUI/A_FOMC_report.txt
@@ -0,0 +1,61 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\A_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_alpha: 1.0000 0.0000 Inf
+ Parent_beta: 10.0000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 9.3116 NaN
+ Kinetic Model: fomc sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_alpha 28.4585 227.8602 0.4527
+ Parent_beta 746.2785 >1000.0000 0.4539
+ Parent_FFS 1.0000
+ Parent_M(0) 109.4378 5.5762
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 18.3999 NaN
+ DT90: 62.8917 NaN
+ Kinetic model: fomc sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 101.2400 109.4378 -8.1978 NaN 0.0000 NaN
+ 3.0 99.2700 97.6300 1.6400 NaN 11.8079 NaN
+ 7.0 90.1100 83.9032 6.2068 NaN 25.5346 NaN
+ 14.0 72.1900 64.4848 7.7052 NaN 44.9531 NaN
+ 30.0 29.7100 35.6496 -5.9396 NaN 73.7882 NaN
+ 62.0 5.9800 11.2926 -5.3126 NaN 98.1452 NaN
+ 90.0 1.5400 4.2845 -2.7445 NaN 105.1534 NaN
+ 118.0 0.3900 1.6783 -1.2883 NaN 107.7596 NaN
+
diff --git a/inst/doc/KinGUI/A_HS_report.txt b/inst/doc/KinGUI/A_HS_report.txt
new file mode 100644
index 0000000..00c5fef
--- /dev/null
+++ b/inst/doc/KinGUI/A_HS_report.txt
@@ -0,0 +1,63 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\A_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k1: 0.1000 0.0000 Inf
+ Parent_k2: 0.0100 0.0000 Inf
+ Parent_tb: 3.0000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 4.1106 NaN
+ Kinetic Model: hs sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k1 0.0057 0.0149 0.3610
+ Parent_k2 0.0462 0.0037 1.2e-004
+ Parent_tb 5.8616 2.3515 0.0336
+ Parent_FFS 1.0000
+ Parent_M(0) 101.1190 3.1688
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 20.1455 NaN
+ DT90: 54.9884 NaN
+ Kinetic model: hs sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 101.2400 101.1190 0.1210 NaN 0.0000 NaN
+ 3.0 99.2700 99.4072 -0.1372 NaN 1.7118 NaN
+ 7.0 90.1100 92.7915 -2.6815 NaN 8.3275 NaN
+ 14.0 72.1900 67.1559 5.0341 NaN 33.9631 NaN
+ 30.0 29.7100 32.0712 -2.3612 NaN 69.0478 NaN
+ 62.0 5.9800 7.3144 -1.3344 NaN 93.8047 NaN
+ 90.0 1.5400 2.0067 -0.4667 NaN 99.1123 NaN
+ 118.0 0.3900 0.5505 -0.1605 NaN 100.5685 NaN
+
diff --git a/inst/doc/KinGUI/A_KinGUI.txt b/inst/doc/KinGUI/A_KinGUI.txt
new file mode 100644
index 0000000..419b0dc
--- /dev/null
+++ b/inst/doc/KinGUI/A_KinGUI.txt
@@ -0,0 +1,13 @@
+Version: 1.1
+Project:
+Testsystem:
+Comment: NA
+t parent
+0 101.24
+3 99.27
+7 90.11
+14 72.19
+30 29.71
+62 5.98
+90 1.54
+118 0.39
diff --git a/inst/doc/KinGUI/A_SFO_report.txt b/inst/doc/KinGUI/A_SFO_report.txt
new file mode 100644
index 0000000..8ee2968
--- /dev/null
+++ b/inst/doc/KinGUI/A_SFO_report.txt
@@ -0,0 +1,59 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\A_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k: 0.1000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 8.3852 NaN
+ Kinetic Model: sfo sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k 0.0372 0.0043 6.5e-005
+ Parent_FFS 1.0000
+ Parent_M(0) 109.1513 4.3906
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 18.6257 NaN
+ DT90: 61.8733 NaN
+ Kinetic model: sfo sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 101.2400 109.1513 -7.9113 NaN 0.0000 NaN
+ 3.0 99.2700 97.6209 1.6491 NaN 11.5304 NaN
+ 7.0 90.1100 84.1191 5.9909 NaN 25.0322 NaN
+ 14.0 72.1900 64.8276 7.3624 NaN 44.3237 NaN
+ 30.0 29.7100 35.7411 -6.0311 NaN 73.4102 NaN
+ 62.0 5.9800 10.8638 -4.8838 NaN 98.2875 NaN
+ 90.0 1.5400 3.8322 -2.2922 NaN 105.3191 NaN
+ 118.0 0.3900 1.3518 -0.9618 NaN 107.7995 NaN
+
diff --git a/inst/doc/KinGUI/B_DFOP_report.txt b/inst/doc/KinGUI/B_DFOP_report.txt
new file mode 100644
index 0000000..0ee160b
--- /dev/null
+++ b/inst/doc/KinGUI/B_DFOP_report.txt
@@ -0,0 +1,63 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\B_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k1: 0.1000 0.0000 Inf
+ Parent_k2: 0.0100 0.0000 Inf
+ Parent_g: 0.5000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 4.9562 NaN
+ Kinetic Model: dfop sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k1 0.1045 0.2272 0.3347
+ Parent_k2 0.0594 0.1224 0.3266
+ Parent_g 0.5024 3.6431 0.4485
+ Parent_FFS 1.0000
+ Parent_M(0) 99.6663 2.5554
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 8.6800 NaN
+ DT90: 30.8040 NaN
+ Kinetic model: dfop sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 98.6200 99.6663 -1.0463 NaN 0.0000 NaN
+ 3.0 81.4300 78.0971 3.3329 NaN 21.5692 NaN
+ 7.0 53.1800 56.8198 -3.6398 NaN 42.8465 NaN
+ 14.0 34.8900 33.1902 1.6998 NaN 66.4761 NaN
+ 30.0 10.0900 10.5315 -0.4415 NaN 89.1348 NaN
+ 62.0 1.5000 1.3268 0.1732 NaN 98.3395 NaN
+ 90.0 0.3300 0.2412 0.0888 NaN 99.4251 NaN
+ 118.0 0.0800 0.0452 0.0348 NaN 99.6211 NaN
+
diff --git a/inst/doc/KinGUI/B_FOMC_report.txt b/inst/doc/KinGUI/B_FOMC_report.txt
new file mode 100644
index 0000000..1a1db57
--- /dev/null
+++ b/inst/doc/KinGUI/B_FOMC_report.txt
@@ -0,0 +1,61 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\B_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_alpha: 1.0000 0.0000 Inf
+ Parent_beta: 10.0000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 4.6641 NaN
+ Kinetic Model: fomc sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_alpha 38.9958 202.8246 0.4276
+ Parent_beta 491.1490 >1000.0000 0.4287
+ Parent_FFS 1.0000
+ Parent_M(0) 99.3410 2.2382
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 8.8082 NaN
+ DT90: 29.8742 NaN
+ Kinetic model: fomc sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 98.6200 99.3410 -0.7210 NaN 0.0000 NaN
+ 3.0 81.4300 78.3426 3.0874 NaN 20.9984 NaN
+ 7.0 53.1800 57.2085 -4.0285 NaN 42.1325 NaN
+ 14.0 34.8900 33.1999 1.6901 NaN 66.1411 NaN
+ 30.0 10.0900 9.8410 0.2490 NaN 89.5000 NaN
+ 62.0 1.5000 0.9634 0.5366 NaN 98.3776 NaN
+ 90.0 0.3300 0.1405 0.1895 NaN 99.2005 NaN
+ 118.0 0.0800 0.0224 0.0576 NaN 99.3186 NaN
+
diff --git a/inst/doc/KinGUI/B_HS_report.txt b/inst/doc/KinGUI/B_HS_report.txt
new file mode 100644
index 0000000..18bb818
--- /dev/null
+++ b/inst/doc/KinGUI/B_HS_report.txt
@@ -0,0 +1,63 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\B_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k1: 0.1000 0.0000 Inf
+ Parent_k2: 0.0100 0.0000 Inf
+ Parent_tb: 3.0000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 4.4535 NaN
+ Kinetic Model: hs sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k1 0.0840 0.0068 1.3e-004
+ Parent_k2 0.0704 0.0136 0.0033
+ Parent_tb 7.0665 7.2051 0.1911
+ Parent_FFS 1.0000
+ Parent_M(0) 100.2115 2.2443
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 8.4848 NaN
+ DT90: 31.3565 NaN
+ Kinetic model: hs sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 98.6200 100.2115 -1.5915 NaN 0.0000 NaN
+ 3.0 81.4300 77.8968 3.5332 NaN 22.3146 NaN
+ 7.0 53.1800 55.6745 -2.4945 NaN 44.5370 NaN
+ 14.0 34.8900 33.9891 0.9009 NaN 66.2224 NaN
+ 30.0 10.0900 11.0248 -0.9348 NaN 89.1866 NaN
+ 62.0 1.5000 1.1599 0.3401 NaN 99.0515 NaN
+ 90.0 0.3300 0.1617 0.1683 NaN 100.0497 NaN
+ 118.0 0.0800 0.0225 0.0575 NaN 100.1889 NaN
+
diff --git a/inst/doc/KinGUI/B_KinGUI.txt b/inst/doc/KinGUI/B_KinGUI.txt
new file mode 100644
index 0000000..f48e076
--- /dev/null
+++ b/inst/doc/KinGUI/B_KinGUI.txt
@@ -0,0 +1,13 @@
+Version: 1.1
+Project:
+Testsystem:
+Comment: NA
+t parent
+0 98.62
+3 81.43
+7 53.18
+14 34.89
+30 10.09
+62 1.5
+90 0.33
+118 0.08
diff --git a/inst/doc/KinGUI/B_SFO_report.txt b/inst/doc/KinGUI/B_SFO_report.txt
new file mode 100644
index 0000000..d3856fe
--- /dev/null
+++ b/inst/doc/KinGUI/B_SFO_report.txt
@@ -0,0 +1,59 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\B_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k: 0.1000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 4.4562 NaN
+ Kinetic Model: sfo sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k 0.0782 0.0039 4.7e-007
+ Parent_FFS 1.0000
+ Parent_M(0) 99.1740 1.9239
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 8.8686 NaN
+ DT90: 29.4608 NaN
+ Kinetic model: sfo sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 98.6200 99.1740 -0.5540 NaN 0.0000 NaN
+ 3.0 81.4300 78.4455 2.9845 NaN 20.7286 NaN
+ 7.0 53.1800 57.3845 -4.2045 NaN 41.7896 NaN
+ 14.0 34.8900 33.2040 1.6860 NaN 65.9700 NaN
+ 30.0 10.0900 9.5082 0.5818 NaN 89.6659 NaN
+ 62.0 1.5000 0.7797 0.7203 NaN 98.3944 NaN
+ 90.0 0.3300 0.0874 0.2426 NaN 99.0866 NaN
+ 118.0 0.0800 0.0098 0.0702 NaN 99.1642 NaN
+
diff --git a/inst/doc/KinGUI/C_DFOP_report.txt b/inst/doc/KinGUI/C_DFOP_report.txt
new file mode 100644
index 0000000..65b8f29
--- /dev/null
+++ b/inst/doc/KinGUI/C_DFOP_report.txt
@@ -0,0 +1,64 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\C_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k1: 0.1000 0.0000 Inf
+ Parent_k2: 0.0100 0.0000 Inf
+ Parent_g: 0.5000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 2.6613 NaN
+ Kinetic Model: dfop sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k1 0.4596 0.0204 1.6e-006
+ Parent_k2 0.0179 0.0030 0.0010
+ Parent_g 0.8539 0.0134 9.1e-009
+ Parent_FFS 1.0000
+ Parent_M(0) 85.0044 0.8907
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 1.8869 NaN
+ DT90: 21.2535 NaN
+ Kinetic model: dfop sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 85.1000 85.0044 0.0956 NaN 0.0000 NaN
+ 1.0 57.9000 58.0394 -0.1394 NaN 26.9651 NaN
+ 3.0 29.9000 30.0534 -0.1534 NaN 54.9510 NaN
+ 7.0 14.6000 13.8668 0.7332 NaN 71.1376 NaN
+ 14.0 9.7000 9.7875 -0.0875 NaN 75.2170 NaN
+ 28.0 6.6000 7.5324 -0.9324 NaN 77.4720 NaN
+ 63.0 4.0000 4.0324 -0.0324 NaN 80.9721 NaN
+ 91.0 3.9000 2.4461 1.4539 NaN 82.5583 NaN
+ 119.0 0.6000 1.4838 -0.8838 NaN 83.5206 NaN
+
diff --git a/inst/doc/KinGUI/C_FOMC_report.txt b/inst/doc/KinGUI/C_FOMC_report.txt
new file mode 100644
index 0000000..3d74181
--- /dev/null
+++ b/inst/doc/KinGUI/C_FOMC_report.txt
@@ -0,0 +1,62 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\C_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_alpha: 1.0000 0.0000 Inf
+ Parent_beta: 10.0000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 6.6574 NaN
+ Kinetic Model: fomc sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_alpha 1.0564 0.1700 4.0e-004
+ Parent_beta 1.9260 0.5402 0.0059
+ Parent_FFS 1.0000
+ Parent_M(0) 85.8766 2.2459
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 1.7860 NaN
+ DT90: 15.1052 NaN
+ Kinetic model: fomc sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 85.1000 85.8766 -0.7766 NaN 0.0000 NaN
+ 1.0 57.9000 55.2088 2.6912 NaN 30.6678 NaN
+ 3.0 29.9000 31.8437 -1.9437 NaN 54.0329 NaN
+ 7.0 14.6000 16.9940 -2.3940 NaN 68.8827 NaN
+ 14.0 9.7000 9.2184 0.4816 NaN 76.6582 NaN
+ 28.0 6.6000 4.7343 1.8657 NaN 81.1423 NaN
+ 63.0 4.0000 2.0889 1.9111 NaN 83.7877 NaN
+ 91.0 3.9000 1.4302 2.4698 NaN 84.4464 NaN
+ 119.0 0.6000 1.0829 -0.4829 NaN 84.7938 NaN
+
diff --git a/inst/doc/KinGUI/C_HS_report.txt b/inst/doc/KinGUI/C_HS_report.txt
new file mode 100644
index 0000000..ca137d4
--- /dev/null
+++ b/inst/doc/KinGUI/C_HS_report.txt
@@ -0,0 +1,64 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\C_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k1: 0.1000 0.0000 Inf
+ Parent_k2: 0.0100 0.0000 Inf
+ Parent_tb: 3.0000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 4.6963 NaN
+ Kinetic Model: hs sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k1 0.3560 0.0185 3.5e-006
+ Parent_k2 0.0227 0.0057 0.0052
+ Parent_tb 5.1551 0.3719 1.8e-005
+ Parent_FFS 1.0000
+ Parent_M(0) 84.4829 1.5377
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 1.9472 NaN
+ DT90: 25.7931 NaN
+ Kinetic model: hs sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 85.1000 84.4829 0.6171 NaN 0.0000 NaN
+ 1.0 57.9000 59.1796 -1.2796 NaN 25.3034 NaN
+ 3.0 29.9000 29.0387 0.8613 NaN 55.4442 NaN
+ 7.0 14.6000 12.9316 1.6684 NaN 71.5514 NaN
+ 14.0 9.7000 11.0354 -1.3354 NaN 73.4476 NaN
+ 28.0 6.6000 8.0363 -1.4363 NaN 76.4466 NaN
+ 63.0 4.0000 3.6369 0.3631 NaN 80.8460 NaN
+ 91.0 3.9000 1.9287 1.9713 NaN 82.5542 NaN
+ 119.0 0.6000 1.0229 -0.4229 NaN 83.4601 NaN
+
diff --git a/inst/doc/KinGUI/C_KinGUI.txt b/inst/doc/KinGUI/C_KinGUI.txt
new file mode 100644
index 0000000..87f3191
--- /dev/null
+++ b/inst/doc/KinGUI/C_KinGUI.txt
@@ -0,0 +1,14 @@
+Version: 1.1
+Project:
+Testsystem:
+Comment: NA
+t parent
+0 85.1
+1 57.9
+3 29.9
+7 14.6
+14 9.7
+28 6.6
+63 4
+91 3.9
+119 0.6
diff --git a/inst/doc/KinGUI/C_SFO_report.txt b/inst/doc/KinGUI/C_SFO_report.txt
new file mode 100644
index 0000000..5e32b0b
--- /dev/null
+++ b/inst/doc/KinGUI/C_SFO_report.txt
@@ -0,0 +1,60 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\C_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k: 0.1000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 15.8456 NaN
+ Kinetic Model: sfo sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k 0.3060 0.0459 1.4e-004
+ Parent_FFS 1.0000
+ Parent_M(0) 82.4894 4.7401
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 2.2651 NaN
+ DT90: 7.5245 NaN
+ Kinetic model: sfo sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 85.1000 82.4894 2.6106 NaN 0.0000 NaN
+ 1.0 57.9000 60.7434 -2.8434 NaN 21.7460 NaN
+ 3.0 29.9000 32.9383 -3.0383 NaN 49.5511 NaN
+ 7.0 14.6000 9.6851 4.9149 NaN 72.8043 NaN
+ 14.0 9.7000 1.1371 8.5629 NaN 81.3522 NaN
+ 28.0 6.6000 0.0157 6.5843 NaN 82.4737 NaN
+ 63.0 4.0000 0.0000 4.0000 NaN 82.4894 NaN
+ 91.0 3.9000 0.0000 3.9000 NaN 82.4894 NaN
+ 119.0 0.6000 0.0000 0.6000 NaN 82.4894 NaN
+
diff --git a/inst/doc/KinGUI/D_DFOP_report.txt b/inst/doc/KinGUI/D_DFOP_report.txt
new file mode 100644
index 0000000..31ab25d
--- /dev/null
+++ b/inst/doc/KinGUI/D_DFOP_report.txt
@@ -0,0 +1,77 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\D_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k1: 0.1000 0.0000 Inf
+ Parent_k2: 0.0100 0.0000 Inf
+ Parent_g: 0.5000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 7.2751 NaN
+ Kinetic Model: dfop sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k1 0.0982 >1000.0000 0.5000
+ Parent_k2 0.0976 >1000.0000 0.5000
+ Parent_g 0.5525 >1000.0000 0.5000
+ Parent_FFS 1.0000
+ Parent_M(0) 99.4468 2.1924
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 7.0773 NaN
+ DT90: 23.5106 NaN
+ Kinetic model: dfop sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 99.4600 99.4468 0.0132 NaN 0.0000 NaN
+ 0.0 102.0400 99.4468 2.5932 NaN 0.0000 NaN
+ 1.0 93.5000 90.1688 3.3312 NaN 9.2780 NaN
+ 1.0 92.5000 90.1688 2.3312 NaN 9.2780 NaN
+ 3.0 63.2300 74.1289 -10.8989 NaN 25.3179 NaN
+ 3.0 68.9900 74.1289 -5.1389 NaN 25.3179 NaN
+ 7.0 52.3200 50.1015 2.2185 NaN 49.3454 NaN
+ 7.0 55.1300 50.1015 5.0285 NaN 49.3454 NaN
+ 14.0 27.2700 25.2413 2.0287 NaN 74.2055 NaN
+ 14.0 26.6400 25.2413 1.3987 NaN 74.2055 NaN
+ 21.0 11.5000 12.7167 -1.2167 NaN 86.7301 NaN
+ 21.0 11.6400 12.7167 -1.0767 NaN 86.7301 NaN
+ 35.0 2.8500 3.2278 -0.3778 NaN 96.2190 NaN
+ 35.0 2.9100 3.2278 -0.3178 NaN 96.2190 NaN
+ 50.0 0.6900 0.7429 -0.0529 NaN 98.7040 NaN
+ 50.0 0.6300 0.7429 -0.1129 NaN 98.7040 NaN
+ 75.0 0.0500 0.0642 -0.0142 NaN 99.3826 NaN
+ 75.0 0.0600 0.0642 -0.0042 NaN 99.3826 NaN
+ 100.0 NaN 0.0056 NaN NaN 99.4413 NaN
+ 100.0 NaN 0.0056 NaN NaN 99.4413 NaN
+ 120.0 NaN 0.0008 NaN NaN 99.4461 NaN
+ 120.0 NaN 0.0008 NaN NaN 99.4461 NaN
+
diff --git a/inst/doc/KinGUI/D_FOMC_report.txt b/inst/doc/KinGUI/D_FOMC_report.txt
new file mode 100644
index 0000000..a2a60f9
--- /dev/null
+++ b/inst/doc/KinGUI/D_FOMC_report.txt
@@ -0,0 +1,75 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\D_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_alpha: 1.0000 0.0000 Inf
+ Parent_beta: 10.0000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 6.8080 NaN
+ Kinetic Model: fomc sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_alpha 10.5446 13.6880 0.2265
+ Parent_beta 100.3104 139.0853 0.2409
+ Parent_FFS 1.0000
+ Parent_M(0) 100.1958 2.1103
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 6.8154 NaN
+ DT90: 24.4801 NaN
+ Kinetic model: fomc sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 99.4600 100.1958 -0.7358 NaN 0.0000 NaN
+ 0.0 102.0400 100.1958 1.8442 NaN 0.0000 NaN
+ 1.0 93.5000 90.2449 3.2551 NaN 9.9509 NaN
+ 1.0 92.5000 90.2449 2.2551 NaN 9.9509 NaN
+ 3.0 63.2300 73.4343 -10.2043 NaN 26.7615 NaN
+ 3.0 68.9900 73.4343 -4.4443 NaN 26.7615 NaN
+ 7.0 52.3200 49.1968 3.1232 NaN 50.9990 NaN
+ 7.0 55.1300 49.1968 5.9332 NaN 50.9990 NaN
+ 14.0 27.2700 25.2669 2.0031 NaN 74.9289 NaN
+ 14.0 26.6400 25.2669 1.3731 NaN 74.9289 NaN
+ 21.0 11.5000 13.5012 -2.0012 NaN 86.6946 NaN
+ 21.0 11.6400 13.5012 -1.8612 NaN 86.6946 NaN
+ 35.0 2.8500 4.2679 -1.4179 NaN 95.9279 NaN
+ 35.0 2.9100 4.2679 -1.3579 NaN 95.9279 NaN
+ 50.0 0.6900 1.4085 -0.7185 NaN 98.7872 NaN
+ 50.0 0.6300 1.4085 -0.7785 NaN 98.7872 NaN
+ 75.0 0.0500 0.2781 -0.2281 NaN 99.9177 NaN
+ 75.0 0.0600 0.2781 -0.2181 NaN 99.9177 NaN
+ 100.0 NaN 0.0682 NaN NaN 100.1276 NaN
+ 100.0 NaN 0.0682 NaN NaN 100.1276 NaN
+ 120.0 NaN 0.0250 NaN NaN 100.1708 NaN
+ 120.0 NaN 0.0250 NaN NaN 100.1708 NaN
+
diff --git a/inst/doc/KinGUI/D_HS_report.txt b/inst/doc/KinGUI/D_HS_report.txt
new file mode 100644
index 0000000..92186cd
--- /dev/null
+++ b/inst/doc/KinGUI/D_HS_report.txt
@@ -0,0 +1,77 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\D_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k1: 0.1000 0.0000 Inf
+ Parent_k2: 0.0100 0.0000 Inf
+ Parent_tb: 3.0000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 5.8196 NaN
+ Kinetic Model: hs sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k1 0.1213 0.0130 1.1e-007
+ Parent_k2 0.0879 0.0083 2.2e-008
+ Parent_tb 3.0000 5.3734 0.2927
+ Parent_FFS 1.0000
+ Parent_M(0) 100.9303 1.9766
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 6.7461 NaN
+ DT90: 25.0545 NaN
+ Kinetic model: hs sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 99.4600 100.9303 -1.4703 NaN 0.0000 NaN
+ 0.0 102.0400 100.9303 1.1097 NaN 0.0000 NaN
+ 1.0 93.5000 89.4028 4.0972 NaN 11.5275 NaN
+ 1.0 92.5000 89.4028 3.0972 NaN 11.5275 NaN
+ 3.0 63.2300 70.1471 -6.9171 NaN 30.7832 NaN
+ 3.0 68.9900 70.1471 -1.1571 NaN 30.7832 NaN
+ 7.0 52.3200 49.3513 2.9687 NaN 51.5789 NaN
+ 7.0 55.1300 49.3513 5.7787 NaN 51.5789 NaN
+ 14.0 27.2700 26.6720 0.5980 NaN 74.2583 NaN
+ 14.0 26.6400 26.6720 -0.0320 NaN 74.2583 NaN
+ 21.0 11.5000 14.4149 -2.9149 NaN 86.5154 NaN
+ 21.0 11.6400 14.4149 -2.7749 NaN 86.5154 NaN
+ 35.0 2.8500 4.2104 -1.3604 NaN 96.7199 NaN
+ 35.0 2.9100 4.2104 -1.3004 NaN 96.7199 NaN
+ 50.0 0.6900 1.1263 -0.4363 NaN 99.8040 NaN
+ 50.0 0.6300 1.1263 -0.4963 NaN 99.8040 NaN
+ 75.0 0.0500 0.1251 -0.0751 NaN 100.8052 NaN
+ 75.0 0.0600 0.1251 -0.0651 NaN 100.8052 NaN
+ 100.0 NaN 0.0139 NaN NaN 100.9164 NaN
+ 100.0 NaN 0.0139 NaN NaN 100.9164 NaN
+ 120.0 NaN 0.0024 NaN NaN 100.9279 NaN
+ 120.0 NaN 0.0024 NaN NaN 100.9279 NaN
+
diff --git a/inst/doc/KinGUI/D_KinGUI.txt b/inst/doc/KinGUI/D_KinGUI.txt
new file mode 100644
index 0000000..a79ee5e
--- /dev/null
+++ b/inst/doc/KinGUI/D_KinGUI.txt
@@ -0,0 +1,27 @@
+Version: 1.1
+Project:
+Testsystem:
+Comment: NA
+t parent m1
+0 99.46 0
+0 102.04 0
+1 93.5 4.84
+1 92.5 5.64
+3 63.23 12.91
+3 68.99 12.96
+7 52.32 22.97
+7 55.13 24.47
+14 27.27 41.69
+14 26.64 33.21
+21 11.5 44.37
+21 11.64 46.44
+35 2.85 41.22
+35 2.91 37.95
+50 0.69 41.19
+50 0.63 40.01
+75 0.05 40.09
+75 0.06 33.85
+100 NaN 31.04
+100 NaN 33.13
+120 NaN 25.15
+120 NaN 33.31
diff --git a/inst/doc/KinGUI/D_SFO_report.txt b/inst/doc/KinGUI/D_SFO_report.txt
new file mode 100644
index 0000000..902decf
--- /dev/null
+++ b/inst/doc/KinGUI/D_SFO_report.txt
@@ -0,0 +1,73 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\D_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k: 0.1000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 6.4539 NaN
+ Kinetic Model: sfo sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k 0.0979 0.0048 3.8e-013
+ Parent_FFS 1.0000
+ Parent_M(0) 99.4443 1.8316
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 7.0776 NaN
+ DT90: 23.5111 NaN
+ Kinetic model: sfo sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 99.4600 99.4443 0.0157 NaN 0.0000 NaN
+ 0.0 102.0400 99.4443 2.5957 NaN 0.0000 NaN
+ 1.0 93.5000 90.1668 3.3332 NaN 9.2775 NaN
+ 1.0 92.5000 90.1668 2.3332 NaN 9.2775 NaN
+ 3.0 63.2300 74.1277 -10.8977 NaN 25.3165 NaN
+ 3.0 68.9900 74.1277 -5.1377 NaN 25.3165 NaN
+ 7.0 52.3200 50.1013 2.2187 NaN 49.3430 NaN
+ 7.0 55.1300 50.1013 5.0287 NaN 49.3430 NaN
+ 14.0 27.2700 25.2416 2.0284 NaN 74.2026 NaN
+ 14.0 26.6400 25.2416 1.3984 NaN 74.2026 NaN
+ 21.0 11.5000 12.7171 -1.2171 NaN 86.7272 NaN
+ 21.0 11.6400 12.7171 -1.0771 NaN 86.7272 NaN
+ 35.0 2.8500 3.2279 -0.3779 NaN 96.2163 NaN
+ 35.0 2.9100 3.2279 -0.3179 NaN 96.2163 NaN
+ 50.0 0.6900 0.7429 -0.0529 NaN 98.7014 NaN
+ 50.0 0.6300 0.7429 -0.1129 NaN 98.7014 NaN
+ 75.0 0.0500 0.0642 -0.0142 NaN 99.3801 NaN
+ 75.0 0.0600 0.0642 -0.0042 NaN 99.3801 NaN
+ 100.0 NaN 0.0055 NaN NaN 99.4387 NaN
+ 100.0 NaN 0.0055 NaN NaN 99.4387 NaN
+ 120.0 NaN 0.0008 NaN NaN 99.4435 NaN
+ 120.0 NaN 0.0008 NaN NaN 99.4435 NaN
+
diff --git a/inst/doc/KinGUI/F_system_DFOP_report.txt b/inst/doc/KinGUI/F_system_DFOP_report.txt
new file mode 100644
index 0000000..9ec5931
--- /dev/null
+++ b/inst/doc/KinGUI/F_system_DFOP_report.txt
@@ -0,0 +1,64 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\F_system_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k1: 0.1000 0.0000 Inf
+ Parent_k2: 0.0100 0.0000 Inf
+ Parent_g: 0.5000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 14.1524 NaN
+ Kinetic Model: dfop sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k1 0.0397 547.5131 0.5000
+ Parent_k2 0.0396 >1000.0000 0.5000
+ Parent_g 0.6827 >1000.0000 0.5000
+ Parent_FFS 1.0000
+ Parent_M(0) 103.7338 7.5788
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 17.4895 NaN
+ DT90: 58.0989 NaN
+ Kinetic model: dfop sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 95.6000 103.7338 -8.1338 NaN 0.0000 NaN
+ 3.0 91.9000 92.1051 -0.2051 NaN 11.6286 NaN
+ 7.0 86.5000 78.6024 7.8976 NaN 25.1314 NaN
+ 14.0 72.9000 59.5595 13.3405 NaN 44.1742 NaN
+ 28.0 29.6000 34.1966 -4.5966 NaN 69.5372 NaN
+ 43.0 10.0000 18.8713 -8.8713 NaN 84.8624 NaN
+ 56.0 6.8000 11.2732 -4.4732 NaN 92.4606 NaN
+ 70.0 3.5000 6.4726 -2.9726 NaN 97.2612 NaN
+ 100.0 4.2000 1.9711 2.2289 NaN 101.7626 NaN
+
diff --git a/inst/doc/KinGUI/F_system_FOMC_report.txt b/inst/doc/KinGUI/F_system_FOMC_report.txt
new file mode 100644
index 0000000..9eb0651
--- /dev/null
+++ b/inst/doc/KinGUI/F_system_FOMC_report.txt
@@ -0,0 +1,62 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\F_system_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_alpha: 1.0000 0.0000 Inf
+ Parent_beta: 10.0000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 13.4533 NaN
+ Kinetic Model: fomc sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_alpha 53.4222 992.5119 0.4794
+ Parent_beta >1000.0000 >1000.0000 0.4797
+ Parent_FFS 1.0000
+ Parent_M(0) 104.6197 7.0437
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 17.2240 NaN
+ DT90: 58.0894 NaN
+ Kinetic model: fomc sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 95.6000 104.6197 -9.0197 NaN 0.0000 NaN
+ 3.0 91.9000 92.6616 -0.7616 NaN 11.9581 NaN
+ 7.0 86.5000 78.8498 7.6502 NaN 25.7699 NaN
+ 14.0 72.9000 59.5161 13.3839 NaN 45.1036 NaN
+ 28.0 29.6000 34.0577 -4.4577 NaN 70.5620 NaN
+ 43.0 10.0000 18.8478 -8.8478 NaN 85.7719 NaN
+ 56.0 6.8000 11.3461 -4.5461 NaN 93.2736 NaN
+ 70.0 3.5000 6.6038 -3.1038 NaN 98.0159 NaN
+ 100.0 4.2000 2.1086 2.0914 NaN 102.5111 NaN
+
diff --git a/inst/doc/KinGUI/F_system_HS_report.txt b/inst/doc/KinGUI/F_system_HS_report.txt
new file mode 100644
index 0000000..81546c7
--- /dev/null
+++ b/inst/doc/KinGUI/F_system_HS_report.txt
@@ -0,0 +1,64 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\F_system_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k1: 0.1000 0.0000 Inf
+ Parent_k2: 0.0100 0.0000 Inf
+ Parent_tb: 3.0000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 3.2178 NaN
+ Kinetic Model: hs sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k1 0.0142 0.0047 0.0151
+ Parent_k2 0.0635 0.0039 8.1e-006
+ Parent_tb 12.4685 1.3021 1.1e-004
+ Parent_FFS 1.0000
+ Parent_M(0) 95.6835 1.9092
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 20.5934 NaN
+ DT90: 45.9498 NaN
+ Kinetic model: hs sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 95.6000 95.6835 -0.0835 NaN 0.0000 NaN
+ 3.0 91.9000 91.6844 0.2156 NaN 3.9991 NaN
+ 7.0 86.5000 86.6111 -0.1111 NaN 9.0724 NaN
+ 14.0 72.9000 72.7042 0.1958 NaN 22.9793 NaN
+ 28.0 29.6000 29.8977 -0.2977 NaN 65.7858 NaN
+ 43.0 10.0000 11.5385 -1.5385 NaN 84.1450 NaN
+ 56.0 6.8000 5.0559 1.7441 NaN 90.6277 NaN
+ 70.0 3.5000 2.0791 1.4209 NaN 93.6044 NaN
+ 100.0 4.2000 0.3097 3.8903 NaN 95.3738 NaN
+
diff --git a/inst/doc/KinGUI/F_system_KinGUI.txt b/inst/doc/KinGUI/F_system_KinGUI.txt
new file mode 100644
index 0000000..ba130e0
--- /dev/null
+++ b/inst/doc/KinGUI/F_system_KinGUI.txt
@@ -0,0 +1,14 @@
+Version: 1.1
+Project:
+Testsystem:
+Comment: NA
+t parent
+0 95.6
+3 91.9
+7 86.5
+14 72.9
+28 29.6
+43 10
+56 6.8
+70 3.5
+100 4.2
diff --git a/inst/doc/KinGUI/F_system_SFO_report.txt b/inst/doc/KinGUI/F_system_SFO_report.txt
new file mode 100644
index 0000000..7dffe34
--- /dev/null
+++ b/inst/doc/KinGUI/F_system_SFO_report.txt
@@ -0,0 +1,60 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\F_system_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k: 0.1000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 12.5386 NaN
+ Kinetic Model: sfo sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k 0.0400 0.0053 6.4e-005
+ Parent_FFS 1.0000
+ Parent_M(0) 104.4774 5.6578
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 17.3489 NaN
+ DT90: 57.6318 NaN
+ Kinetic model: sfo sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 95.6000 104.4774 -8.8774 NaN 0.0000 NaN
+ 3.0 91.9000 92.6761 -0.7761 NaN 11.8013 NaN
+ 7.0 86.5000 78.9881 7.5119 NaN 25.4893 NaN
+ 14.0 72.9000 59.7174 13.1826 NaN 44.7600 NaN
+ 28.0 29.6000 34.1334 -4.5334 NaN 70.3440 NaN
+ 43.0 10.0000 18.7459 -8.7459 NaN 85.7315 NaN
+ 56.0 6.8000 11.1516 -4.3516 NaN 93.3258 NaN
+ 70.0 3.5000 6.3740 -2.8740 NaN 98.1034 NaN
+ 100.0 4.2000 1.9225 2.2775 NaN 102.5549 NaN
+
diff --git a/inst/doc/KinGUI/F_water_DFOP_report.txt b/inst/doc/KinGUI/F_water_DFOP_report.txt
new file mode 100644
index 0000000..c8275d9
--- /dev/null
+++ b/inst/doc/KinGUI/F_water_DFOP_report.txt
@@ -0,0 +1,64 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\F_water_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k1: 0.1000 0.0000 Inf
+ Parent_k2: 0.0100 0.0000 Inf
+ Parent_g: 0.5000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 12.1821 NaN
+ Kinetic Model: dfop sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k1 0.0551 >1000.0000 0.5000
+ Parent_k2 0.0551 >1000.0000 0.5000
+ Parent_g 0.6959 >1000.0000 0.5000
+ Parent_FFS 1.0000
+ Parent_M(0) 100.5778 6.1529
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 12.5797 NaN
+ DT90: 41.7890 NaN
+ Kinetic model: dfop sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 95.6000 100.5778 -4.9778 NaN 0.0000 NaN
+ 3.0 84.7000 85.2536 -0.5536 NaN 15.3242 NaN
+ 7.0 74.6000 68.3902 6.2098 NaN 32.1876 NaN
+ 14.0 54.1000 46.5035 7.5965 NaN 54.0742 NaN
+ 28.0 13.5000 21.5015 -8.0015 NaN 79.0762 NaN
+ 43.0 4.3000 9.4086 -5.1086 NaN 91.1692 NaN
+ 56.0 2.0000 4.5966 -2.5966 NaN 95.9812 NaN
+ 70.0 0.5000 2.1253 -1.6253 NaN 98.4525 NaN
+ 100.0 0.8000 0.4069 0.3931 NaN 100.1708 NaN
+
diff --git a/inst/doc/KinGUI/F_water_FOMC_report.txt b/inst/doc/KinGUI/F_water_FOMC_report.txt
new file mode 100644
index 0000000..6604e72
--- /dev/null
+++ b/inst/doc/KinGUI/F_water_FOMC_report.txt
@@ -0,0 +1,62 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\F_water_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_alpha: 1.0000 0.0000 Inf
+ Parent_beta: 10.0000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 11.6682 NaN
+ Kinetic Model: fomc sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_alpha 60.1183 907.7673 0.4747
+ Parent_beta >1000.0000 >1000.0000 0.4750
+ Parent_FFS 1.0000
+ Parent_M(0) 100.6891 5.3413
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 12.4948 NaN
+ DT90: 42.0685 NaN
+ Kinetic model: fomc sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 95.6000 100.6891 -5.0891 NaN 0.0000 NaN
+ 3.0 84.7000 85.1898 -0.4898 NaN 15.4992 NaN
+ 7.0 74.6000 68.2194 6.3806 NaN 32.4696 NaN
+ 14.0 54.1000 46.3363 7.7637 NaN 54.3527 NaN
+ 28.0 13.5000 21.5356 -8.0356 NaN 79.1535 NaN
+ 43.0 4.3000 9.5778 -5.2778 NaN 91.1112 NaN
+ 56.0 2.0000 4.7873 -2.7873 NaN 95.9018 NaN
+ 70.0 0.5000 2.2886 -1.7886 NaN 98.4004 NaN
+ 100.0 0.8000 0.4850 0.3150 NaN 100.2041 NaN
+
diff --git a/inst/doc/KinGUI/F_water_HS_report.txt b/inst/doc/KinGUI/F_water_HS_report.txt
new file mode 100644
index 0000000..3cda8e3
--- /dev/null
+++ b/inst/doc/KinGUI/F_water_HS_report.txt
@@ -0,0 +1,64 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\F_water_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k1: 0.1000 0.0000 Inf
+ Parent_k2: 0.0100 0.0000 Inf
+ Parent_tb: 3.0000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 1.6558 NaN
+ Kinetic Model: hs sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k1 0.0356 0.0022 8.3e-006
+ Parent_k2 0.0955 0.0041 1.4e-006
+ Parent_tb 12.8509 0.6443 2.9e-006
+ Parent_FFS 1.0000
+ Parent_M(0) 95.1656 0.8209
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 15.3239 NaN
+ DT90: 32.1824 NaN
+ Kinetic model: hs sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 95.6000 95.1656 0.4344 NaN 0.0000 NaN
+ 3.0 84.7000 85.5346 -0.8346 NaN 9.6310 NaN
+ 7.0 74.6000 74.1920 0.4080 NaN 20.9736 NaN
+ 14.0 54.1000 53.9934 0.1066 NaN 41.1723 NaN
+ 28.0 13.5000 14.1869 -0.6869 NaN 80.9788 NaN
+ 43.0 4.3000 3.3882 0.9118 NaN 91.7774 NaN
+ 56.0 2.0000 0.9794 1.0206 NaN 94.1862 NaN
+ 70.0 0.5000 0.2574 0.2426 NaN 94.9083 NaN
+ 100.0 0.8000 0.0147 0.7853 NaN 95.1510 NaN
+
diff --git a/inst/doc/KinGUI/F_water_KinGUI.txt b/inst/doc/KinGUI/F_water_KinGUI.txt
new file mode 100644
index 0000000..bd80f86
--- /dev/null
+++ b/inst/doc/KinGUI/F_water_KinGUI.txt
@@ -0,0 +1,14 @@
+Version: 1.1
+Project:
+Testsystem:
+Comment: NA
+t parent
+0 95.6
+3 84.7
+7 74.6
+14 54.1
+28 13.5
+43 4.3
+56 2
+70 0.5
+100 0.8
diff --git a/inst/doc/KinGUI/F_water_SFO_report.txt b/inst/doc/KinGUI/F_water_SFO_report.txt
new file mode 100644
index 0000000..9927133
--- /dev/null
+++ b/inst/doc/KinGUI/F_water_SFO_report.txt
@@ -0,0 +1,60 @@
+Project:
+Testsystem:
+Comment: NA
+
+KinGUI Version: 1.1
+
+Input Data: C:\Documents and Settings\ws_rajo\My Documents\R\kinfit.package\kinfit\inst\doc\KinGUI\F_water_KinGUI.txt
+
+# =================================
+# Results of the kinetic evaluation
+# =================================
+
+# ---------------------------------
+# Initial values
+# ---------------------------------
+ Initial Value Lower Bound Upper Bound
+ Parent_M(0): 100.0000 0.0000 Inf
+ Parent_k: 0.1000 0.0000 Inf
+ Sink_M(0): 0.0000 0.0000 Inf
+
+# ---------------------------------
+# Chi2 error estimation
+# ---------------------------------
+ Parent Sink
+ Chi2Err%: 10.8069 NaN
+ Kinetic Model: sfo sink
+
+# ---------------------------------
+# Parameter estimation
+# ---------------------------------
+
+ Parameter Estimate St.Dev Prob > t
+ Parent_k 0.0551 0.0059 1.7e-005
+ Parent_FFS 1.0000
+ Parent_M(0) 100.5476 4.3549
+ Sink_M(0) 0.0000
+
+# ---------------------------------
+# DT50 and DT90 values
+# ---------------------------------
+ Parent Sink
+ DT50: 12.5846 NaN
+ DT90: 41.8052 NaN
+ Kinetic model: sfo sink
+
+# ---------------------------------
+# Measured vs. predicted values
+# ---------------------------------
+ Time Compartment Parent Compartment Sink
+ measured predicted residual measured predicted residual
+ 0.0 95.6000 100.5476 -4.9476 NaN 0.0000 NaN
+ 3.0 84.7000 85.2335 -0.5335 NaN 15.3141 NaN
+ 7.0 74.6000 68.3799 6.2201 NaN 32.1677 NaN
+ 14.0 54.1000 46.5035 7.5965 NaN 54.0441 NaN
+ 28.0 13.5000 21.5079 -8.0079 NaN 79.0397 NaN
+ 43.0 4.3000 9.4144 -5.1144 NaN 91.1332 NaN
+ 56.0 2.0000 4.6007 -2.6007 NaN 95.9469 NaN
+ 70.0 0.5000 2.1278 -1.6278 NaN 98.4198 NaN
+ 100.0 0.8000 0.4077 0.3923 NaN 100.1399 NaN
+
diff --git a/inst/doc/Rplots.pdf b/inst/doc/Rplots.pdf
new file mode 100644
index 0000000..dc89036
--- /dev/null
+++ b/inst/doc/Rplots.pdf
@@ -0,0 +1,813 @@
+%PDF-1.4
+%âãÏÓ\r
+1 0 obj
+<<
+/CreationDate (D:20100304150954)
+/ModDate (D:20100304150954)
+/Title (R Graphics Output)
+/Producer (R 2.10.1)
+/Creator (R)
+>>
+endobj
+2 0 obj
+<<
+/Type /Catalog
+/Pages 3 0 R
+>>
+endobj
+5 0 obj
+<<
+/Type /Page
+/Parent 3 0 R
+/Contents 6 0 R
+/Resources 4 0 R
+>>
+endobj
+6 0 obj
+<<
+/Length 7 0 R
+>>
+stream
+q
+Q q 59.04 73.44 414.72 371.52 re W n
+0.000 0.000 0.000 RG
+0.75 w
+[] 0 d
+1 J
+1 j
+10.00 M
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 71.44 428.60 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 74.67 318.65 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 81.12 205.47 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 94.03 143.62 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 116.61 123.82 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 161.79 111.28 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 274.73 100.77 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 365.09 100.37 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 455.44 87.03 Tm (l) Tj 0 Tr
+ET
+Q q
+0.000 0.000 0.000 RG
+0.75 w
+[] 0 d
+1 J
+1 j
+10.00 M
+74.40 73.44 m 461.63 73.44 l S
+74.40 73.44 m 74.40 66.24 l S
+138.94 73.44 m 138.94 66.24 l S
+203.48 73.44 m 203.48 66.24 l S
+268.01 73.44 m 268.01 66.24 l S
+332.55 73.44 m 332.55 66.24 l S
+397.09 73.44 m 397.09 66.24 l S
+461.63 73.44 m 461.63 66.24 l S
+BT
+0.000 0.000 0.000 rg
+/F2 1 Tf 16.00 0.00 0.00 16.00 69.95 47.52 Tm (0) Tj
+ET
+BT
+/F2 1 Tf 16.00 0.00 0.00 16.00 130.04 47.52 Tm (20) Tj
+ET
+BT
+/F2 1 Tf 16.00 0.00 0.00 16.00 194.58 47.52 Tm (40) Tj
+ET
+BT
+/F2 1 Tf 16.00 0.00 0.00 16.00 259.12 47.52 Tm (60) Tj
+ET
+BT
+/F2 1 Tf 16.00 0.00 0.00 16.00 323.66 47.52 Tm (80) Tj
+ET
+BT
+/F2 1 Tf 16.00 0.00 0.00 16.00 383.75 47.52 Tm (100) Tj
+ET
+BT
+/F2 1 Tf 16.00 0.00 0.00 16.00 448.28 47.52 Tm (120) Tj
+ET
+59.04 87.20 m 59.04 410.58 l S
+59.04 87.20 m 51.84 87.20 l S
+59.04 168.05 m 51.84 168.05 l S
+59.04 248.89 m 51.84 248.89 l S
+59.04 329.74 m 51.84 329.74 l S
+59.04 410.58 m 51.84 410.58 l S
+BT
+/F2 1 Tf 0.00 16.00 -16.00 0.00 41.76 82.75 Tm (0) Tj
+ET
+BT
+/F2 1 Tf 0.00 16.00 -16.00 0.00 41.76 159.15 Tm (20) Tj
+ET
+BT
+/F2 1 Tf 0.00 16.00 -16.00 0.00 41.76 240.00 Tm (40) Tj
+ET
+BT
+/F2 1 Tf 0.00 16.00 -16.00 0.00 41.76 320.84 Tm (60) Tj
+ET
+BT
+/F2 1 Tf 0.00 16.00 -16.00 0.00 41.76 401.69 Tm (80) Tj
+ET
+59.04 73.44 m
+473.76 73.44 l
+473.76 444.96 l
+59.04 444.96 l
+59.04 73.44 l
+S
+Q q
+BT
+0.000 0.000 0.000 rg
+/F2 1 Tf 16.00 0.00 0.00 16.00 225.30 18.72 Tm [(Time [da) 30 (ys])] TJ
+ET
+BT
+/F2 1 Tf 0.00 16.00 -16.00 0.00 12.96 140.88 Tm [(P) 40 (arent [% of applied r) 10 (adioactivity])] TJ
+ET
+Q q 59.04 73.44 414.72 371.52 re W n
+0.000 0.000 0.000 RG
+0.75 w
+[] 0 d
+1 J
+1 j
+10.00 M
+74.40 420.66 m
+78.24 318.87 l
+82.08 248.15 l
+85.92 199.02 l
+89.76 164.88 l
+93.60 141.17 l
+97.44 124.70 l
+101.28 113.25 l
+105.12 105.30 l
+108.96 99.77 l
+112.80 95.94 l
+116.64 93.27 l
+120.48 91.42 l
+124.32 90.13 l
+128.16 89.24 l
+132.00 88.61 l
+135.84 88.18 l
+139.68 87.88 l
+143.52 87.67 l
+147.36 87.53 l
+151.20 87.43 l
+155.04 87.36 l
+158.88 87.31 l
+162.72 87.28 l
+166.56 87.25 l
+170.40 87.24 l
+174.24 87.23 l
+178.08 87.22 l
+181.92 87.21 l
+185.76 87.21 l
+189.60 87.21 l
+193.44 87.20 l
+197.28 87.20 l
+201.12 87.20 l
+204.96 87.20 l
+208.80 87.20 l
+212.64 87.20 l
+216.48 87.20 l
+220.32 87.20 l
+224.16 87.20 l
+228.00 87.20 l
+231.84 87.20 l
+235.68 87.20 l
+239.52 87.20 l
+243.36 87.20 l
+247.20 87.20 l
+251.04 87.20 l
+254.88 87.20 l
+258.72 87.20 l
+262.56 87.20 l
+266.40 87.20 l
+270.24 87.20 l
+274.08 87.20 l
+277.92 87.20 l
+281.76 87.20 l
+285.60 87.20 l
+289.44 87.20 l
+293.28 87.20 l
+297.12 87.20 l
+300.96 87.20 l
+304.80 87.20 l
+308.64 87.20 l
+312.48 87.20 l
+316.32 87.20 l
+320.16 87.20 l
+324.00 87.20 l
+327.84 87.20 l
+331.68 87.20 l
+335.52 87.20 l
+339.36 87.20 l
+343.20 87.20 l
+347.04 87.20 l
+350.88 87.20 l
+354.72 87.20 l
+358.56 87.20 l
+362.40 87.20 l
+366.24 87.20 l
+370.08 87.20 l
+373.92 87.20 l
+377.76 87.20 l
+381.60 87.20 l
+385.44 87.20 l
+389.28 87.20 l
+393.12 87.20 l
+396.96 87.20 l
+400.80 87.20 l
+404.64 87.20 l
+408.48 87.20 l
+412.32 87.20 l
+416.16 87.20 l
+420.00 87.20 l
+423.84 87.20 l
+427.68 87.20 l
+431.52 87.20 l
+435.36 87.20 l
+439.20 87.20 l
+443.04 87.20 l
+446.88 87.20 l
+450.72 87.20 l
+454.56 87.20 l
+458.40 87.20 l
+S
+1.000 0.000 0.000 RG
+0.75 w
+[ 3.00 5.00] 0 d
+74.40 434.33 m
+78.24 295.95 l
+82.08 235.56 l
+85.92 201.88 l
+89.76 180.47 l
+93.60 165.67 l
+97.44 154.85 l
+101.28 146.60 l
+105.12 140.11 l
+108.96 134.87 l
+112.80 130.56 l
+116.64 126.94 l
+120.48 123.88 l
+124.32 121.24 l
+128.16 118.94 l
+132.00 116.93 l
+135.84 115.16 l
+139.68 113.58 l
+143.52 112.16 l
+147.36 110.89 l
+151.20 109.74 l
+155.04 108.69 l
+158.88 107.73 l
+162.72 106.85 l
+166.56 106.05 l
+170.40 105.30 l
+174.24 104.61 l
+178.08 103.97 l
+181.92 103.37 l
+185.76 102.82 l
+189.60 102.30 l
+193.44 101.81 l
+197.28 101.35 l
+201.12 100.92 l
+204.96 100.52 l
+208.80 100.13 l
+212.64 99.77 l
+216.48 99.43 l
+220.32 99.10 l
+224.16 98.80 l
+228.00 98.50 l
+231.84 98.22 l
+235.68 97.96 l
+239.52 97.70 l
+243.36 97.46 l
+247.20 97.23 l
+251.04 97.01 l
+254.88 96.80 l
+258.72 96.59 l
+262.56 96.40 l
+266.40 96.21 l
+270.24 96.03 l
+274.08 95.86 l
+277.92 95.69 l
+281.76 95.53 l
+285.60 95.37 l
+289.44 95.22 l
+293.28 95.08 l
+297.12 94.94 l
+300.96 94.81 l
+304.80 94.68 l
+308.64 94.55 l
+312.48 94.43 l
+316.32 94.31 l
+320.16 94.20 l
+324.00 94.09 l
+327.84 93.98 l
+331.68 93.87 l
+335.52 93.77 l
+339.36 93.68 l
+343.20 93.58 l
+347.04 93.49 l
+350.88 93.40 l
+354.72 93.31 l
+358.56 93.23 l
+362.40 93.14 l
+366.24 93.06 l
+370.08 92.98 l
+373.92 92.91 l
+377.76 92.83 l
+381.60 92.76 l
+385.44 92.69 l
+389.28 92.62 l
+393.12 92.55 l
+396.96 92.49 l
+400.80 92.42 l
+404.64 92.36 l
+408.48 92.30 l
+412.32 92.24 l
+416.16 92.18 l
+420.00 92.12 l
+423.84 92.07 l
+427.68 92.01 l
+431.52 91.96 l
+435.36 91.91 l
+439.20 91.85 l
+443.04 91.80 l
+446.88 91.76 l
+450.72 91.71 l
+454.56 91.66 l
+458.40 91.61 l
+S
+0.000 0.804 0.000 RG
+0.75 w
+[ 0.00 4.00] 0 d
+74.40 430.81 m
+78.24 306.15 l
+82.08 233.58 l
+85.92 191.17 l
+89.76 166.22 l
+93.60 151.38 l
+97.44 142.41 l
+101.28 136.83 l
+105.12 133.24 l
+108.96 130.79 l
+112.80 129.02 l
+116.64 127.65 l
+120.48 126.51 l
+124.32 125.52 l
+128.16 124.62 l
+132.00 123.77 l
+135.84 122.97 l
+139.68 122.20 l
+143.52 121.46 l
+147.36 120.73 l
+151.20 120.02 l
+155.04 119.33 l
+158.88 118.65 l
+162.72 117.99 l
+166.56 117.34 l
+170.40 116.71 l
+174.24 116.09 l
+178.08 115.48 l
+181.92 114.89 l
+185.76 114.31 l
+189.60 113.74 l
+193.44 113.18 l
+197.28 112.63 l
+201.12 112.10 l
+204.96 111.58 l
+208.80 111.06 l
+212.64 110.56 l
+216.48 110.07 l
+220.32 109.59 l
+224.16 109.12 l
+228.00 108.66 l
+231.84 108.21 l
+235.68 107.77 l
+239.52 107.33 l
+243.36 106.91 l
+247.20 106.50 l
+251.04 106.09 l
+254.88 105.69 l
+258.72 105.31 l
+262.56 104.92 l
+266.40 104.55 l
+270.24 104.19 l
+274.08 103.83 l
+277.92 103.48 l
+281.76 103.14 l
+285.60 102.80 l
+289.44 102.48 l
+293.28 102.15 l
+297.12 101.84 l
+300.96 101.53 l
+304.80 101.23 l
+308.64 100.94 l
+312.48 100.65 l
+316.32 100.37 l
+320.16 100.09 l
+324.00 99.82 l
+327.84 99.55 l
+331.68 99.29 l
+335.52 99.04 l
+339.36 98.79 l
+343.20 98.55 l
+347.04 98.31 l
+350.88 98.07 l
+354.72 97.85 l
+358.56 97.62 l
+362.40 97.40 l
+366.24 97.19 l
+370.08 96.98 l
+373.92 96.77 l
+377.76 96.57 l
+381.60 96.38 l
+385.44 96.18 l
+389.28 95.99 l
+393.12 95.81 l
+396.96 95.63 l
+400.80 95.45 l
+404.64 95.28 l
+408.48 95.11 l
+412.32 94.94 l
+416.16 94.78 l
+420.00 94.62 l
+423.84 94.46 l
+427.68 94.31 l
+431.52 94.16 l
+435.36 94.02 l
+439.20 93.87 l
+443.04 93.73 l
+446.88 93.59 l
+450.72 93.46 l
+454.56 93.33 l
+458.40 93.20 l
+S
+0.000 0.000 1.000 RG
+0.75 w
+[ 0.00 4.00 3.00 4.00] 0 d
+74.40 428.78 m
+78.24 310.78 l
+82.08 233.54 l
+85.92 182.98 l
+89.76 149.89 l
+93.60 140.73 l
+97.44 139.31 l
+101.28 137.92 l
+105.12 136.57 l
+108.96 135.26 l
+112.80 133.98 l
+116.64 132.74 l
+120.48 131.53 l
+124.32 130.35 l
+128.16 129.20 l
+132.00 128.08 l
+135.84 126.99 l
+139.68 125.93 l
+143.52 124.90 l
+147.36 123.90 l
+151.20 122.92 l
+155.04 121.97 l
+158.88 121.05 l
+162.72 120.15 l
+166.56 119.27 l
+170.40 118.42 l
+174.24 117.59 l
+178.08 116.78 l
+181.92 115.99 l
+185.76 115.23 l
+189.60 114.48 l
+193.44 113.75 l
+197.28 113.05 l
+201.12 112.36 l
+204.96 111.69 l
+208.80 111.04 l
+212.64 110.40 l
+216.48 109.79 l
+220.32 109.19 l
+224.16 108.60 l
+228.00 108.03 l
+231.84 107.48 l
+235.68 106.94 l
+239.52 106.41 l
+243.36 105.90 l
+247.20 105.40 l
+251.04 104.92 l
+254.88 104.45 l
+258.72 103.99 l
+262.56 103.54 l
+266.40 103.11 l
+270.24 102.68 l
+274.08 102.27 l
+277.92 101.87 l
+281.76 101.48 l
+285.60 101.10 l
+289.44 100.73 l
+293.28 100.37 l
+297.12 100.02 l
+300.96 99.68 l
+304.80 99.35 l
+308.64 99.02 l
+312.48 98.71 l
+316.32 98.40 l
+320.16 98.11 l
+324.00 97.82 l
+327.84 97.53 l
+331.68 97.26 l
+335.52 96.99 l
+339.36 96.73 l
+343.20 96.48 l
+347.04 96.23 l
+350.88 95.99 l
+354.72 95.76 l
+358.56 95.53 l
+362.40 95.31 l
+366.24 95.09 l
+370.08 94.88 l
+373.92 94.68 l
+377.76 94.48 l
+381.60 94.28 l
+385.44 94.10 l
+389.28 93.91 l
+393.12 93.73 l
+396.96 93.56 l
+400.80 93.39 l
+404.64 93.23 l
+408.48 93.07 l
+412.32 92.91 l
+416.16 92.76 l
+420.00 92.61 l
+423.84 92.47 l
+427.68 92.33 l
+431.52 92.19 l
+435.36 92.06 l
+439.20 91.93 l
+443.04 91.80 l
+446.88 91.68 l
+450.72 91.56 l
+454.56 91.44 l
+458.40 91.33 l
+S
+0.000 0.000 0.000 RG
+0.75 w
+[] 0 d
+280.50 397.58 m 302.10 397.58 l S
+1.000 0.000 0.000 RG
+0.75 w
+[ 3.00 5.00] 0 d
+280.50 383.18 m 302.10 383.18 l S
+0.000 0.804 0.000 RG
+0.75 w
+[ 0.00 4.00] 0 d
+280.50 368.78 m 302.10 368.78 l S
+0.000 0.000 1.000 RG
+0.75 w
+[ 0.00 4.00 3.00 4.00] 0 d
+280.50 354.38 m 302.10 354.38 l S
+0.000 0.000 0.000 RG
+0.75 w
+[] 0 d
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 288.34 409.39 Tm (l) Tj 0 Tr
+ET
+BT
+0.000 0.000 0.000 rg
+/F2 1 Tf 12.00 0.00 0.00 12.00 312.90 407.68 Tm (Compound XY measured) Tj
+ET
+BT
+/F2 1 Tf 12.00 0.00 0.00 12.00 312.90 393.28 Tm (Fitted SFO model) Tj
+ET
+BT
+/F2 1 Tf 12.00 0.00 0.00 12.00 312.90 378.88 Tm (Fitted FOMC model) Tj
+ET
+BT
+/F2 1 Tf 12.00 0.00 0.00 12.00 312.90 364.48 Tm (Fitted DFOP model) Tj
+ET
+BT
+/F2 1 Tf 12.00 0.00 0.00 12.00 312.90 350.08 Tm (Fitted HS model) Tj
+ET
+Q q
+BT
+0.000 0.000 0.000 rg
+/F3 1 Tf 14.00 0.00 0.00 14.00 208.45 469.45 Tm (FOCUS dataset C) Tj
+ET
+Q
+endstream
+endobj
+7 0 obj
+9557
+endobj
+8 0 obj
+<<
+/Type /Page
+/Parent 3 0 R
+/Contents 9 0 R
+/Resources 4 0 R
+>>
+endobj
+9 0 obj
+<<
+/Length 10 0 R
+>>
+stream
+q
+Q q 59.04 73.44 414.72 371.52 re W n
+Q q 59.04 73.44 414.72 371.52 re W n
+0.000 0.000 0.000 RG
+0.75 w
+[] 0 d
+1 J
+1 j
+10.00 M
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 71.44 300.25 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 74.67 209.03 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 81.12 205.82 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 94.03 338.92 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 116.61 399.94 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 161.79 366.81 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 274.73 323.55 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 365.09 321.88 Tm (l) Tj 0 Tr
+ET
+BT
+/F1 1 Tf 1 Tr 7.48 0 0 7.48 455.44 266.65 Tm (l) Tj 0 Tr
+ET
+Q q
+0.000 0.000 0.000 RG
+0.75 w
+[] 0 d
+1 J
+1 j
+10.00 M
+74.40 73.44 m 461.63 73.44 l S
+74.40 73.44 m 74.40 66.24 l S
+138.94 73.44 m 138.94 66.24 l S
+203.48 73.44 m 203.48 66.24 l S
+268.01 73.44 m 268.01 66.24 l S
+332.55 73.44 m 332.55 66.24 l S
+397.09 73.44 m 397.09 66.24 l S
+461.63 73.44 m 461.63 66.24 l S
+BT
+0.000 0.000 0.000 rg
+/F2 1 Tf 16.00 0.00 0.00 16.00 69.95 47.52 Tm (0) Tj
+ET
+BT
+/F2 1 Tf 16.00 0.00 0.00 16.00 130.04 47.52 Tm (20) Tj
+ET
+BT
+/F2 1 Tf 16.00 0.00 0.00 16.00 194.58 47.52 Tm (40) Tj
+ET
+BT
+/F2 1 Tf 16.00 0.00 0.00 16.00 259.12 47.52 Tm (60) Tj
+ET
+BT
+/F2 1 Tf 16.00 0.00 0.00 16.00 323.66 47.52 Tm (80) Tj
+ET
+BT
+/F2 1 Tf 16.00 0.00 0.00 16.00 383.75 47.52 Tm (100) Tj
+ET
+BT
+/F2 1 Tf 16.00 0.00 0.00 16.00 448.28 47.52 Tm (120) Tj
+ET
+59.04 91.83 m 59.04 426.57 l S
+59.04 91.83 m 51.84 91.83 l S
+59.04 175.51 m 51.84 175.51 l S
+59.04 259.20 m 51.84 259.20 l S
+59.04 342.89 m 51.84 342.89 l S
+59.04 426.57 m 51.84 426.57 l S
+BT
+/F2 1 Tf 0.00 16.00 -16.00 0.00 41.76 78.26 Tm (-10) Tj
+ET
+BT
+/F2 1 Tf 0.00 16.00 -16.00 0.00 41.76 166.39 Tm (-5) Tj
+ET
+BT
+/F2 1 Tf 0.00 16.00 -16.00 0.00 41.76 254.75 Tm (0) Tj
+ET
+BT
+/F2 1 Tf 0.00 16.00 -16.00 0.00 41.76 338.44 Tm (5) Tj
+ET
+BT
+/F2 1 Tf 0.00 16.00 -16.00 0.00 41.76 417.68 Tm (10) Tj
+ET
+59.04 73.44 m
+473.76 73.44 l
+473.76 444.96 l
+59.04 444.96 l
+59.04 73.44 l
+S
+Q q
+BT
+0.000 0.000 0.000 rg
+/F2 1 Tf 16.00 0.00 0.00 16.00 225.30 18.72 Tm [(Time [da) 30 (ys])] TJ
+ET
+BT
+/F2 1 Tf 0.00 16.00 -16.00 0.00 12.96 133.01 Tm [(Residual [% of applied r) 10 (adioactivity])] TJ
+ET
+BT
+/F2 1 Tf 14.00 0.00 0.00 14.00 204.16 469.45 Tm (Residuals of SFO fit) Tj
+ET
+Q
+endstream
+endobj
+10 0 obj
+2309
+endobj
+3 0 obj
+<<
+/Type /Pages
+/Kids [
+5 0 R
+8 0 R
+]
+/Count 2
+/MediaBox [0 0 504 504]
+>>
+endobj
+4 0 obj
+<<
+/ProcSet [/PDF /Text]
+/Font << /F1 12 0 R /F2 13 0 R /F3 14 0 R >>
+/ExtGState << >>
+>>
+endobj
+11 0 obj
+<<
+/Type /Encoding
+/BaseEncoding /WinAnsiEncoding
+/Differences [ 45/minus ]
+>>
+endobj
+12 0 obj
+<<
+/Type /Font
+/Subtype /Type1
+/Name /F1
+/BaseFont /ZapfDingbats
+>>
+endobj
+13 0 obj <<
+/Type /Font
+/Subtype /Type1
+/Name /F2
+/BaseFont /Helvetica
+/Encoding 11 0 R
+>> endobj
+14 0 obj <<
+/Type /Font
+/Subtype /Type1
+/Name /F3
+/BaseFont /Helvetica-Bold
+/Encoding 11 0 R
+>> endobj
+xref
+0 15
+0000000000 65535 f
+0000000021 00000 n
+0000000164 00000 n
+0000012387 00000 n
+0000012476 00000 n
+0000000213 00000 n
+0000000293 00000 n
+0000009903 00000 n
+0000009923 00000 n
+0000010003 00000 n
+0000012366 00000 n
+0000012581 00000 n
+0000012676 00000 n
+0000012760 00000 n
+0000012858 00000 n
+trailer
+<<
+/Size 15
+/Info 1 0 R
+/Root 2 0 R
+>>
+startxref
+12961
+%%EOF
diff --git a/inst/doc/header.tex b/inst/doc/header.tex
new file mode 100644
index 0000000..9d6ec49
--- /dev/null
+++ b/inst/doc/header.tex
@@ -0,0 +1,31 @@
+\usepackage{booktabs}
+\usepackage{amsfonts}
+\usepackage{latexsym}
+\usepackage{amsmath}
+\usepackage{amssymb}
+\usepackage{graphicx}
+\usepackage{parskip}
+\usepackage[round]{natbib}
+\usepackage{amstext}
+\usepackage{hyperref}
+\usepackage[latin1]{inputenc}
+
+\newcommand{\Rpackage}[1]{{\normalfont\fontseries{b}\selectfont #1}}
+\newcommand{\Robject}[1]{\texttt{#1}}
+\newcommand{\Rclass}[1]{\textit{#1}}
+\newcommand{\Rcmd}[1]{\texttt{#1}}
+
+\newcommand{\RR}{\textsf{R}}
+
+\RequirePackage[T1]{fontenc}
+\RequirePackage{graphicx,ae,fancyvrb}
+\IfFileExists{upquote.sty}{\RequirePackage{upquote}}{}
+\usepackage{relsize}
+
+\DefineVerbatimEnvironment{Sinput}{Verbatim}{baselinestretch=1.05}
+\DefineVerbatimEnvironment{Soutput}{Verbatim}{fontfamily=courier,
+ baselinestretch=1.05,
+ fontshape=it,
+ fontsize=\relsize{-1}}
+\DefineVerbatimEnvironment{Scode}{Verbatim}{}
+\newenvironment{Schunk}{}{}
diff --git a/inst/doc/kinfit.Rnw b/inst/doc/kinfit.Rnw
new file mode 100644
index 0000000..7a590d5
--- /dev/null
+++ b/inst/doc/kinfit.Rnw
@@ -0,0 +1,933 @@
+%%\VignetteIndexEntry{Routines for fitting kinetic models to chemical degradation data}
+%%VignetteDepends{nls}
+%%\usepackage{Sweave}
+\documentclass[12pt,a4paper]{article}
+\usepackage{a4wide}
+%%\usepackage[lists,heads]{endfloat}
+\input{header}
+\hypersetup{
+ pdftitle = {kinfit - Routines for fitting kinetic models to chemical degradation data},
+ pdfsubject = {Manuscript},
+ pdfauthor = {Johannes Ranke},
+ colorlinks = {true},
+ linkcolor = {blue},
+ citecolor = {blue},
+ urlcolor = {red},
+ hyperindex = {true},
+ linktocpage = {true},
+}
+\SweaveOpts{engine=R, eps=FALSE, keep.source = TRUE}
+<<setup, echo = FALSE, results = hide>>=
+options(prompt = "R> ")
+options(SweaveHooks = list(
+ cex = function() par(cex.lab = 1.3, cex.axis = 1.3)))
+@
+\begin{document}
+\title{kinfit -\\
+Routines for fitting kinetic models to chemical degradation
+data\footnote{This is a preprint of an article published in
+The R Journal, Volume 1, Number ?, ?--?. available online
+\url{http://journal.r-project.org}.}}
+\author{\textbf{Johannes Ranke} \\
+%EndAName
+Product Safety \\
+Harlan Laboratories Ltd. \\
+Zelgliweg 1, CH--4452 Itingen, Switzerland}
+\maketitle
+
+\begin{abstract}
+In the regulatory evaluation of chemical substances like plant protection
+products (pesticides), biocides and other chemicals, degradation data play an
+important role. For the evaluation of pesticide degradation experiments,
+detailed guidance has been developed, based on nonlinear regression.
+The \RR{} add-on package \Rpackage{kinfit} implements fitting the models
+recommended in this guidance from within R and calculates the
+recommended statistical measures for data series within one compartment
+without metabolite data.
+\end{abstract}
+
+
+\thispagestyle{empty} \setcounter{page}{0}
+
+\clearpage
+
+\tableofcontents
+
+\textbf{Key words}: Kinetics, FOCUS, nonlinear fitting
+
+\section{Introduction}
+\label{intro}
+
+Many approaches are possible regarding the evaluation of chemical degradation
+data. The \Rpackage{kinfit} package \citep{pkg:kinfit} in \RR{}
+\citep{rcore2009} implements the approach recommended in the kinetics report
+provided by the FOrum for Co-ordination of pesticide fate models and their
+USe \citep{FOCUS2006} for simple data series for one parent compound in one
+compartment.
+
+\section{Example}
+\label{exam}
+
+In the following, requirements for data formatting are explained. Then the
+procedure for fitting the four kinetic models recommended by the FOCUS group
+to an example dataset given in the FOCUS kinetics report is illustrated.
+The explanations are kept rather verbose in order to lower the barrier for
+\RR{} newcomers.
+
+\subsection{Data format}
+
+The following listing shows example dataset C from the FOCUS kinetics
+report as distributed with the \Rpackage{kinfit} package
+
+<<FOCUS_2006_C_data, echo=TRUE, eval=TRUE>>=
+library("kinfit")
+data("FOCUS_2006_C", package = "kinfit")
+print(FOCUS_2006_C)
+@
+
+Note that the data needs to be in the format of a data frame containing
+a variable \Robject{t} containing sampling times and a variable
+\Robject{parent} containing the measured data. Replicate measurements are
+not recorded in extra columns but simply appended, leading to multiple
+occurrences of the sampling times \Robject{t}.
+
+Small to medium size dataset can be conveniently entered directly as \RR{} code
+as shown in the following listing
+
+<<data_format, echo=TRUE>>=
+kindata_example <- data.frame(
+ t = c(0, 1, 3, 7, 14, 28, 63, 91, 119),
+ parent = c(85.1, 57.9, 29.9, 14.6, 9.7, 6.6, 4, 3.9, 0.6)
+)
+@
+
+
+\subsection{Fitting the kinetic models}
+
+The user can choose for which kinetic models the \Robject{kinfit} function
+will try to find optimised parameters. This is achieved by the argument
+\Robject{kinmodels} to the function, as shown below. The models currently
+implemented are abbreviated \Robject{SFO} (Single First-Order), \Robject{FOMC}
+(First-Order Multi-Compartment), \Robject{DFOP} (Double First-Order in Parallel)
+and \Robject{HS} (Hockey-Stick) as defined by the \cite{FOCUS2006}. From the
+DFOP model, corresponding parameters in the notation of the SFORB model (Single
+First-Order Reversible Binding) are additionally calculated.
+
+<<FOCUS_2006_C_fits, echo=TRUE>>=
+kinfits.C <- kinfit(FOCUS_2006_C, kinmodels = c("SFO", "FOMC", "DFOP", "HS"))
+@
+
+The results of the fitting procedure are returned by the function, and can
+then be inspected by the function \Robject{kinresults}.
+
+<<FOCUS_2006_C_results, echo = TRUE>>=
+kinresults(kinfits.C)
+@
+
+The higher level functions \Robject{kinplot} and \Robject{kinreport}
+work on lists called \Robject{kinobject}. They contain the fitted models,
+optionally the data used for fitting the models, and the name of the parent
+compound as well as the test system type used for generating the data,
+as well as some more optional entries. The construction of such an
+object is shown below.
+
+<<FOCUS_2006_C_object, echo=TRUE>>=
+kinobject.C <- kinobject <- list(
+ parent = "Compound XY",
+ type = "Degradation in the environment",
+ system = "System 1",
+ source = "Synthetic example data from FOCUS kinetics",
+ data = FOCUS_2006_C,
+ fits = kinfits.C,
+ results = kinresults(kinfits.C))
+@
+
+The plotting and reporting functions then work on this object. The example
+below outputs the report to the console, because no \Robject{file} argument
+is specified. If a filename is specified, the report will be written to
+a text file.
+
+<<FOCUS_2006_C_report, echo = TRUE>>=
+kinreport(kinobject.C)
+@
+
+Plotting is done on an on-screen device. Graphics files in vector based
+formats can be obtained using the \RR{} devices \Robject{pdf}, \Robject{eps},
+or, subject to platform restrictions, \Robject{windows.metafile}.
+
+\setkeys{Gin}{width=0.6\textwidth}
+\begin{figure}[t]
+\begin{center}
+<<FOCUS_2006_C_figure, echo = FALSE, fig = TRUE, width = 7, height = 5, cex = TRUE>>=
+kinfits.C <- kinfit(FOCUS_2006_C, kinmodels = c("SFO", "FOMC", "DFOP", "HS"))
+kinplot(kinobject.C)
+title("FOCUS dataset C")
+@
+\caption{Fits of standard models to FOCUS dataset C.}
+\label{fig:FOCUS_2006_C}
+\end{center}
+\end{figure}
+
+A residual plot can be obtained with the function \Robject{kinresplot} as
+shown in Figure \ref{fig:FOCUS_2006_C_res}.
+
+\setkeys{Gin}{width=0.6\textwidth}
+\begin{figure}[t]
+\begin{center}
+<<FOCUS_2006_C_res, echo = FALSE, fig = TRUE, width = 7, height = 5, cex = TRUE>>=
+kinresplot(kinobject.C, "SFO")
+@
+\caption{Residual plot for fitting the SFO model to FOCUS dataset C.}
+\label{fig:FOCUS_2006_C_res}
+\end{center}
+\end{figure}
+
+\section{Validation}
+\label{vali}
+
+In the following comparisons, the results for fitting the four recommended
+kinetic models to FOCUS datasets A to F with \Rpackage{kinfit} were
+obtained.
+
+<<kinfits_A_to_F, echo = FALSE>>=
+datasets <- LETTERS[1:4]
+data(list=paste("FOCUS_2006_", datasets, sep=""), package = "kinfit")
+kinobjects <- list()
+for (dataset in datasets)
+{
+ kinobjects[[dataset]] <- list()
+ kinobjects[[dataset]]$data <- get(paste("FOCUS_2006_", dataset, sep=""))
+ kinobjects[[dataset]]$fits <-
+ kinfit(kinobjects[[dataset]]$data,
+ kinmodels = c("SFO", "FOMC", "DFOP", "HS"))
+ kinobjects[[dataset]]$results <-
+ kinresults(kinobjects[[dataset]]$fits)
+}
+
+data(FOCUS_2006_F, package = "kinfit")
+# Set the initial concentration in the sediment to zero
+FOCUS_2006_F[1, "parent.sediment"] <- 0
+# Calculate total system values for the parent compound
+FOCUS_2006_F = transform(FOCUS_2006_F,
+ parent.system = parent.water + parent.sediment)
+
+subsets <- c("system", "water")
+for (subset in subsets)
+{
+ index <- paste("F", subset, sep=" ")
+ kinobjects[[index]] <- list()
+ kinobjects[[index]]$data <- data.frame(
+ t = FOCUS_2006_F$t,
+ parent = FOCUS_2006_F[[paste("parent", subset, sep=".")]])
+ kinobjects[[index]]$fits <-
+ kinfit(kinobjects[[index]]$data,
+ kinmodels = c("SFO", "FOMC", "DFOP", "HS"))
+ kinobjects[[index]]$results <-
+ kinresults(kinobjects[[index]]$fits)
+}
+@
+
+\subsection{Single First Order Model}
+
+In Tables \ref{tab:vali.SFO.A} to \ref{tab:vali.SFO.F_water},
+the results from fitting the SFO model to FOCUS example datasets with
+various software packages as given in the report by the \cite{FOCUS2006} are
+compared with the results obtained with \Rpackage{kinfit}.
+
+<<SFO, echo = FALSE>>=
+data("FOCUS_2006_SFO_ref_A_to_F", package = "kinfit")
+kinmodel = "SFO"
+refs <- list()
+for (kinobjectname in names(kinobjects))
+{
+ ref <- subset(FOCUS_2006_SFO_ref_A_to_F, dataset == kinobjectname)
+ ref <- ref[-6]
+ texfile <- paste("FOCUS_2006_", kinmodel, "_",
+ gsub(" ", "_", kinobjectname), "_ref.tex", sep="")
+ write.table(format(ref, nsmall=2),
+ file = texfile,
+ sep=" & ", quote=FALSE,
+ row.names=FALSE, col.names=FALSE, eol = " \\\\ \n")
+ refs[[kinobjectname]] <- ref
+}
+@
+
+\begin{table}
+\caption{Results of fitting the SFO model to the example dataset A
+\citep{FOCUS2006}, as given in the report, in comparison to the results
+obtained by \Rpackage{kinfit}. \label{tab:vali.SFO.A}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lcccc}
+\toprule
+Package & $M_0$ & $k$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_SFO_A_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs$A$M0), nsmall=2)} &
+\Sexpr{format(median(refs$A$k), nsmall=4)} &
+\Sexpr{format(median(refs$A$DT50), nsmall=2)} &
+\Sexpr{format(median(refs$A$DT90), nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+\Sexpr{round(kinobjects$A$results$parms$SFO$parent.0, 2)} &
+\Sexpr{round(kinobjects$A$results$parms$SFO$k, 4)} &
+\Sexpr{round(kinobjects$A$results$results[["SFO", "DT50"]], 2)} &
+\Sexpr{round(kinobjects$A$results$results[["SFO", "DT90"]], 2)} \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{table}
+\caption{Results of fitting the SFO model to the example dataset B
+\citep{FOCUS2006}, as given in the report, in comparison to the results
+obtained by \Rpackage{kinfit}. \label{tab:vali.SFO.B}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lcccc}
+\toprule
+Package & $M_0$ & $k$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_SFO_B_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs$B$M0), nsmall=2)} &
+\Sexpr{format(median(refs$B$k), nsmall=4)} &
+\Sexpr{format(median(refs$B$DT50), nsmall=2)} &
+\Sexpr{format(median(refs$B$DT90), nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+\Sexpr{round(kinobjects$B$results$parms$SFO$parent.0, 2)} &
+\Sexpr{round(kinobjects$B$results$parms$SFO$k, 4)} &
+\Sexpr{round(kinobjects$B$results$results[["SFO", "DT50"]], 2)} &
+\Sexpr{round(kinobjects$B$results$results[["SFO", "DT90"]], 2)} \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{table}
+\caption{Results of fitting the SFO model to the example dataset C
+\citep{FOCUS2006}, as given in the report, in comparison to the results
+obtained by \Rpackage{kinfit}. \label{tab:vali.SFO.C}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lcccc}
+\toprule
+Package & $M_0$ & $k$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_SFO_C_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs$C$M0), nsmall=2)} &
+\Sexpr{format(median(refs$C$k), nsmall=4)} &
+\Sexpr{format(median(refs$C$DT50), nsmall=2)} &
+\Sexpr{format(median(refs$C$DT90), nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+\Sexpr{round(kinobjects$C$results$parms$SFO$parent.0, 2)} &
+\Sexpr{round(kinobjects$C$results$parms$SFO$k, 4)} &
+\Sexpr{round(kinobjects$C$results$results[["SFO", "DT50"]], 2)} &
+\Sexpr{round(kinobjects$C$results$results[["SFO", "DT90"]], 2)} \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{table}
+\caption{Results of fitting the SFO model to the example dataset D
+\citep{FOCUS2006}, as given in the report, in comparison to the results
+obtained by \Rpackage{kinfit}. \label{tab:vali.SFO.D}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lcccc}
+\toprule
+Package & $M_0$ & $k$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_SFO_D_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs$D$M0), nsmall=2)} &
+\Sexpr{format(median(refs$D$k), nsmall=4)} &
+\Sexpr{format(median(refs$D$DT50), nsmall=2)} &
+\Sexpr{format(median(refs$D$DT90), nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+\Sexpr{round(kinobjects$D$results$parms$SFO$parent.0, 2)} &
+\Sexpr{round(kinobjects$D$results$parms$SFO$k, 4)} &
+\Sexpr{round(kinobjects$D$results$results[["SFO", "DT50"]], 2)} &
+\Sexpr{round(kinobjects$D$results$results[["SFO", "DT90"]], 2)} \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{table}
+\caption{Results of fitting the SFO model to the total system data from
+example dataset F \citep{FOCUS2006}, as given in the report, in comparison to
+the results obtained by \Rpackage{kinfit}. \label{tab:vali.SFO.F_system}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lcccc}
+\toprule
+Package & $M_0$ & $k$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_SFO_F_system_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs[["F system"]]$M0), nsmall=2)} &
+\Sexpr{format(median(refs[["F system"]]$k), nsmall=4)} &
+\Sexpr{format(median(refs[["F system"]]$DT50), nsmall=2)} &
+\Sexpr{format(median(refs[["F system"]]$DT90), nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+\Sexpr{round(kinobjects[["F system"]]$results$parms$SFO$parent.0, 2)} &
+\Sexpr{round(kinobjects[["F system"]]$results$parms$SFO$k, 4)} &
+\Sexpr{round(kinobjects[["F system"]]$results$results[["SFO", "DT50"]], 2)} &
+\Sexpr{round(kinobjects[["F system"]]$results$results[["SFO", "DT90"]], 2)} \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{table}
+\caption{Results of fitting the SFO model to the water phase data from
+example dataset F \citep{FOCUS2006}, as given in the report, in comparison to
+the results obtained by \Rpackage{kinfit}. \label{tab:vali.SFO.F_water}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lcccc}
+\toprule
+Package & $M_0$ & $k$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_SFO_F_water_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs[["F water"]]$M0), nsmall=2)} &
+\Sexpr{format(median(refs[["F water"]]$k), nsmall=4)} &
+\Sexpr{format(median(refs[["F water"]]$DT50), nsmall=2)} &
+\Sexpr{format(median(refs[["F water"]]$DT90), nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+\Sexpr{round(kinobjects[["F water"]]$results$parms$SFO$parent.0, 2)} &
+\Sexpr{round(kinobjects[["F water"]]$results$parms$SFO$k, 4)} &
+\Sexpr{round(kinobjects[["F water"]]$results$results[["SFO", "DT50"]], 2)} &
+\Sexpr{format(kinobjects[["F water"]]$results$results[["SFO", "DT90"]], digits=4, nsmall=2)} \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+The comparisons show that all packages evaluated in the FOCUS report give
+very similar results for the SFO model. The results obtained with
+\Rpackage{kinfit} are very close to the median of the results reported for
+the other packages.
+
+\subsection{First Order Multi Compartment Model}
+
+<<FOMC, echo = FALSE>>=
+data("FOCUS_2006_FOMC_ref_A_to_F", package = "kinfit")
+kinmodel = "FOMC"
+refs <- list()
+for (kinobjectname in names(kinobjects)[c(1:3, 5:6)])
+{
+ ref <- subset(FOCUS_2006_FOMC_ref_A_to_F, dataset == kinobjectname)
+ ref$package <- gsub("#", "$^a$", ref$package)
+ ref <- ref[-7]
+ texfile <- paste("FOCUS_2006_", kinmodel, "_",
+ gsub(" ", "_", kinobjectname), "_ref.tex", sep="")
+ write.table(format(ref, nsmall=2),
+ file = texfile,
+ sep=" & ", quote=FALSE,
+ row.names=FALSE, col.names=FALSE, eol = " \\\\ \n")
+ refs[[kinobjectname]] <- ref
+}
+@
+
+\begin{table}
+\caption{Results of fitting the FOMC model to the example dataset A
+\citep{FOCUS2006}, as given in the report, in comparison to the results
+obtained by \Rpackage{kinfit}. \label{tab:vali.FOMC.A}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lccccc}
+\toprule
+Package & $M_0$ & $\alpha$ & $\beta$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_FOMC_A_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs$A$M0), nsmall=2)} &
+\Sexpr{format(median(refs$A$alpha), scientific=TRUE)} &
+\Sexpr{format(median(as.numeric(refs$A$beta)), nsmall=0)} &
+\Sexpr{format(median(refs$A$DT50), nsmall=2)} &
+\Sexpr{format(median(refs$A$DT90), nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+no fit \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{table}
+\caption{Results of fitting the FOMC model to the example dataset B
+\citep{FOCUS2006}, as given in the report, in comparison to the results
+obtained by \Rpackage{kinfit}. \label{tab:vali.FOMC.B}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lccccc}
+\toprule
+Package & $M_0$ & $\alpha$ & $\beta$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_FOMC_B_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs$B$M0), digits=4, nsmall=2)} &
+\Sexpr{format(median(refs$B$alpha), scientific=TRUE)} &
+\Sexpr{format(median(as.numeric(refs$B$beta)), nsmall=0)} &
+\Sexpr{format(median(refs$B$DT50), nsmall=2)} &
+\Sexpr{format(median(refs$B$DT90), digits=4, nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+\Sexpr{round(kinobjects$B$results$parms$FOMC$parent.0, 2)} &
+\Sexpr{round(kinobjects$B$results$parms$FOMC$alpha, 4)} &
+\Sexpr{round(kinobjects$B$results$parms$FOMC$beta, 4)} &
+\Sexpr{round(kinobjects$B$results$results[["FOMC", "DT50"]], 2)} &
+\Sexpr{format(kinobjects$B$results$results[["FOMC", "DT90"]], digits=4, nsmall=2)} \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+
+\begin{table}
+\caption{Results of fitting the FOMC model to the example dataset C
+\citep{FOCUS2006}, as given in the report, in comparison to the results
+obtained by \Rpackage{kinfit}. \label{tab:vali.FOMC.C}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lccccc}
+\toprule
+Package & $M_0$ & $\alpha$ & $\beta$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_FOMC_C_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs$C$M0), nsmall=2)} &
+\Sexpr{format(median(refs$C$alpha), nsmall=2)} &
+\Sexpr{format(median(as.numeric(refs$C$beta)), nsmall=2)} &
+\Sexpr{format(median(refs$C$DT50), nsmall=2)} &
+\Sexpr{format(median(refs$C$DT90), nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+\Sexpr{round(kinobjects$C$results$parms$FOMC$parent.0, 2)} &
+\Sexpr{round(kinobjects$C$results$parms$FOMC$alpha, 4)} &
+\Sexpr{round(kinobjects$C$results$parms$FOMC$beta, 4)} &
+\Sexpr{round(kinobjects$C$results$results[["FOMC", "DT50"]], 2)} &
+\Sexpr{format(kinobjects$C$results$results[["FOMC", "DT90"]], digits=4, nsmall=2)} \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{table}
+\caption{Results of fitting the FOMC model to the total system data from
+example dataset F \citep{FOCUS2006}, as given in the report, in comparison to
+the results obtained by \Rpackage{kinfit}. \label{tab:vali.FOMC.F_system}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lccccc}
+\toprule
+Package & $M_0$ & $\alpha$ & $\beta$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_FOMC_F_system_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs[["F system"]]$M0), nsmall=2)} &
+\Sexpr{format(median(refs[["F system"]]$alpha), nsmall=4)} &
+\Sexpr{format(median(refs[["F system"]]$beta), nsmall=4)} &
+\Sexpr{format(median(refs[["F system"]]$DT50), nsmall=2)} &
+\Sexpr{format(median(refs[["F system"]]$DT90), nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+no fit \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{table}
+\caption{Results of fitting the FOMC model to the water phase data from
+example dataset F \citep{FOCUS2006}, as given in the report, in comparison to
+the results obtained by \Rpackage{kinfit}. \label{tab:vali.FOMC.F_water}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lccccc}
+\toprule
+Package & $M_0$ & $\alpha$ & $\beta$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_FOMC_F_water_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs[["F water"]]$M0), nsmall=2)} &
+\Sexpr{format(median(refs[["F water"]]$alpha), nsmall=4)} &
+\Sexpr{format(median(refs[["F water"]]$beta), nsmall=4)} &
+\Sexpr{format(median(refs[["F water"]]$DT50), nsmall=2)} &
+\Sexpr{format(median(refs[["F water"]]$DT90), nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+no fit \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+The comparison of the results obtained for the FOMC model show much more
+variability between software packages. For dataset A, results for the
+\Robject{alpha} and \Robject{beta} parameters differ over several
+orders of magnitude between the different packages. The method used
+by the \Robject{kinfit} routine does not converge for this dataset.
+The same applies to the total system and water phase only data for
+example dataset F and the FOMC model.
+
+For datasets B and C, the \Rpackage{kinfit} function produces results
+which are very close to the median of the results obtained by the
+other packages.
+
+\subsection{Dual First Order in Parallel Model}
+
+<<DFOP, echo = FALSE>>=
+data("FOCUS_2006_DFOP_ref_A_to_B", package = "kinfit")
+kinmodel = "DFOP"
+refs <- list()
+for (kinobjectname in names(kinobjects)[1:2])
+{
+ ref <- subset(FOCUS_2006_DFOP_ref_A_to_B, dataset == kinobjectname)
+ ref <- ref[-8]
+ texfile <- paste("FOCUS_2006_", kinmodel, "_",
+ gsub(" ", "_", kinobjectname), "_ref.tex", sep="")
+ write.table(format(ref, nsmall=2),
+ file = texfile,
+ sep=" & ", quote=FALSE,
+ row.names=FALSE, col.names=FALSE, eol = " \\\\ \n")
+ refs[[kinobjectname]] <- ref
+}
+@
+
+\begin{table}
+\caption{Results of fitting the DFOP model to the example dataset A
+\citep{FOCUS2006}, as given in the report, in comparison to the results
+obtained by \Rpackage{kinfit}. \label{tab:vali.DFOP.A}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lcccccc}
+\toprule
+Package & $M_0$ & $f$ & $k_1$ & $k_2$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_DFOP_A_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs$A$M0), nsmall=2)} &
+\Sexpr{format(median(refs$A$f), nsmall=2)} &
+\Sexpr{format(median(refs$A$k1), nsmall=4)} &
+\Sexpr{format(median(refs$A$k2), nsmall=4)} &
+\Sexpr{format(median(refs$A$DT50), nsmall=2)} &
+\Sexpr{format(median(refs$A$DT90), nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+no fit \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{table}
+\caption{Results of fitting the DFOP model to the example dataset B
+\citep{FOCUS2006}, as given in the report, in comparison to the results
+obtained by \Rpackage{kinfit}. \label{tab:vali.DFOP.B}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lcccccc}
+\toprule
+Package & $M_0$ & $f$ & $k_1$ & $k_2$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_DFOP_B_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs$B$M0), nsmall=2)} &
+\Sexpr{format(median(refs$B$f), nsmall=2)} &
+\Sexpr{format(median(refs$B$k1), nsmall=4)} &
+\Sexpr{format(median(refs$B$k2), nsmall=4)} &
+\Sexpr{format(median(refs$B$DT50), nsmall=2)} &
+\Sexpr{format(median(refs$B$DT90), digits=4, nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+\Sexpr{round(kinobjects$B$results$parms$DFOP$parent.0, 2)} &
+\Sexpr{round(kinobjects$B$results$parms$DFOP$g, 2)} &
+\Sexpr{round(kinobjects$B$results$parms$DFOP$k1, 4)} &
+\Sexpr{round(kinobjects$B$results$parms$DFOP$k2, 4)} &
+\Sexpr{round(kinobjects$B$results$results[["DFOP", "DT50"]], 2)} &
+\Sexpr{format(kinobjects$B$results$results[["DFOP", "DT90"]], digits=4, nsmall=2)} \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+Regarding fitting the DFOP model to FOCUS example dataset A, it is already
+indicated in the report that it is not a good example dataset for fitting
+this particular model, as the two kinetic constants postulated by the DFOP
+model are hardly distinguishable. As a consequence, the software packages
+strongly disagree especially on the model parameter $f$ specifying the
+distribution between the kinetic domains that are characterised by the
+two kinetic constants. Again, the \Rpackage{kinfit} routine does not
+show conversion for this model and this dataset (Table \ref{tab:vali.DFOP.A}).
+
+Fitting the DFOP model with \Rpackage{kinfit} to dataset B yields results
+that are very close to the median of the results obtained by other packages,
+as illustrated in Table \ref{tab:vali.DFOP.B}.
+
+\subsection{Hockey Stick Model}
+
+Analysis of dataset A shows basically two different parameter sets
+generated by the 8 packages reported in the FOCUS report \citep{FOCUS2006}.
+The \Rpackage{kinfit} package does not show conversion with the standard
+paramater defaults, but can reproduce the two parameter sets when given
+the respective paramter values as starting values, as shown in the last
+two lines in Table \ref{tab:vali.HS.A}.
+
+<<HS, echo = FALSE>>=
+data("FOCUS_2006_HS_ref_A_to_F", package = "kinfit")
+kinmodel = "HS"
+refs <- list()
+for (kinobjectname in names(kinobjects)[c(1:3, 5:6)])
+{
+ ref <- subset(FOCUS_2006_HS_ref_A_to_F, dataset == kinobjectname)
+ ref$package <- gsub("\\*", "$^a$", ref$package)
+ ref <- ref[-8]
+ texfile <- paste("FOCUS_2006_", kinmodel, "_",
+ gsub(" ", "_", kinobjectname), "_ref.tex", sep="")
+ write.table(format(ref, nsmall=2),
+ file = texfile,
+ sep=" & ", quote=FALSE,
+ row.names=FALSE, col.names=FALSE, eol = " \\\\ \n")
+ refs[[kinobjectname]] <- ref
+}
+@
+
+<<HS2, echo = FALSE>>=
+kinobjects$A$fits.2 <- kinfit(kinobjects$A$data,
+ kinmodels = c("HS"),
+ start.HS = list(parent.0 = 100, tb = 5, k1 = 0.017, k2 = 0.05))
+kinobjects$A$results.2 <- kinresults(kinobjects$A$fits.2)
+
+kinobjects$A$fits.3 <- kinfit(kinobjects$A$data,
+ kinmodels = c("HS"),
+ start.HS = list(parent.0 = 100, tb = 11, k1 = 0.017, k2 = 0.05))
+kinobjects$A$results.3 <- kinresults(kinobjects$A$fits.3)
+@
+
+\begin{table}
+\caption{Results of fitting the HS model to the example dataset A
+\citep{FOCUS2006}, as given in the report, in comparison to the results
+obtained by \Rpackage{kinfit}. \label{tab:vali.HS.A}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lcccccc}
+\toprule
+Package & $M_0$ & $t_b$ & $k_1$ & $k_2$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_HS_A_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs$A$M0), nsmall=2)} &
+\Sexpr{format(median(refs$A$tb), nsmall=2)} &
+\Sexpr{format(median(refs$A$k1), nsmall=4)} &
+\Sexpr{format(median(refs$A$k2), nsmall=4)} &
+\Sexpr{format(median(refs$A$DT50), nsmall=2)} &
+\Sexpr{format(median(refs$A$DT90), digits=4, nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} & no fit \\
+\Rpackage{kinfit} &
+\Sexpr{round(kinobjects$A$results.2$parms$HS$parent.0, 2)} &
+\Sexpr{round(kinobjects$A$results.2$parms$HS$tb, 2)} &
+\Sexpr{round(kinobjects$A$results.2$parms$HS$k1, 4)} &
+\Sexpr{round(kinobjects$A$results.2$parms$HS$k2, 4)} &
+\Sexpr{round(kinobjects$A$results.2$results[["HS", "DT50"]], 2)} &
+\Sexpr{format(kinobjects$A$results.2$results[["HS", "DT90"]], digits=4, nsmall=2)} \\
+\Rpackage{kinfit} &
+\Sexpr{round(kinobjects$A$results.3$parms$HS$parent.0, 2)} &
+\Sexpr{round(kinobjects$A$results.3$parms$HS$tb, 2)} &
+\Sexpr{round(kinobjects$A$results.3$parms$HS$k1, 4)} &
+\Sexpr{round(kinobjects$A$results.3$parms$HS$k2, 4)} &
+\Sexpr{round(kinobjects$A$results.3$results[["HS", "DT50"]], 2)} &
+\Sexpr{format(kinobjects$A$results.3$results[["HS", "DT90"]], digits=4, nsmall=2)} \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{table}
+\caption{Results of fitting the HS model to the example dataset B
+\citep{FOCUS2006}, as given in the report, in comparison to the results
+obtained by \Rpackage{kinfit}. \label{tab:vali.HS.B}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lcccccc}
+\toprule
+Package & $M_0$ & $t_b$ & $k_1$ & $k_2$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_HS_B_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs$B$M0), nsmall=2)} &
+\Sexpr{format(median(refs$B$tb), nsmall=2)} &
+\Sexpr{format(median(refs$B$k1), nsmall=4)} &
+\Sexpr{format(median(refs$B$k2), nsmall=4)} &
+\Sexpr{format(median(refs$B$DT50), nsmall=2)} &
+\Sexpr{format(median(refs$B$DT90), digits=4, nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} & no fit \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{table}
+\caption{Results of fitting the HS model to the example dataset C
+\citep{FOCUS2006}, as given in the report, in comparison to the results
+obtained by \Rpackage{kinfit}. \label{tab:vali.HS.C}}
+\begin{center}
+\vspace{0.5cm}
+\begin{tabular}{lcccccc}
+\toprule
+Package & $M_0$ & $t_b$ & $k_1$ & $k_2$ & DT$_{50}$ & DT$_{90}$ \\
+\midrule
+\input{FOCUS_2006_HS_C_ref}
+\midrule
+Median &
+\Sexpr{format(median(refs$C$M0), nsmall=2)} &
+\Sexpr{format(median(refs$C$tb), nsmall=2)} &
+\Sexpr{format(median(refs$C$k1), nsmall=4)} &
+\Sexpr{format(median(as.numeric(refs$C$k2)), nsmall=4)} &
+\Sexpr{format(median(refs$C$DT50), nsmall=2)} &
+\Sexpr{format(median(refs$C$DT90), digits=4, nsmall=2)} \\
+\midrule
+\Rpackage{kinfit} &
+\Sexpr{round(kinobjects$C$results$parms$HS$parent.0, 2)} &
+\Sexpr{round(kinobjects$C$results$parms$HS$tb, 2)} &
+\Sexpr{round(kinobjects$C$results$parms$HS$k1, 4)} &
+\Sexpr{round(kinobjects$C$results$parms$HS$k2, 4)} &
+\Sexpr{round(kinobjects$C$results$results[["HS", "DT50"]], 2)} &
+\Sexpr{format(kinobjects$C$results$results[["HS", "DT90"]], digits=4, nsmall=2)} \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+The HS fit did not converge for dataset B with \Rpackage{kinfit}. Again, this
+should be viewed in the light of the vastly differing results produced by
+the other software packages as listed in Table \ref{tab:vali.HS.B}.
+
+The results from fitting the HS model to dataset C with \Rpackage{kinfit}
+agree nicely with the median of the results obtained with the other packages,
+as shown in Table \ref{tab:vali.HS.C}.
+
+\subsection{$\chi^2$ statistics}
+
+As no values for the minimum error rate that has to be assumed for the
+model to agree with the data ($\chi^2$ statistics) are reported for
+the FOCUS datasets A to F, the respective values calculated by
+\Rpackage{kinfit} are compared to the $\chi^2$ values calculated by
+the KinGUI package \citep{schaefer2007} as shown in Table
+\ref{tab:vali.chi2}.
+
+For this, the possibility to write KinGUI input files using the function
+\Robject{kinwrite.KinGUI} from \Rpackage{kinfit} was used.
+
+<<KinGUI_write, echo=FALSE>>=
+chi2.SFO.kinfit <- chi2.FOMC.kinfit <- array(dim = length(kinobjects),
+ dimnames = list(names(kinobjects)))
+chi2.DFOP.kinfit <- chi2.HS.kinfit <- array(dim = length(kinobjects),
+ dimnames = list(names(kinobjects)))
+for (kinobjectname in names(kinobjects))
+{
+ outname <- paste("KinGUI/", gsub(" ", "_", kinobjectname), "_KinGUI.txt",
+ sep="")
+ kinwrite.KinGUI(kinobjects[[kinobjectname]], outname)
+ chi2.SFO.kinfit[[kinobjectname]] <-
+ kinobjects[[kinobjectname]]$results$stats[["SFO", "err.min"]]
+ chi2.FOMC.kinfit[[kinobjectname]] <-
+ ifelse(class(kinobjects[[kinobjectname]]$fits$FOMC) == "try-error",
+ NA, kinobjects[[kinobjectname]]$results$stats[["FOMC", "err.min"]])
+ chi2.DFOP.kinfit[[kinobjectname]] <-
+ ifelse(class(kinobjects[[kinobjectname]]$fits$DFOP) == "try-error",
+ NA, kinobjects[[kinobjectname]]$results$stats[["DFOP", "err.min"]])
+ chi2.HS.kinfit[[kinobjectname]] <-
+ ifelse(class(kinobjects[[kinobjectname]]$fits$HS) == "try-error",
+ NA, kinobjects[[kinobjectname]]$results$stats[["HS", "err.min"]])
+}
+
+chi2.SFO.KinGUI <- c(8.3852, 4.4562, 15.8456, 6.4539, 12.5386, 10.8069)
+chi2.FOMC.KinGUI <- c(9.3116, 4.6641, 6.6574, 6.8080, 13.4533, 11.6682)
+chi2.DFOP.KinGUI <- c(9.6600, 4.9562, 2.6613, 7.2751, 14.1524, 12.1821)
+chi2.HS.KinGUI <- c(4.1106, 4.4535, 4.6963, 5.8196, 3.2178, 1.6558)
+names(chi2.SFO.KinGUI) <- names(chi2.FOMC.KinGUI) <- names(kinobjects)
+names(chi2.DFOP.KinGUI) <- names(chi2.HS.KinGUI) <- names(kinobjects)
+
+chi2 <- data.frame(
+ SFO.KinGUI = chi2.SFO.KinGUI,
+ SFO.kinfit = round(100 * chi2.SFO.kinfit, 4),
+ FOMC.KinGUI = chi2.FOMC.KinGUI,
+ FOMC.kinfit = round(100 * chi2.FOMC.kinfit, 4),
+ DFOP.KinGUI = chi2.DFOP.KinGUI,
+ DFOP.kinfit = round(100 * chi2.DFOP.kinfit, 4),
+ HS.KinGUI = chi2.HS.KinGUI,
+ HS.kinfit = round(100 * chi2.HS.kinfit, 4)
+)
+write.table(chi2,
+ file = "chi2_comparison.tex",
+ sep=" & ", quote=FALSE, na="",
+ row.names=TRUE, col.names=FALSE, eol = " \\\\ \n")
+@
+
+\begin{table}
+\caption{Comparison of $\chi^2$ error levels in percent calculated for model
+fits by the KinGUI and \Rpackage{kinfit} packages. \label{tab:vali.chi2}}
+\vspace{0.5cm}
+\begin{tabular}{lcccccccc}
+\toprule
+ & \multicolumn{2}{c}{SFO} &
+\multicolumn{2}{c}{FOMC} &
+\multicolumn{2}{c}{DFOP} &
+\multicolumn{2}{c}{HS} \\
+Dataset & KinGUI & \Rpackage{kinfit} & KinGUI & \Rpackage{kinfit} &
+KinGUI & \Rpackage{kinfit} & KinGUI & \Rpackage{kinfit} \\
+\midrule
+\input{chi2_comparison}
+\bottomrule
+\end{tabular}
+\end{table}
+
+The comparison shows that whenever a minimum error level $\chi^2$ was
+calculated using the \Rpackage{kinfit} package, it was very close to
+the value generated by KinGUI.
+
+\section{Conclusion}
+
+The \Rpackage{kinfit} package for \RR{} gives access to the possibility to
+fit the kinetic models recommended by the FOCUS group \citep{FOCUS2006}
+from within \RR. Comparison with the results obtained with other
+software packages shows that \Rpackage{kinfit} produces kinetic endpoints that
+are within the variability and even very close to the median of results obtained
+with other packages, except for some cases where \Rpackage{kinfit} does not
+produce results and the results obtained with other software packages are
+strongly divergent.
+
+\bibliographystyle{plainnat}
+\bibliography{references}
+
+\end{document}
+% vim: set foldmethod=marker:
diff --git a/inst/doc/kinfit.pdf b/inst/doc/kinfit.pdf
new file mode 100644
index 0000000..e54106c
--- /dev/null
+++ b/inst/doc/kinfit.pdf
Binary files differ
diff --git a/inst/doc/references.bib b/inst/doc/references.bib
new file mode 100644
index 0000000..53e3bea
--- /dev/null
+++ b/inst/doc/references.bib
@@ -0,0 +1,38 @@
+@Manual{pkg:kinfit,
+ title = {kinfit: {R}outines for fitting kinetic models to chemical degradation data},
+ author = {kinfit},
+ year = {2009},
+ note = {R package version 1.0-0},
+ url = {http://CRAN.R-project.org}
+}
+
+@Manual{ rcore2009,
+ title = {\textsf{R}: A Language and Environment for Statistical
+ Computing},
+ author = {{R Development Core Team}},
+ organization = {R Foundation for Statistical Computing},
+ address = {Vienna, Austria},
+ year = 2009,
+ note = {{ISBN} 3-900051-07-0},
+ url = {http://www.R-project.org}
+}
+
+@Manual{ FOCUS2006,
+ title = {Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration. Report of the FOCUS Work Group on Degradation Kinetics},
+ note = {EC Document Reference Sanco/10058/2005 version 2.0},
+ author = {{FOCUS Work Group on Degradation Kinetics}},
+ year = {2006},
+ url = {http://focus.jrc.ec.europa.eu/dk}
+}
+
+@Inproceedings{ schaefer2007,
+ title = {{KinGUI}: a new kinetic software tool for evaluations according to FOCUS degradation kinetics},
+ author = {D. Sch\"{a}fer and M. Kikolasch and P. Rainbird and B. Harvey},
+ booktitle = {Proceedings of the XIII Symposium Pesticide Chemistry},
+ editor = {Del Re A. A. M. and Capri E. and Fragoulis G. and Trevisan M.},
+ year = {2007},
+ address = {Piacenza},
+ pages = {916--923}
+}
diff --git a/inst/doc/run.bat b/inst/doc/run.bat
new file mode 100644
index 0000000..530c31e
--- /dev/null
+++ b/inst/doc/run.bat
@@ -0,0 +1,5 @@
+R.exe -e "Sweave('kinfit.Rnw', stylepath=FALSE)"
+pdflatex.exe kinfit
+bibtex.exe kinfit
+pdflatex.exe kinfit
+pdflatex.exe kinfit
diff --git a/man/DFOP.Rd b/man/DFOP.Rd
new file mode 100644
index 0000000..129b3b1
--- /dev/null
+++ b/man/DFOP.Rd
@@ -0,0 +1,37 @@
+\name{DFOP}
+\Rdversion{1.1}
+\alias{DFOP}
+\title{
+Dual First-Order in Parallel kinetics
+}
+\description{
+ Function describing decline from a defined starting value using the sum
+ of two exponential decline functions.
+}
+\usage{
+DFOP(t, parent.0, k1, k2, g)
+}
+\arguments{
+ \item{t}{ Time. }
+ \item{parent.0}{ Starting value for the response variable at time zero. }
+ \item{k1}{ First kinetic constant. }
+ \item{k2}{ Second kinetic constant. }
+ \item{g}{ Fraction of the starting value declining according to the
+ first kinetic constant.
+ }
+}
+\value{
+ The value of the response variable at time \code{t}.
+}
+\references{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\author{ Johannes Ranke }
+\examples{
+ \dontrun{plot(function(x) DFOP(x, 100, 5, 0.5, 0.3), 0, 4, ylim=c(0,100))}
+}
+\keyword{ manip }
diff --git a/man/FOCUS_2006_A.Rd b/man/FOCUS_2006_A.Rd
new file mode 100644
index 0000000..218004e
--- /dev/null
+++ b/man/FOCUS_2006_A.Rd
@@ -0,0 +1,29 @@
+\name{FOCUS_2006_A}
+\Rdversion{1.1}
+\alias{FOCUS_2006_A}
+\docType{data}
+\title{
+Dataset A from the FOCUS Kinetics report from 2006
+}
+\description{
+Data generated using a model and assuming some variability.
+}
+\usage{data(FOCUS_2006_A)}
+\format{
+ A data frame with 8 observations on the following 2 variables.
+ \describe{
+ \item{\code{t}}{a numeric vector containing time points}
+ \item{\code{parent}}{a numeric vector containing parent concentrations in percent of applied radioactivity}
+ }
+}
+\source{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\examples{
+data(FOCUS_2006_A)
+}
+\keyword{datasets}
diff --git a/man/FOCUS_2006_B.Rd b/man/FOCUS_2006_B.Rd
new file mode 100644
index 0000000..112056a
--- /dev/null
+++ b/man/FOCUS_2006_B.Rd
@@ -0,0 +1,29 @@
+\name{FOCUS_2006_B}
+\Rdversion{1.1}
+\alias{FOCUS_2006_B}
+\docType{data}
+\title{
+Dataset B from the FOCUS Kinetics report from 2006
+}
+\description{
+Data generated using a model and assuming some variability.
+}
+\usage{data(FOCUS_2006_B)}
+\format{
+ A data frame with 8 observations on the following 2 variables.
+ \describe{
+ \item{\code{t}}{a numeric vector containing time points}
+ \item{\code{parent}}{a numeric vector containing parent concentrations in percent of applied radioactivity}
+ }
+}
+\source{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\examples{
+data(FOCUS_2006_B)
+}
+\keyword{datasets}
diff --git a/man/FOCUS_2006_C.Rd b/man/FOCUS_2006_C.Rd
new file mode 100644
index 0000000..a20bc82
--- /dev/null
+++ b/man/FOCUS_2006_C.Rd
@@ -0,0 +1,30 @@
+\name{FOCUS_2006_C}
+\Rdversion{1.1}
+\alias{FOCUS_2006_C}
+\docType{data}
+\title{
+Dataset C from the FOCUS Kinetics report from 2006
+}
+\description{
+Data taken from an \dQuote{existing dataset}.
+}
+\usage{data(FOCUS_2006_C)}
+\format{
+ A data frame with 9 observations on the following 2 variables.
+ \describe{
+ \item{\code{t}}{a numeric vector containing time points}
+ \item{\code{parent}}{a numeric vector containing parent concentrations in percent of applied radioactivity}
+ }
+}
+\source{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\note{ This dataset is just a subset of \code{\link{FOCUS_2006_E}}. }
+\examples{
+data(FOCUS_2006_C)
+}
+\keyword{datasets}
diff --git a/man/FOCUS_2006_D.Rd b/man/FOCUS_2006_D.Rd
new file mode 100644
index 0000000..c548f8d
--- /dev/null
+++ b/man/FOCUS_2006_D.Rd
@@ -0,0 +1,33 @@
+\name{FOCUS_2006_D}
+\Rdversion{1.1}
+\alias{FOCUS_2006_D}
+\docType{data}
+\title{
+Dataset D from the FOCUS Kinetics report from 2006
+}
+\description{
+Data taken from an \dQuote{existing dataset}. At each time point two data
+points were generated, as the experiment was performed in duplicate.
+}
+\usage{data(FOCUS_2006_D)}
+\format{
+ A data frame with 10 observations on the following 2 variables.
+ \describe{
+ \item{\code{t}}{a numeric vector containing time points}
+ \item{\code{parent}}{a numeric vector containing parent concentrations
+ in percent of applied radioactivity}
+ \item{\code{m1}}{a numeric vector containing concentrations of metabolite 1
+ in percent of applied radioactivity}
+ }
+}
+\source{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\examples{
+data(FOCUS_2006_D)
+}
+\keyword{datasets}
diff --git a/man/FOCUS_2006_DFOP_ref_A_to_B.Rd b/man/FOCUS_2006_DFOP_ref_A_to_B.Rd
new file mode 100644
index 0000000..b0b01d7
--- /dev/null
+++ b/man/FOCUS_2006_DFOP_ref_A_to_B.Rd
@@ -0,0 +1,43 @@
+\name{FOCUS_2006_DFOP_ref_A_to_B}
+\Rdversion{1.1}
+\alias{FOCUS_2006_DFOP_ref_A_to_B}
+\docType{data}
+\title{
+Results of fitting the DFOP model to Datasets A to B of FOCUS (2006)
+}
+\description{
+A table with the fitted parameters and the resulting DT50 and DT90 values
+generated with different software packages. Taken directly from FOCUS (2006).
+The results from fitting the data with the Topfit software was removed, as
+the initial concentration of the parent compound was fixed to a value of 100
+in this fit.
+}
+\usage{data(FOCUS_2006_DFOP_ref_A_to_B)}
+\format{
+ A data frame containing the following variables.
+ \describe{
+ \item{\code{package}}{a factor giving the name of the software package}
+ \item{\code{M0}}{The fitted initial concentration of the parent compound}
+ \item{\code{f}}{The fitted f parameter}
+ \item{\code{k1}}{The fitted k1 parameter}
+ \item{\code{k2}}{The fitted k2 parameter}
+ \item{\code{DT50}}{The resulting half-life of the parent compound}
+ \item{\code{DT90}}{The resulting DT90 of the parent compound}
+ \item{\code{dataset}}{The FOCUS dataset that was used}
+ }
+}
+\note{
+ The comparison of these results with the results obtained with the
+ current version of \code{kinfit} can be found in the package vignette.
+}
+\source{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\examples{
+data(FOCUS_2006_DFOP_ref_A_to_B)
+}
+\keyword{datasets}
diff --git a/man/FOCUS_2006_E.Rd b/man/FOCUS_2006_E.Rd
new file mode 100644
index 0000000..7ae905b
--- /dev/null
+++ b/man/FOCUS_2006_E.Rd
@@ -0,0 +1,32 @@
+\name{FOCUS_2006_E}
+\Rdversion{1.1}
+\alias{FOCUS_2006_E}
+\docType{data}
+\title{
+Dataset E from the FOCUS Kinetics report from 2006
+}
+\description{
+Data taken from an \dQuote{existing dataset}.
+}
+\usage{data(FOCUS_2006_E)}
+\format{
+ A data frame with 9 observations on the following 3 variables.
+ \describe{
+ \item{\code{t}}{a numeric vector containing time points}
+ \item{\code{parent}}{a numeric vector containing parent concentrations
+ in percent of applied radioactivity}
+ \item{\code{m1}}{a numeric vector containing concentrations of metabolite 1
+ in percent of applied radioactivity}
+ }
+}
+\source{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\examples{
+data(FOCUS_2006_E)
+}
+\keyword{datasets}
diff --git a/man/FOCUS_2006_F.Rd b/man/FOCUS_2006_F.Rd
new file mode 100644
index 0000000..87bd1af
--- /dev/null
+++ b/man/FOCUS_2006_F.Rd
@@ -0,0 +1,32 @@
+\name{FOCUS_2006_F}
+\Rdversion{1.1}
+\alias{FOCUS_2006_F}
+\docType{data}
+\title{
+Water sediment study dataset F from the FOCUS Kinetics report from 2006
+}
+\description{
+Data taken from an \dQuote{existing dataset}.
+}
+\usage{data(FOCUS_2006_F)}
+\format{
+ A data frame with 9 observations on the following 3 variables.
+ \describe{
+ \item{\code{t}}{a numeric vector containing time points}
+ \item{\code{parent.water}}{a numeric vector containing parent
+ concentrations in water in percent of applied radioactivity}
+ \item{\code{parent.sediment}}{a numeric vector containing parent
+ concentrations in water in percent of applied radioactivity}
+ }
+}
+\source{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\examples{
+data(FOCUS_2006_F)
+}
+\keyword{datasets}
diff --git a/man/FOCUS_2006_FOMC_ref_A_to_F.Rd b/man/FOCUS_2006_FOMC_ref_A_to_F.Rd
new file mode 100644
index 0000000..8710046
--- /dev/null
+++ b/man/FOCUS_2006_FOMC_ref_A_to_F.Rd
@@ -0,0 +1,42 @@
+\name{FOCUS_2006_FOMC_ref_A_to_F}
+\Rdversion{1.1}
+\alias{FOCUS_2006_FOMC_ref_A_to_F}
+\docType{data}
+\title{
+Results of fitting the FOMC model to Datasets A to F of FOCUS (2006)
+}
+\description{
+A table with the fitted parameters and the resulting DT50 and DT90 values
+generated with different software packages. Taken directly from FOCUS (2006).
+The results from fitting the data with the Topfit software was removed, as
+the initial concentration of the parent compound was fixed to a value of 100
+in this fit.
+}
+\usage{data(FOCUS_2006_FOMC_ref_A_to_F)}
+\format{
+ A data frame containing the following variables.
+ \describe{
+ \item{\code{package}}{a factor giving the name of the software package}
+ \item{\code{M0}}{The fitted initial concentration of the parent compound}
+ \item{\code{alpha}}{The fitted alpha parameter}
+ \item{\code{beta}}{The fitted beta parameter}
+ \item{\code{DT50}}{The resulting half-life of the parent compound}
+ \item{\code{DT90}}{The resulting DT90 of the parent compound}
+ \item{\code{dataset}}{The FOCUS dataset that was used}
+ }
+}
+\note{
+ The comparison of these results with the results obtained with the
+ current version of \code{kinfit} can be found in the package vignette.
+}
+\source{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\examples{
+data(FOCUS_2006_FOMC_ref_A_to_F)
+}
+\keyword{datasets}
diff --git a/man/FOCUS_2006_HS_ref_A_to_F.Rd b/man/FOCUS_2006_HS_ref_A_to_F.Rd
new file mode 100644
index 0000000..4ed8555
--- /dev/null
+++ b/man/FOCUS_2006_HS_ref_A_to_F.Rd
@@ -0,0 +1,43 @@
+\name{FOCUS_2006_HS_ref_A_to_F}
+\Rdversion{1.1}
+\alias{FOCUS_2006_HS_ref_A_to_F}
+\docType{data}
+\title{
+Results of fitting the HS model to Datasets A to F of FOCUS (2006)
+}
+\description{
+A table with the fitted parameters and the resulting DT50 and DT90 values
+generated with different software packages. Taken directly from FOCUS (2006).
+The results from fitting the data with the Topfit software was removed, as
+the initial concentration of the parent compound was fixed to a value of 100
+in this fit.
+}
+\usage{data(FOCUS_2006_HS_ref_A_to_F)}
+\format{
+ A data frame containing the following variables.
+ \describe{
+ \item{\code{package}}{a factor giving the name of the software package}
+ \item{\code{M0}}{The fitted initial concentration of the parent compound}
+ \item{\code{tb}}{The fitted tb parameter}
+ \item{\code{k1}}{The fitted k1 parameter}
+ \item{\code{k2}}{The fitted k2 parameter}
+ \item{\code{DT50}}{The resulting half-life of the parent compound}
+ \item{\code{DT90}}{The resulting DT90 of the parent compound}
+ \item{\code{dataset}}{The FOCUS dataset that was used}
+ }
+}
+\note{
+ The comparison of these results with the results obtained with the
+ current version of \code{kinfit} can be found in the package vignette.
+}
+\source{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\examples{
+data(FOCUS_2006_HS_ref_A_to_F)
+}
+\keyword{datasets}
diff --git a/man/FOCUS_2006_SFO_ref_A_to_F.Rd b/man/FOCUS_2006_SFO_ref_A_to_F.Rd
new file mode 100644
index 0000000..fb6b304
--- /dev/null
+++ b/man/FOCUS_2006_SFO_ref_A_to_F.Rd
@@ -0,0 +1,41 @@
+\name{FOCUS_2006_SFO_ref_A_to_F}
+\Rdversion{1.1}
+\alias{FOCUS_2006_SFO_ref_A_to_F}
+\docType{data}
+\title{
+Results of fitting the SFO model to Datasets A to F of FOCUS (2006)
+}
+\description{
+A table with the fitted parameters and the resulting DT50 and DT90 values
+generated with different software packages. Taken directly from FOCUS (2006).
+The results from fitting the data with the Topfit software was removed, as
+the initial concentration of the parent compound was fixed to a value of 100
+in this fit.
+}
+\usage{data(FOCUS_2006_SFO_ref_A_to_F)}
+\format{
+ A data frame containing the following variables.
+ \describe{
+ \item{\code{package}}{a factor giving the name of the software package}
+ \item{\code{M0}}{The fitted initial concentration of the parent compound}
+ \item{\code{k}}{The fitted first-order degradation rate constant}
+ \item{\code{DT50}}{The resulting half-life of the parent compound}
+ \item{\code{DT90}}{The resulting DT90 of the parent compound}
+ \item{\code{dataset}}{The FOCUS dataset that was used}
+ }
+}
+\note{
+ The comparison of these results with the results obtained with the
+ current version of \code{kinfit} can be found in the package vignette.
+}
+\source{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\examples{
+data(FOCUS_2006_SFO_ref_A_to_F)
+}
+\keyword{datasets}
diff --git a/man/FOMC.Rd b/man/FOMC.Rd
new file mode 100644
index 0000000..7228b1b
--- /dev/null
+++ b/man/FOMC.Rd
@@ -0,0 +1,49 @@
+\name{FOMC}
+\Rdversion{1.1}
+\alias{FOMC}
+\title{ First-Order Multi-Compartment kinetics }
+\description{
+ Function describing exponential decline from a defined starting value, with
+ a decreasing rate constant.
+
+ The form given here differs slightly from the original reference by Gustafson
+ and Holden (1990). The parameter \code{beta} corresponds to 1/beta in the
+ original equation.
+}
+\usage{
+FOMC(t, parent.0, alpha, beta)
+}
+\arguments{
+ \item{t}{ Time. }
+ \item{parent.0}{ Starting value for the response variable at time zero. }
+ \item{alpha}{
+ Shape parameter determined by coefficient of variation of rate constant
+ values. }
+ \item{beta}{
+ Location parameter.
+}
+}
+\note{
+ The FOMC kinetic model reduces to the \code{\link{SFO}} kinetic model for
+ large values of \code{alpha} and \code{beta} with
+ \eqn{k = \frac{\beta}{\alpha}}{k = beta/alpha}.
+}
+\value{
+ The value of the response variable at time \code{t}.
+}
+\references{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+
+ Gustafson DI and Holden LR (1990) Nonlinear pesticide dissipation in soil: A
+ new model based on spatial variability. \emph{Environmental Science and
+ Technology} \bold{24}, 1032-1038
+}
+\author{ Johannes Ranke }
+\examples{
+ \dontrun{plot(function(x) FOMC(x, 100, 10, 2), 0, 2)}
+}
+\keyword{ manip }
diff --git a/man/HS.Rd b/man/HS.Rd
new file mode 100644
index 0000000..9adbd18
--- /dev/null
+++ b/man/HS.Rd
@@ -0,0 +1,35 @@
+\name{HS}
+\Rdversion{1.1}
+\alias{HS}
+\title{ Hockey-Stick kinetics }
+\description{
+ Function describing two exponential decline functions with a break point
+ between them.
+}
+\usage{
+HS(t, parent.0, k1, k2, tb)
+}
+\arguments{
+ \item{t}{ Time. }
+ \item{parent.0}{ Starting value for the response variable at time zero. }
+ \item{k1}{ First kinetic constant. }
+ \item{k2}{ Second kinetic constant. }
+ \item{tb}{ Break point. Before this time, exponential decline according
+ to \code{k1} is calculated, after this time, exponential decline proceeds
+ according to \code{k2}. }
+}
+\value{
+ The value of the response variable at time \code{t}.
+}
+\references{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\author{ Johannes Ranke }
+\examples{
+ \dontrun{plot(function(x) HS(x, 100, 2, 0.3, 0.5), 0, 2, ylim=c(0,100))}
+}
+\keyword{ manip }
diff --git a/man/SFO.Rd b/man/SFO.Rd
new file mode 100644
index 0000000..e4986da
--- /dev/null
+++ b/man/SFO.Rd
@@ -0,0 +1,30 @@
+\name{SFO}
+\Rdversion{1.1}
+\alias{SFO}
+\title{ Single First-Order kinetics }
+\description{
+ Function describing exponential decline from a defined starting value.
+}
+\usage{
+ SFO(t, parent.0, k)
+}
+\arguments{
+ \item{t}{ Time. }
+ \item{parent.0}{ Starting value for the response variable at time zero. }
+ \item{k}{ Kinetic constant. }
+}
+\value{
+ The value of the response variable at time \code{t}.
+}
+\references{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\author{ Johannes Ranke }
+\examples{
+ \dontrun{plot(function(x) SFO(x, 100, 3), 0, 2)}
+}
+\keyword{ manip }
diff --git a/man/kinerrmin.Rd b/man/kinerrmin.Rd
new file mode 100644
index 0000000..1afddf0
--- /dev/null
+++ b/man/kinerrmin.Rd
@@ -0,0 +1,43 @@
+\name{kinerrmin}
+\Rdversion{1.1}
+\alias{kinerrmin}
+\title{
+Calculate the minimum error to assume in order to pass the variance test
+}
+\description{
+This function uses \code{\link{optimize}} in order to iteratively find the
+smallest relative error still resulting in passing the chi-squared test
+as defined in the FOCUS kinetics report from 2006.
+}
+\usage{
+kinerrmin(kinfits, kinmodel = "SFO", alpha = 0.05)
+}
+\arguments{
+ \item{kinfits}{
+The list of kinetic model(s) from which to select. Usually this will have been
+generated by \code{\link{kinfit}}.
+}
+ \item{kinmodel}{
+The kinetic model to be checked. Should be one of the names of the kinetic models used for generating \code{kinfits}.
+}
+ \item{alpha}{
+The confidence level chosen for the chi-squared test.
+}
+}
+\value{
+The relative error, expressed as a fraction.
+}
+\references{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\author{ Johannes Ranke }
+\examples{
+data(FOCUS_2006_A)
+kinfits <- kinfit(FOCUS_2006_A)
+kinerrmin(kinfits)
+}
+\keyword{ manip }
diff --git a/man/kinfit.Rd b/man/kinfit.Rd
new file mode 100644
index 0000000..f0301fd
--- /dev/null
+++ b/man/kinfit.Rd
@@ -0,0 +1,77 @@
+\name{kinfit}
+\Rdversion{1.1}
+\alias{kinfit}
+\title{
+Fit kinetic models to chemical degradation data
+}
+\description{
+ A selection of kinetic models as defined in the FOCUS kinetics report from
+ 2006 are fitted to a given dataframe of chemical degradation data.
+}
+\usage{
+kinfit(kindata, kinmodels = c("SFO"), parent.0.user = NA,
+ start.SFO = list(parent.0 = NA, k = NA),
+ start.FOMC = list(parent.0 = NA, alpha = NA, beta = NA),
+ start.DFOP = list(parent.0 = NA, k1 = NA, k2 = NA, g = NA),
+ start.HS = list(parent.0 = NA, k1 = NA, k2 = NA, tb = NA),
+ algorithm = "port")
+}
+\arguments{
+ \item{kindata}{
+ A data frame containing a time variable named \code{t} and concentration
+ data for the parent compound named \code{parent}.
+ }
+ \item{kinmodels}{
+ An array of character strings which are names of the models to be fit.
+ Possible names are \code{\link{SFO}}, \code{\link{FOMC}}, \code{\link{DFOP}}
+ and \code{\link{HS}}.
+ }
+ \item{parent.0.user}{
+ The user can give a starting estimate for parent.0 here, overriding other
+ potential sources for starting values as specified below.
+ }
+ \item{start.SFO}{
+ A list of starting parameters for fitting the \code{\link{SFO}} model,
+ containing \code{parent.0} and \code{k}.
+ }
+ \item{start.FOMC}{
+ A list of starting parameters for fitting the \code{\link{FOMC}} model,
+ containing \code{parent.0}, \code{alpha} and \code{beta}.
+ }
+ \item{start.DFOP}{
+ A list of starting parameters for fitting the \code{\link{DFOP}} model,
+ containing \code{parent.0}, \code{k1}, \code{k2} and \code{g}.
+ }
+ \item{start.HS}{
+ A list of starting parameters for fitting the \code{\link{HS}} model,
+ containing \code{parent.0}, \code{k1}, \code{k2} and \code{tb}.
+ }
+ \item{algorithm}{
+ The algorithm to use for the calls to \code{\link{nls}}.
+ }
+}
+\details{
+ Per default all starting parameters are \code{NA} and the function tries to
+ find suitable starting parameters on its own.
+}
+\value{
+ A list of models of class \code{nls} representing the models that were
+ fitted successfully.
+}
+\references{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\author{ Johannes Ranke }
+\examples{
+data(FOCUS_2006_A)
+(kinfits <- kinfit(FOCUS_2006_A))
+data(FOCUS_2006_B)
+(kinfits <- kinfit(FOCUS_2006_B, kinmodels=c("SFO","FOMC")))
+}
+\keyword{ models }
+\keyword{ regression }
+\keyword{ nonlinear }
diff --git a/man/kinobject.Rd b/man/kinobject.Rd
new file mode 100644
index 0000000..cd6f0ca
--- /dev/null
+++ b/man/kinobject.Rd
@@ -0,0 +1,29 @@
+\name{kinobject}
+\Rdversion{1.1}
+\alias{kinobject}
+\title{
+Creates list representing a kinetic experiment or trial
+}
+\description{
+Function to initialise an object representing a kinetic experiment or trial.
+}
+\usage{
+ kinobject(parent, type, system, layers = NA, sampling_times = NA)
+}
+\arguments{
+ \item{parent}{ The name of the parent compound }
+ \item{type}{ The type of experiment or trial, optionally with an ID }
+ \item{system}{ System name. Important if several systems were used, e.g. several soils. }
+ \item{layers}{ Optional specification of the layer names in a field trial. }
+ \item{sampling_times}{ Optional specification of the sampling time pionts. }
+}
+\value{
+ A list containing the specified information.
+}
+\author{ Johannes Ranke }
+\examples{
+ko <- kinobject("Compound XY",
+ "Degradation in the environment",
+ "System 1")
+}
+\keyword{ manip }
diff --git a/man/kinobjects.Rd b/man/kinobjects.Rd
new file mode 100644
index 0000000..7c960f3
--- /dev/null
+++ b/man/kinobjects.Rd
@@ -0,0 +1,29 @@
+\name{kinobjects}
+\Rdversion{1.1}
+\alias{kinobjects}
+\title{
+Creates list of objects, each representing a kinetic experiment or trial
+}
+\description{
+Function to initialise several objects representing a kinetic experiment or trial at once.
+}
+\usage{
+ kinobjects(parent, type, systems, layers = NA, sampling_times = NA)
+}
+\arguments{
+ \item{parent}{ The name of the parent compound }
+ \item{type}{ The type of experiment or trial, optionally with an ID }
+ \item{systems}{ An array of the system names }
+ \item{layers}{ Optional specification of the layer names in a field trial. }
+ \item{sampling_times}{ Optional specification of the sampling time pionts. }
+}
+\value{
+ A list of lists containing the specified information.
+}
+\author{ Johannes Ranke }
+\examples{
+ko <- kinobjects("Compound XY",
+ "Degradation in the environment",
+ c("System 1", "System 2", "System 3"))
+}
+\keyword{ manip }
diff --git a/man/kinplot.Rd b/man/kinplot.Rd
new file mode 100644
index 0000000..9e684b7
--- /dev/null
+++ b/man/kinplot.Rd
@@ -0,0 +1,50 @@
+\name{kinplot}
+\Rdversion{1.1}
+\alias{kinplot}
+\title{
+Creates a plot of the kinetic fits
+}
+\description{
+Function to create a plot for a set of fitted models
+}
+\usage{
+kinplot(kinobject, xlab = "Time [days]", ylab = "Parent [\% of applied radioactivity]", ylim = c("auto", "auto"), lpos = "topright")
+}
+\arguments{
+ \item{kinobject}{
+ A list containing the following elements:
+ The name of the parent compound to be output (\code{parent}),
+ the type of the test system (\code{type}),
+ the name of the specific test system used for generating this dataset
+ (\code{system}),
+ the list of fitted kinetic models (\code{fits}), as returned by
+ \code{\link{kinfit}}, and the list of results (\code{results})
+ as returned by \code{\link{kinresults}}.
+ Optionally also
+ the label position of the test compound (\code{label}) and
+ the source of the data (\code{source}). }
+ \item{xlab}{ Label for the x axis. }
+ \item{ylab}{ Label for the y axis. }
+ \item{ylim}{ An array of length two holding the range for values on the y axis or "auto". }
+ \item{lpos}{ Where should the legend be placed? Will be passed on to
+ \code{\link{legend}}. }
+}
+\value{
+The function is called for its side effect, namely creating a plot with
+the fitted model.
+}
+\author{ Johannes Ranke }
+\examples{
+data(FOCUS_2006_C)
+kinfits <- kinfit(FOCUS_2006_C, kinmodels = c("SFO", "FOMC", "DFOP"))
+kinobject <- list(
+ parent = "Compound XY",
+ type = "Degradation in the environment",
+ system = "System 1",
+ source = "Synthetic example data from FOCUS kinetics",
+ data = FOCUS_2006_C,
+ fits = kinfits,
+ results = kinresults(kinfits))
+\dontrun{kinplot(kinobject)}
+}
+\keyword{ hplot }
diff --git a/man/kinreport.Rd b/man/kinreport.Rd
new file mode 100644
index 0000000..de7e632
--- /dev/null
+++ b/man/kinreport.Rd
@@ -0,0 +1,48 @@
+\name{kinreport}
+\Rdversion{1.1}
+\alias{kinreport}
+\title{
+Creates a report of the kinetic fits
+}
+\description{
+Function to create a report for a set of fitted models, passing it to the
+console as well as to a file, if specified.
+}
+\usage{
+kinreport(kinobject, file = NA, vcov = FALSE, endpoint.digits = 1)
+}
+\arguments{
+ \item{kinobject}{
+ A list containing the following elements:
+ The name of the parent compound to be output (\code{parent}),
+ the type of the test system (\code{type}),
+ the name of the specific test system used for generating this dataset
+ (\code{system}),
+ the list of fitted kinetic models (\code{fits}), as returned by
+ \code{\link{kinfit}}, and the list of results (\code{results})
+ as returned by \code{\link{kinresults}}.
+ Optionally also
+ the label position of the test compound (\code{label}) and
+ the source of the data (\code{source}). }
+ \item{file}{ The name of the file to which to write. }
+ \item{vcov}{ Should the variance-covariance matrix/matrices be reported? }
+ \item{endpoint.digits}{ How many digits should be reported for DT50 and DT90 values? }
+}
+\value{
+The function is called for its side effect, namely the report being passed
+to the R console as well as to a text file.
+}
+\author{ Johannes Ranke }
+\examples{
+data(FOCUS_2006_A)
+kinfits <- kinfit(FOCUS_2006_A)
+kinobject <- list(
+ parent = "Compound XY",
+ type = "Degradation in the environment",
+ system = "System 1",
+ source = "Synthetic example data from FOCUS kinetics",
+ fits = kinfits,
+ results = kinresults(kinfits))
+kinreport(kinobject)
+}
+\keyword{ manip }
diff --git a/man/kinresplot.Rd b/man/kinresplot.Rd
new file mode 100644
index 0000000..85ec333
--- /dev/null
+++ b/man/kinresplot.Rd
@@ -0,0 +1,49 @@
+\name{kinresplot}
+\Rdversion{1.1}
+\alias{kinresplot}
+\title{
+Creates a plot of the residual for specified kinetic fits
+}
+\description{
+Function to create a residual plot for a specified fitted model
+}
+\usage{
+kinresplot(kinobject, kinmodel, xlab = "Time [days]", ylab = "Residual [\% of applied radioactivity]", maxabs = "auto")
+}
+\arguments{
+ \item{kinobject}{
+ A list containing the following elements:
+ The name of the parent compound to be output (\code{parent}),
+ the type of the test system (\code{type}),
+ the name of the specific test system used for generating this dataset
+ (\code{system}),
+ the list of fitted kinetic models (\code{fits}), as returned by
+ \code{\link{kinfit}}, and optionally the list of results
+ (\code{results}) as returned by \code{\link{kinresults}}.
+ Also optional is the label position of the test compound (\code{label})
+ and the source of the data (\code{source}). }
+ \item{kinmodel}{ The fitted model for which the residuals should be plotted. }
+ \item{xlab}{ Label for the x axis. }
+ \item{ylab}{ Label for the y axis. }
+ \item{maxabs}{ Maximum value of the absolute residuals, will be calculated
+ from the residuals if not specified otherwise. }
+}
+\value{
+The function is called for its side effect, namely creating a residual plot
+for the specified fit.
+}
+\author{ Johannes Ranke }
+\examples{
+data(FOCUS_2006_C)
+kinfits <- kinfit(FOCUS_2006_C)
+kinobject <- list(
+ parent = "Compound XY",
+ type = "Degradation in the environment",
+ system = "System 1",
+ source = "Synthetic example data from FOCUS kinetics",
+ data = FOCUS_2006_C,
+ fits = kinfits,
+ results = kinresults(kinfits))
+\dontrun{kinresplot(kinobject, "SFO")}
+}
+\keyword{ hplot }
diff --git a/man/kinresults.Rd b/man/kinresults.Rd
new file mode 100644
index 0000000..6ab93a7
--- /dev/null
+++ b/man/kinresults.Rd
@@ -0,0 +1,45 @@
+\name{kinresults}
+\Rdversion{1.1}
+\alias{kinresults}
+\title{
+Function to collect useful results for a set of fitted kinetic models
+}
+\description{
+This function collects the parameters and some statistics for the fitted kinetic
+models. It also generates DT50 and DT90 estimates.
+}
+\usage{
+kinresults(kinfits, alpha = 0.05, SFORB = TRUE)
+}
+\arguments{
+ \item{kinfits}{
+The list of kinetic model(s) for which to collect results. Usually this will
+have been generated by \code{\link{kinfit}}.
+}
+ \item{alpha}{
+The confidence level chosen for the chi-squared test used in the call to
+\code{\link{kinerrmin}}.
+}
+ \item{SFORB}{
+Should the results of the \code{\link{DFOP}} model be presented as parameters
+to the Single First-Order Reversible Binding (SFORB) model? }
+}
+\value{
+A list containing a list of the parameters fitted by the models, a dataframe
+containing some statistics for each of the fitted models, and a dataframe with
+the resulting DT50 and DT90 values.
+}
+\references{
+ FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ \url{http://focus.jrc.ec.europa.eu/dk}
+}
+\author{ Johannes Ranke }
+\examples{
+data(FOCUS_2006_A)
+kinfits <- kinfit(FOCUS_2006_A)
+kinresults(kinfits)
+}
+\keyword{ manip }
diff --git a/man/kinwrite.KinGUI.Rd b/man/kinwrite.KinGUI.Rd
new file mode 100644
index 0000000..f5a5ddc
--- /dev/null
+++ b/man/kinwrite.KinGUI.Rd
@@ -0,0 +1,47 @@
+\name{kinwrite.KinGUI}
+\Rdversion{1.1}
+\alias{kinwrite.KinGUI}
+\encoding{latin1}
+\title{
+Function to write KinGUI input files from kinetic data
+}
+\description{
+This function takes an R object as used by the \code{kinfit} package
+and tries to write a text file which is compatible with the KinGUI
+software tool.
+}
+\usage{
+kinwrite.KinGUI(kinobject, file, comment=NA)
+}
+\arguments{
+ \item{kinobject}{
+ A list containing the following elements:
+ The name of the parent compound to be output (\code{parent}),
+ the type of the test system (\code{type}),
+ the name of the specific test system used for generating this dataset
+ (\code{system}),
+ a data frame containing the raw data (\code{data}),
+ which should be in the same form as required by
+ by \code{\link{kinfit}}.
+}
+ \item{file}{
+The filename, potentially including the full path, specifying where the output whould be written.
+}
+ \item{comment}{
+An optional comment that will be integrated in the header of the KinGUI input file.
+}
+}
+\value{
+The function is called for its side effect, namely the generation of a text file.
+}
+\references{
+Schäfer D, Kikolasch M, Rainbird P and Harvey B (2007). KinGUI: a new kinetic software tool for evaluations according to FOCUS degradation kinetics. In: Del Re AAM, Capri E, Fragoulis G and Trevisan M (Eds.). Proceedings of the XIII Symposium Pesticide Chemistry, Piacenza, 2007, p. 916-923.
+}
+\note{
+The KinGUI software tool was announced to be freely available on CD from the main author of the paper cited above, Dieter Schäfer <dieter.schaefer@bayercropscience.com>.
+}
+\author{
+Johannes Ranke
+}
+
+\keyword{ IO }
diff --git a/tests/test_FOCUS_2006_A.R b/tests/test_FOCUS_2006_A.R
new file mode 100644
index 0000000..2077315
--- /dev/null
+++ b/tests/test_FOCUS_2006_A.R
@@ -0,0 +1,25 @@
+library(kinfit)
+data(FOCUS_2006_A)
+fits <- kinfit(FOCUS_2006_A, kinmodels = c("SFO", "HS"))
+print(kinresults(fits)$results, digits=5)
+print(kinresults(fits)$stats, digits=5)
+
+data(FOCUS_2006_B)
+fits <- kinfit(FOCUS_2006_B, kinmodels = c("SFO", "FOMC", "DFOP"))
+print(kinresults(fits)$results, digits=5)
+print(kinresults(fits)$stats, digits=5)
+
+data(FOCUS_2006_C)
+fits <- kinfit(FOCUS_2006_C, kinmodels = c("SFO", "FOMC", "DFOP"))
+print(kinresults(fits)$results, digits=5)
+print(kinresults(fits)$stats, digits=5)
+
+data(FOCUS_2006_D)
+fits <- kinfit(FOCUS_2006_D, kinmodels = c("SFO", "FOMC"))
+print(kinresults(fits)$results, digits=5)
+print(kinresults(fits)$stats, digits=5)
+
+data(FOCUS_2006_E)
+fits <- kinfit(FOCUS_2006_E, kinmodels = c("SFO", "FOMC", "DFOP"))
+print(kinresults(fits)$results, digits=5)
+print(kinresults(fits)$stats, digits=5)
diff --git a/tests/test_FOCUS_2006_A.Rout.save b/tests/test_FOCUS_2006_A.Rout.save
new file mode 100644
index 0000000..a26b701
--- /dev/null
+++ b/tests/test_FOCUS_2006_A.Rout.save
@@ -0,0 +1,79 @@
+
+R version 2.10.0 (2009-10-26)
+Copyright (C) 2009 The R Foundation for Statistical Computing
+ISBN 3-900051-07-0
+
+R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+
+R is a collaborative project with many contributors.
+Type 'contributors()' for more information and
+'citation()' on how to cite R or R packages in publications.
+
+Type 'demo()' for some demos, 'help()' for on-line help, or
+'help.start()' for an HTML browser interface to help.
+Type 'q()' to quit R.
+
+> library(kinfit)
+> data(FOCUS_2006_A)
+> fits <- kinfit(FOCUS_2006_A, kinmodels = c("SFO", "HS"))
+> print(kinresults(fits)$results, digits=5)
+ DT50 DT90
+SFO 18.624 61.868
+HS 20.294 49.854
+> print(kinresults(fits)$stats, digits=5)
+ n.times df mean.means RSS err.min
+SFO 8 6 50.054 221.8078 0.083848
+HS 8 4 50.054 6.6927 0.016766
+>
+> data(FOCUS_2006_B)
+> fits <- kinfit(FOCUS_2006_B, kinmodels = c("SFO", "FOMC", "DFOP"))
+> print(kinresults(fits)$results, digits=5)
+ DT50 DT90
+SFO 8.8686 29.461
+FOMC 8.6834 30.754
+DFOP 8.6829 30.789
+> print(kinresults(fits)$stats, digits=5)
+ n.times df mean.means RSS err.min
+SFO 8 6 35.015 30.656 0.044555
+FOMC 8 5 35.015 28.583 0.045886
+DFOP 8 4 35.015 28.550 0.049527
+>
+> data(FOCUS_2006_C)
+> fits <- kinfit(FOCUS_2006_C, kinmodels = c("SFO", "FOMC", "DFOP"))
+> print(kinresults(fits)$results, digits=5)
+ DT50 DT90
+SFO 2.2647 7.5232
+FOMC 1.7852 15.1479
+DFOP 1.8869 21.2507
+> print(kinresults(fits)$stats, digits=5)
+ n.times df mean.means RSS err.min
+SFO 9 7 23.589 196.5334 0.158440
+FOMC 9 6 23.589 31.0509 0.066568
+DFOP 9 5 23.589 4.3627 0.026621
+>
+> data(FOCUS_2006_D)
+> fits <- kinfit(FOCUS_2006_D, kinmodels = c("SFO", "FOMC"))
+> print(kinresults(fits)$results, digits=5)
+ DT50 DT90
+SFO 7.0776 23.511
+FOMC 6.9350 24.044
+> print(kinresults(fits)$stats, digits=5)
+ n.times df mean.means RSS err.min
+SFO 9 7 39.523 207.63 0.064524
+FOMC 9 6 39.523 205.45 0.067802
+>
+> data(FOCUS_2006_E)
+> fits <- kinfit(FOCUS_2006_E, kinmodels = c("SFO", "FOMC", "DFOP"))
+> print(kinresults(fits)$results, digits=5)
+ DT50 DT90
+SFO 2.2647 7.5232
+FOMC 1.7852 15.1479
+DFOP 1.8869 21.2507
+> print(kinresults(fits)$stats, digits=5)
+ n.times df mean.means RSS err.min
+SFO 9 7 23.589 196.5334 0.158440
+FOMC 9 6 23.589 31.0509 0.066568
+DFOP 9 5 23.589 4.3627 0.026621
+>

Contact - Imprint