From f39815aa87272849f8e0c808099c4cee780c2a81 Mon Sep 17 00:00:00 2001
From: Johannes Ranke
@@ -102,10 +107,7 @@plot(function(x) DFOP.solution(x, 100, 5, 0.5, 0.3), 0, 4, ylim=c(0,100))
An object of class mmkin
.
@@ -110,10 +115,7 @@ in this fit. http://focus.jrc.ec.europa.eu/dk -# Only use one core, to pass R CMD check --as-cran fits <- mmkin(c("SFO", "FOMC"), list(B = FOCUS_2006_B, C = FOCUS_2006_C), cores = 1, quiet = TRUE) @@ -113,14 +115,12 @@ #> model B C #> FOMC List,42 List,42 #> attr(,"class") -#> [1] "mmkin" -#>fits[, "B"]#> dataset +#> [1] "mmkin"fits[, "B"]#> dataset #> model B #> SFO List,42 #> FOMC List,42 #> attr(,"class") -#> [1] "mmkin" -#>fits[, "B", drop = TRUE]$FOMC#> $par +#> [1] "mmkin"fits[, "B", drop = TRUE]$FOMC#> $par #> parent_0 log_alpha log_beta #> 99.666193 2.549849 5.050586 #> @@ -193,7 +193,7 @@ #> #> $time #> user system elapsed -#> 0.26 0.00 0.26 +#> 0.256 0.000 0.256 #> #> $mkinmod #> <mkinmod> model generated with @@ -379,7 +379,7 @@ #> } #> return(mC) #> } -#> <environment: 0x5421f48> +#> <environment: 0x5b47f50> #> #> $cost_notrans #> function (P) @@ -401,7 +401,7 @@ #> scaleVar = scaleVar) #> return(mC) #> } -#> <environment: 0x5421f48> +#> <environment: 0x5b47f50> #> #> $hessian_notrans #> parent_0 alpha beta @@ -467,16 +467,14 @@ #> 99.66619 #> #> $date -#> [1] "Wed Oct 26 23:50:33 2016" +#> [1] "Thu Nov 3 17:46:18 2016" #> #> attr(,"class") -#> [1] "mkinfit" "modFit" -#>fits["SFO", "B"]#> dataset +#> [1] "mkinfit" "modFit"fits["SFO", "B"]#> dataset #> model B #> SFO List,42 #> attr(,"class") -#> [1] "mmkin" -#>fits[["SFO", "B"]] # This is equivalent to#> $par +#> [1] "mmkin"fits[["SFO", "B"]] # This is equivalent to#> $par #> parent_0 log_k_parent_sink #> 99.174072 -2.549028 #> @@ -735,7 +733,7 @@ #> } #> return(mC) #> } -#> <environment: 0x2b30d68> +#> <environment: 0x46881c0> #> #> $cost_notrans #> function (P) @@ -757,7 +755,7 @@ #> scaleVar = scaleVar) #> return(mC) #> } -#> <environment: 0x2b30d68> +#> <environment: 0x46881c0> #> #> $hessian_notrans #> parent_0 k_parent_sink @@ -820,11 +818,10 @@ #> 99.17407 #> #> $date -#> [1] "Wed Oct 26 23:50:32 2016" +#> [1] "Thu Nov 3 17:46:18 2016" #> #> attr(,"class") -#> [1] "mkinfit" "modFit" -#>fits["SFO", "B", drop = TRUE]#> [[1]] +#> [1] "mkinfit" "modFit"fits["SFO", "B", drop = TRUE]#> [[1]] #> $par #> parent_0 log_k_parent_sink #> 99.174072 -2.549028 @@ -1084,7 +1081,7 @@ #> } #> return(mC) #> } -#> <environment: 0x2b30d68> +#> <environment: 0x46881c0> #> #> $cost_notrans #> function (P) @@ -1106,7 +1103,7 @@ #> scaleVar = scaleVar) #> return(mC) #> } -#> <environment: 0x2b30d68> +#> <environment: 0x46881c0> #> #> $hessian_notrans #> parent_0 k_parent_sink @@ -1169,11 +1166,10 @@ #> 99.17407 #> #> $date -#> [1] "Wed Oct 26 23:50:32 2016" +#> [1] "Thu Nov 3 17:46:18 2016" #> #> attr(,"class") #> [1] "mkinfit" "modFit" -#> #>
@@ -109,10 +114,7 @@ in this fit. http://focus.jrc.ec.europa.eu/dk -data(FOCUS_2006_DFOP_ref_A_to_B)
@@ -110,10 +115,7 @@ in this fit. http://focus.jrc.ec.europa.eu/dk -data(FOCUS_2006_FOMC_ref_A_to_F)
@@ -108,10 +113,7 @@ in this fit. http://focus.jrc.ec.europa.eu/dk -data(FOCUS_2006_HS_ref_A_to_F)
@@ -101,10 +106,7 @@ http://focus.jrc.ec.europa.eu/dk -data(FOCUS_2006_SFO_ref_A_to_F)
+#> 9 parent 119 0.6 @@ -125,10 +130,7 @@ Technology 24, 1032-1038 -FOCUS_2006_C#> name time value #> 1 parent 0 85.1 #> 2 parent 1 57.9 @@ -114,8 +116,7 @@ #> 6 parent 28 6.6 #> 7 parent 63 4.0 #> 8 parent 91 3.9 -#> 9 parent 119 0.6 -#>
@@ -111,10 +116,7 @@ http://focus.jrc.ec.europa.eu/dk -plot(function(x) FOMC.solution(x, 100, 10, 2), 0, 2, ylim = c(0, 100))
@@ -112,10 +117,7 @@ Media -plot(function(x) HS.solution(x, 100, 2, 0.3, 0.5), 0, 2, ylim=c(0,100))
+#> iore.deS 1.785233 15.1479 4.559973 @@ -104,10 +109,7 @@ http://focus.jrc.ec.europa.eu/dk -plot(function(x) IORE.solution(x, 100, 0.2, 1.3), 0, 2, ylim = c(0, 100))fit.fomc <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE) fit.iore <- mkinfit("IORE", FOCUS_2006_C, quiet = TRUE) @@ -125,13 +127,11 @@ row.names = paste("model par", 1:3)))#> coef.fit.fomc. coef.fit.iore. coef.fit.iore.deS. #> model par 1 85.87489063 85.874891 85.874890 #> model par 2 0.05192238 -4.826631 -4.826631 -#> model par 3 0.65096665 1.949403 1.949403 -#>print(rbind(fomc = endpoints(fit.fomc)$distimes, iore = endpoints(fit.iore)$distimes, +#> model par 3 0.65096665 1.949403 1.949403print(rbind(fomc = endpoints(fit.fomc)$distimes, iore = endpoints(fit.iore)$distimes, iore.deS = endpoints(fit.iore)$distimes))#> DT50 DT90 DT50back #> fomc 1.785233 15.1479 4.559973 #> iore 1.785233 15.1479 4.559973 -#> iore.deS 1.785233 15.1479 4.559973 -#>
@@ -113,10 +118,7 @@ http://focus.jrc.ec.europa.eu/dk -## Not run: plot(function(x) SFO.solution(x, 100, 3), 0, 2)
@@ -135,13 +140,10 @@ http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf -## Not run: plot(function(x) SFORB.solution(x, 100, 0.5, 2, 3), 0, 2)
@@ -80,175 +85,180 @@# The kinetic model m_SFO_SFO <- mkinmod(parent = mkinsub("SFO", "M1"), - M1 = mkinsub("SFO"), use_of_ff = "max")Successfully compiled differential equation model from auto-generated C code.#># Generate a prediction for a specific set of parameters sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120) @@ -200,7 +202,7 @@@@ -96,7 +101,7 @@ with the advantage that the SFORB model can also be used for metabolites.Note
-The function is used internally by
+summary.mkinfit
.The function is used internally by
summary.mkinfit
.Value
@@ -123,7 +128,7 @@ with the advantage that the SFORB model can also be used for metabolites.
Essential functionality
- + +Fit a kinetic model to data with one or more state variables
- + +Function to set up a kinetic model with one or more state variables
- + +Fit one or more kinetic models with one or more state variables to one or more datasets
Functions working with mkinfit objects
- + +Function to calculate endpoints for further use from kinetic models fitted with mkinfit
- + +Calculate the minimum error to assume in order to pass the variance test
- + +Function to plot the confidence intervals obtained using + mkinfit
- + +Function to plot residuals stored in an mkin object
- - - -Functions working with aggregated results
+Subsetting method for mmkin objects
- + +Plot model fits (observed and fitted) and the residuals for a row or column of an mmkin object
Results of fitting the DFOP model to Datasets A to B of FOCUS (2006)
- + +Results of fitting the FOMC model to Datasets A to F of FOCUS (2006)
- + +Results of fitting the HS model to Datasets A to F of FOCUS (2006)
- + +Results of fitting the SFO model to Datasets A to F of FOCUS (2006)
- + +Datasets on aerobic soil metabolism of 2,4,5-T in six soils
- + + - + + +print.mkinds
Synthetic datasets for one parent compound with two metabolites
Convert a dataframe from long to wide format
- + +Convert a dataframe with observations over time into long format
- + +Produce predictions from a kinetic model using specific parameters
- + +Function to set up a kinetic submodel for one state variable
- - - + + - -Parent only model solutions
- + +Double First-Order in Parallel kinetics
-First-Order Multi-Compartment kinetics
+ +First-Order Multi-Compartment kinetics
- + + -Indeterminate order rate equation kinetics
+ +Indeterminate order rate equation kinetics
-Single First-Order Reversible Binding kinetics
+ + +SFO.solution
Single First-Order Reversible Binding kinetics
+Add normally distributed errors to simulated kinetic degradation data
+add_err
Functions that have been superseeded
- + +Plot the observed data and the fitted model of an mkinfit object
@@ -265,6 +275,7 @@Developed by Johannes Ranke, Eurofins Regulatory AG.
+Developed by Johannes Ranke.
+#> anisole 103.784 344.763 @@ -108,10 +113,7 @@SFO_SFO_SFO <- mkinmod(T245 = list(type = "SFO", to = "phenol"), phenol = list(type = "SFO", to = "anisole"), - anisole = list(type = "SFO"))Successfully compiled differential equation model from auto-generated C code.## Not run: ------------------------------------ + anisole = list(type = "SFO"))#>## Not run: ------------------------------------ # fit.1 <- mkinfit(SFO_SFO_SFO, subset(mccall81_245T, soil == "Commerce")) # summary(fit.1, data = FALSE) # @@ -121,9 +123,9 @@ parms.ini = c(k_phenol_sink = 0), fixed_parms = "k_phenol_sink", quiet = TRUE) summary(fit.2, data = FALSE)#> mkin version: 0.9.44.9000 -#> R version: 3.3.1 -#> Date of fit: Wed Oct 26 23:50:40 2016 -#> Date of summary: Wed Oct 26 23:50:40 2016 +#> R version: 3.3.2 +#> Date of fit: Thu Nov 3 17:46:24 2016 +#> Date of summary: Thu Nov 3 17:46:24 2016 #> #> Equations: #> d_T245 = - k_T245_sink * T245 - k_T245_phenol * T245 @@ -133,7 +135,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 246 model solutions performed in 1.43 s +#> Fitted with method Port using 246 model solutions performed in 1.662 s #> #> Weighting: none #> @@ -213,8 +215,7 @@ #> DT50 DT90 #> T245 15.982 53.091 #> phenol 1.711 5.685 -#> anisole 103.784 344.763 -#>
Dataframe in wide format.
-+#> 22 120 NA 33.31 @@ -102,10 +107,7 @@mkin_long_to_wide(FOCUS_2006_D)#> time parent m1 #> 1 0 99.46 0.00 #> 2 0 102.04 0.00 @@ -134,8 +136,7 @@ #> 19 100 NA 31.04 #> 20 100 NA 33.13 #> 21 120 NA 25.15 -#> 22 120 NA 33.31 -#>
Dataframe in long format as needed for modCost
.
+#> 6 y 3 5 @@ -100,10 +105,7 @@ in order to be compatible with mkinfit -wide <- data.frame(t = c(1,2,3), x = c(1,4,7), y = c(3,4,5)) mkin_wide_to_long(wide)#> name time value #> 1 x 1 1 @@ -113,8 +115,7 @@ #> 3 x 3 7 #> 4 y 1 3 #> 5 y 2 4 -#> 6 y 3 5 -#>
@@ -105,7 +110,7 @@ as defined in the FOCUS kinetics report from 2006.mds <- mkinds$new("FOCUS A", FOCUS_2006_A)
This function is used internally by summary.mkinfit
.
This function is used internally by summary.mkinfit
.
+#> m1 0.1095 2 6 @@ -251,7 +256,7 @@ to do transformations. If TRUE, the g parameter of the DFOP and HS models are also transformed, as they can also be seen as compositional data. The transformation used for these transformations is the -SFO_SFO = mkinmod(parent = list(type = "SFO", to = "m1"), m1 = list(type = "SFO"), - use_of_ff = "max")Successfully compiled differential equation model from auto-generated C code.+ use_of_ff = "max")#>#> err.min n.optim df #> All data 0.0640 4 15 #> parent 0.0646 2 7 -#> m1 0.0469 2 8 -#>#> err.min n.optim df #> All data 0.1544 4 13 #> parent 0.1659 2 7 -#> m1 0.1095 2 6 -#>
ilr
transformation.
+ ilr
transformation.
A list with "mkinfit" and "modFit" in the class attribute.
- A summary can be obtained by summary.mkinfit
.
summary.mkinfit
.
Plotting methods plot.mkinfit
and
+
Plotting methods plot.mkinfit
and
mkinparplot
.
Fitting of several models to several datasets in a single call to
mmkin
.
# Use shorthand notation for parent only degradation fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE) summary(fit)#> mkin version: 0.9.44.9000 -#> R version: 3.3.1 -#> Date of fit: Wed Oct 26 23:50:42 2016 -#> Date of summary: Wed Oct 26 23:50:42 2016 +#> R version: 3.3.2 +#> Date of fit: Thu Nov 3 17:46:27 2016 +#> Date of summary: Thu Nov 3 17:46:27 2016 #> #> Equations: #> d_parent = - (alpha/beta) * 1/((time/beta) + 1) * parent #> #> Model predictions using solution type analytical #> -#> Fitted with method Port using 64 model solutions performed in 0.168 s +#> Fitted with method Port using 64 model solutions performed in 0.147 s #> #> Weighting: none #> @@ -428,19 +430,16 @@ #> 28 parent 6.6 4.754 1.8460 #> 63 parent 4.0 2.102 1.8977 #> 91 parent 3.9 1.441 2.4590 -#> 119 parent 0.6 1.092 -0.4919 -#>+#> 119 parent 0.6 1.092 -0.4919# One parent compound, one metabolite, both single first order. # Use mkinsub for convenience in model formulation. Pathway to sink included per default. SFO_SFO <- mkinmod( parent = mkinsub("SFO", "m1"), - m1 = mkinsub("SFO"))Successfully compiled differential equation model from auto-generated C code.#># Fit the model to the FOCUS example dataset D using defaults print(system.time(fit <- mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "eigen", quiet = TRUE)))#> user system elapsed -#> 1.272 1.204 0.943 -#>coef(fit)#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink -#> 99.59848 -3.03822 -2.98030 -5.24750 -#>endpoints(fit)#> $ff +#> 1.204 1.244 0.932coef(fit)#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink +#> 99.59848 -3.03822 -2.98030 -5.24750endpoints(fit)#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 #> @@ -451,7 +450,6 @@ #> DT50 DT90 #> parent 7.022929 23.32967 #> m1 131.760712 437.69961 -#> #>## Not run: ------------------------------------ # # deSolve is slower when no C compiler (gcc) was available during model generation # print(system.time(fit.deSolve <- mkinfit(SFO_SFO, FOCUS_2006_D, @@ -535,7 +533,7 @@@@ -153,17 +158,14 @@ Media - -Developed by Johannes Ranke, Eurofins Regulatory AG.
+Developed by Johannes Ranke.
diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html index 40381656..bdfd0e09 100644 --- a/docs/reference/mkinmod.html +++ b/docs/reference/mkinmod.html @@ -61,7 +61,12 @@- - Examples -
+Examples
# Specify the SFO model (this is not needed any more, as we can now mkinfit("SFO", ...) SFO <- mkinmod(parent = list(type = "SFO")) # One parent compound, one metabolite, both single first order SFO_SFO <- mkinmod( parent = mkinsub("SFO", "m1"), - m1 = mkinsub("SFO"))Successfully compiled differential equation model from auto-generated C code.#>## Not run: ------------------------------------ # # The above model used to be specified like this, before the advent of mkinsub() # SFO_SFO <- mkinmod( @@ -210,7 +212,7 @@@@ -97,14 +102,11 @@ -Developed by Johannes Ranke, Eurofins Regulatory AG.
+Developed by Johannes Ranke.
diff --git a/docs/reference/mkinparplot.html b/docs/reference/mkinparplot.html index dff30930..f8151c16 100644 --- a/docs/reference/mkinparplot.html +++ b/docs/reference/mkinparplot.html @@ -61,7 +61,12 @@Nothing is returned by this function, as it is called for its side effect, namely to produce a plot.
-- - Examples -
+Examples
@@ -78,7 +83,7 @@ -model <- mkinmod( T245 = list(type = "SFO", to = c("phenol"), sink = FALSE), phenol = list(type = "SFO", to = c("anisole")), - anisole = list(type = "SFO"), use_of_ff = "max")Successfully compiled differential equation model from auto-generated C code.fit <- mkinfit(model, subset(mccall81_245T, soil == "Commerce"), quiet = TRUE) + anisole = list(type = "SFO"), use_of_ff = "max")#>Deprecated function. It now only calls the plot method
+plot.mkinfit
.Deprecated function. It now only calls the plot method
plot.mkinfit
.mkinplot(fit, ...)@@ -91,7 +96,7 @@
plot.mkinfit
.
+ further arguments passed to plot.mkinfit
.
Developed by Johannes Ranke, Eurofins Regulatory AG.
+Developed by Johannes Ranke.
A matrix in the same format as the output of ode
.
+#> 201 20 4.978707 27.46227SFO <- mkinmod(degradinol = list(type = "SFO")) # Compare solution types mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, @@ -182,8 +184,7 @@ #> 18 17 0.6096747 #> 19 18 0.4516581 #> 20 19 0.3345965 -#> 21 20 0.2478752 -#>mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, +#> 21 20 0.2478752mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, solution_type = "deSolve")#> time degradinol #> 1 0 100.0000000 #> 2 1 74.0818221 @@ -205,8 +206,7 @@ #> 18 17 0.6096747 #> 19 18 0.4516581 #> 20 19 0.3345965 -#> 21 20 0.2478752 -#>mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, +#> 21 20 0.2478752mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, solution_type = "deSolve", use_compiled = FALSE)#> time degradinol #> 1 0 100.0000000 #> 2 1 74.0818221 @@ -228,8 +228,7 @@ #> 18 17 0.6096747 #> 19 18 0.4516581 #> 20 19 0.3345965 -#> 21 20 0.2478752 -#>mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, +#> 21 20 0.2478752mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, solution_type = "eigen")#> time degradinol #> 1 0 100.0000000 #> 2 1 74.0818221 @@ -251,57 +250,44 @@ #> 18 17 0.6096747 #> 19 18 0.4516581 #> 20 19 0.3345965 -#> 21 20 0.2478752 -#>+#> 21 20 0.2478752# Compare integration methods to analytical solution mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, solution_type = "analytical")[21,]#> time degradinol -#> 21 20 0.2478752 -#>mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, +#> 21 20 0.2478752mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, method = "lsoda")[21,]#> time degradinol -#> 21 20 0.2478752 -#>mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, +#> 21 20 0.2478752mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, method = "ode45")[21,]#> time degradinol -#> 21 20 0.2478752 -#>mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, +#> 21 20 0.2478752mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, method = "rk4")[21,]#> time degradinol -#> 21 20 0.2480043 -#># rk4 is not as precise here +#> 21 20 0.2480043# rk4 is not as precise here # The number of output times used to make a lot of difference until the # default for atol was adjusted mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), seq(0, 20, by = 0.1))[201,]#> time degradinol -#> 201 20 0.2478752 -#>mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), +#> 201 20 0.2478752mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), seq(0, 20, by = 0.01))[2001,]#> time degradinol -#> 2001 20 0.2478752 -#>+#> 2001 20 0.2478752# Check compiled model versions - they are faster than the eigenvalue based solutions! SFO_SFO = mkinmod(parent = list(type = "SFO", to = "m1"), - m1 = list(type = "SFO"))Successfully compiled differential equation model from auto-generated C code.system.time( + m1 = list(type = "SFO"))#>system.time( print(mkinpredict(SFO_SFO, c(k_parent_m1 = 0.05, k_parent_sink = 0.1, k_m1_sink = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "eigen")[201,]))#> time parent m1 -#> 201 20 4.978707 27.46227 -#>#> user system elapsed -#> 0.028 0.004 0.004 -#>system.time( +#> 201 20 4.978707 27.46227#> user system elapsed +#> 0.004 0.024 0.004system.time( print(mkinpredict(SFO_SFO, c(k_parent_m1 = 0.05, k_parent_sink = 0.1, k_m1_sink = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "deSolve")[201,]))#> time parent m1 -#> 201 20 4.978707 27.46227 -#>#> user system elapsed -#> 0.016 0.004 0.002 -#>system.time( +#> 201 20 4.978707 27.46227#> user system elapsed +#> 0.004 0.016 0.003system.time( print(mkinpredict(SFO_SFO, c(k_parent_m1 = 0.05, k_parent_sink = 0.1, k_m1_sink = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "deSolve", use_compiled = FALSE)[201,]))#> time parent m1 -#> 201 20 4.978707 27.46227 -#>#> user system elapsed -#> 0.052 0.000 0.052 -#>
This function plots the residuals for the specified subset of the
observed variables from an mkinfit object. A combined plot of the fitted
- model and the residuals can be obtained using plot.mkinfit
+ model and the residuals can be obtained using plot.mkinfit
using the argument show_residuals = TRUE
.
@@ -124,10 +129,7 @@Successfully compiled differential equation model from auto-generated C code.@@ -115,22 +120,19 @@A list for use with
-mkinmod
.- - Examples -
+Examples
+ m1 = mkinsub("SFO", full_name = "Metabolite M1"))# One parent compound, one metabolite, both single first order. SFO_SFO <- mkinmod( parent = list(type = "SFO", to = "m1"), - m1 = list(type = "SFO"))Successfully compiled differential equation model from auto-generated C code.+ m1 = list(type = "SFO"))#># The same model using mkinsub SFO_SFO.2 <- mkinmod( parent = mkinsub("SFO", "m1"), - m1 = mkinsub("SFO"))Successfully compiled differential equation model from auto-generated C code.+ m1 = mkinsub("SFO"))#># Now supplying full names SFO_SFO.2 <- mkinmod( parent = mkinsub("SFO", "m1", full_name = "Test compound"), - m1 = mkinsub("SFO", full_name = "Metabolite M1"))Successfully compiled differential equation model from auto-generated C code.#>
[.mmkin
for subsetting, plot.mmkin
for plotting.
## Not run: ------------------------------------ # m_synth_SFO_lin <- mkinmod(parent = mkinsub("SFO", "M1"), # M1 = mkinsub("SFO", "M2"), @@ -182,7 +184,7 @@@@ -199,14 +204,11 @@ plot_sep(fit, sep_obs = TRUE, show_residuals = TRUE, show_errmin = TRUE, … -Developed by Johannes Ranke, Eurofins Regulatory AG.
+Developed by Johannes Ranke.
diff --git a/docs/reference/plot.mkinfit.html b/docs/reference/plot.mkinfit.html index 4eb7369a..61a597e7 100644 --- a/docs/reference/plot.mkinfit.html +++ b/docs/reference/plot.mkinfit.html @@ -61,7 +61,12 @@The function is called for its side effect.
-- - Examples -
+Examples
# One parent compound, one metabolite, both single first order, path from # parent to sink included, use Levenberg-Marquardt for speed SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1", full = "Parent"), - m1 = mkinsub("SFO", full = "Metabolite M1" ))Successfully compiled differential equation model from auto-generated C code.fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE, method.modFit = "Marq") + m1 = mkinsub("SFO", full = "Metabolite M1" ))#>plot(fit, show_residuals = TRUE)# Show the observed variables separately plot(fit, sep_obs = TRUE, lpos = c("topright", "bottomright"))@@ -235,7 +237,7 @@ plot_sep(fit, sep_obs = TRUE, show_residuals = TRUE, show_errmin = TRUE, …@@ -119,7 +124,7 @@ -Developed by Johannes Ranke, Eurofins Regulatory AG.
+Developed by Johannes Ranke.
diff --git a/docs/reference/plot.mmkin.html b/docs/reference/plot.mmkin.html index e0a20f3d..b107ca70 100644 --- a/docs/reference/plot.mmkin.html +++ b/docs/reference/plot.mmkin.html @@ -61,7 +61,12 @@
plot.mkinfit
and mkinresplot
.
+ Further arguments passed to plot.mkinfit
and mkinresplot
.
The function is called for its side effect.
-@@ -136,21 +141,18 @@ http://focus.jrc.ec.europa.eu/dk -# Only use one core not to offend CRAN checks, use Levenberg-Marquardt for speed fits <- mmkin(c("FOMC", "HS"), list("FOCUS B" = FOCUS_2006_B, "FOCUS C" = FOCUS_2006_C), cores = 1, quiet = TRUE, method.modFit = "Marq") @@ -160,7 +162,7 @@@@ -109,7 +114,7 @@ -Developed by Johannes Ranke, Eurofins Regulatory AG.
+Developed by Johannes Ranke.
diff --git a/docs/reference/print.mkinds.html b/docs/reference/print.mkinds.html index a586a103..9bd088b1 100644 --- a/docs/reference/print.mkinds.html +++ b/docs/reference/print.mkinds.html @@ -61,7 +61,12 @@ -Developed by Johannes Ranke, Eurofins Regulatory AG.
+Developed by Johannes Ranke.
diff --git a/docs/reference/print.mkinmod.html b/docs/reference/print.mkinmod.html index 73bfd60e..11b96036 100644 --- a/docs/reference/print.mkinmod.html +++ b/docs/reference/print.mkinmod.html @@ -61,7 +61,12 @@@@ -109,7 +114,7 @@ -Developed by Johannes Ranke, Eurofins Regulatory AG.
+Developed by Johannes Ranke.
diff --git a/docs/reference/schaefer07_complex_case.html b/docs/reference/schaefer07_complex_case.html index 4714747a..526dde10 100644 --- a/docs/reference/schaefer07_complex_case.html +++ b/docs/reference/schaefer07_complex_case.html @@ -61,7 +61,12 @@@@ -106,17 +111,14 @@ Symposium Pesticide Chemistry, Piacenza, 2007, p. 916-923. -- - Examples -
+Examples
+ A2 = list(type = "SFO"), use_of_ff = "max")data <- mkin_wide_to_long(schaefer07_complex_case, time = "time") model <- mkinmod( parent = list(type = "SFO", to = c("A1", "B1", "C1"), sink = FALSE), A1 = list(type = "SFO", to = "A2"), B1 = list(type = "SFO"), C1 = list(type = "SFO"), - A2 = list(type = "SFO"), use_of_ff = "max")Successfully compiled differential equation model from auto-generated C code.## Not run: mkinfit(model, data, plot=TRUE)#>## Not run: mkinfit(model, data, plot=TRUE)
+#> 118 parent 0.39 1.351 -0.9613 @@ -117,10 +122,7 @@ measurement error in analytical chemistry. Technometrics 37(2), 176-184. -#> mkin version: 0.9.44.9000 -#> R version: 3.3.1 -#> Date of fit: Wed Oct 26 23:50:50 2016 -#> Date of summary: Wed Oct 26 23:50:50 2016 +#> R version: 3.3.2 +#> Date of fit: Thu Nov 3 17:46:35 2016 +#> Date of summary: Thu Nov 3 17:46:35 2016 #> #> Equations: #> d_parent = - k_parent_sink * parent #> #> Model predictions using solution type analytical #> -#> Fitted with method Port using 35 model solutions performed in 0.083 s +#> Fitted with method Port using 35 model solutions performed in 0.08 s #> #> Weighting: none #> @@ -209,8 +211,7 @@ #> 30 parent 29.71 35.738 -6.0283 #> 62 parent 5.98 10.862 -4.8818 #> 90 parent 1.54 3.831 -2.2911 -#> 118 parent 0.39 1.351 -0.9613 -#>
## Not run: ------------------------------------ # m_synth_SFO_lin <- mkinmod(parent = list(type = "SFO", to = "M1"), # M1 = list(type = "SFO", to = "M2"), @@ -160,7 +162,7 @@@@ -83,7 +88,7 @@ constants and other paramters that can only take on positive values, a simple log transformation is used. For compositional parameters, such as the formations fractions that should always sum up to 1 and can not be - negative, the -Developed by Johannes Ranke, Eurofins Regulatory AG.
+Developed by Johannes Ranke.
diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index ab5ce062..ccd56ca4 100644 --- a/docs/reference/transform_odeparms.html +++ b/docs/reference/transform_odeparms.html @@ -61,7 +61,12 @@ilr
transformation is used. + negative, theilr
transformation is used.The transformation of sets of formation fractions is fragile, as it supposes the same ordering of the components in forward and backward transformation. @@ -109,7 +114,7 @@
mkinmod
, containing the names of
the model variables that are needed for grouping the formation fractions
- before ilr
transformation, the parameter names and
+ before ilr
transformation, the parameter names and
the information if the pathway to sink is included in the model.
ilr
+ transformation used for these transformations is the ilr
transformation.
@@ -139,18 +144,15 @@
as the original parameters.
- Successfully compiled differential equation model from auto-generated C code.# Fit the model to the FOCUS example dataset D using defaults + m1 = list(type = "SFO"))#># Fit the model to the FOCUS example dataset D using defaults fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE) summary(fit, data=FALSE) # See transformed and backtransformed parameters#> mkin version: 0.9.44.9000 -#> R version: 3.3.1 -#> Date of fit: Wed Oct 26 23:50:51 2016 -#> Date of summary: Wed Oct 26 23:50:51 2016 +#> R version: 3.3.2 +#> Date of fit: Thu Nov 3 17:46:36 2016 +#> Date of summary: Thu Nov 3 17:46:36 2016 #> #> Equations: #> d_parent = - k_parent_sink * parent - k_parent_m1 * parent @@ -158,7 +160,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 153 model solutions performed in 0.629 s +#> Fitted with method Port using 153 model solutions performed in 0.657 s #> #> Weighting: none #> @@ -221,8 +223,7 @@ #> Estimated disappearance times: #> DT50 DT90 #> parent 7.023 23.33 -#> m1 131.761 437.70 -#>+#> m1 131.761 437.70## Not run: ------------------------------------ # fit.2 <- mkinfit(SFO_SFO, FOCUS_2006_D, transform_rates = FALSE) # summary(fit.2, data=FALSE) @@ -233,10 +234,8 @@ transformed <- fit$start_transformed$value names(transformed) <- rownames(fit$start_transformed) transform_odeparms(initials, SFO_SFO)#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink -#> 100.750000 -2.302585 -2.301586 -2.300587 -#>backtransform_odeparms(transformed, SFO_SFO)#> parent_0 k_parent_sink k_parent_m1 k_m1_sink -#> 100.7500 0.1000 0.1001 0.1002 -#>+#> 100.750000 -2.302585 -2.301586 -2.300587backtransform_odeparms(transformed, SFO_SFO)#> parent_0 k_parent_sink k_parent_m1 k_m1_sink +#> 100.7500 0.1000 0.1001 0.1002## Not run: ------------------------------------ # # The case of formation fractions # SFO_SFO.ff <- mkinmod( @@ -280,7 +279,7 @@ -Developed by Johannes Ranke, Eurofins Regulatory AG.
+Developed by Johannes Ranke.
-- cgit v1.2.1