From 38f9e15f0c972c1516ae737a2bca8d7789581bbd Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 6 Oct 2016 09:19:21 +0200 Subject: Static documentation rebuilt by pkgdown::build_site() --- docs/reference/DFOP.solution.html | 132 +++ docs/reference/Extract.mmkin.html | 1192 ++++++++++++++++++++++++ docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html | 129 +++ docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html | 128 +++ docs/reference/FOCUS_2006_HS_ref_A_to_F.html | 129 +++ docs/reference/FOCUS_2006_SFO_ref_A_to_F.html | 127 +++ docs/reference/FOCUS_2006_datasets.html | 130 +++ docs/reference/FOMC.solution.html | 147 +++ docs/reference/HS.solution.html | 131 +++ docs/reference/IORE.solution.html | 149 +++ docs/reference/SFO.solution.html | 124 +++ docs/reference/SFORB.solution.html | 133 +++ docs/reference/add_err.html | 196 ++++ docs/reference/endpoints.html | 123 +++ docs/reference/geometric_mean.html | 115 +++ docs/reference/ilr.html | 152 +++ docs/reference/index.html | 111 +++ docs/reference/mccall81_245T.html | 229 +++++ docs/reference/mkin_long_to_wide.html | 152 +++ docs/reference/mkin_wide_to_long.html | 131 +++ docs/reference/mkinds.html | 120 +++ docs/reference/mkinerrmin.html | 150 +++ docs/reference/mkinfit.html | 531 +++++++++++ docs/reference/mkinmod.html | 206 ++++ docs/reference/mkinparplot.html | 122 +++ docs/reference/mkinplot.html | 118 +++ docs/reference/mkinpredict.html | 318 +++++++ docs/reference/mkinresplot.html | 166 ++++ docs/reference/mkinsub.html | 147 +++ docs/reference/mmkin.html | 178 ++++ docs/reference/plot.mkinfit.html | 231 +++++ docs/reference/plot.mmkin.html | 156 ++++ docs/reference/print.mkinds.html | 109 +++ docs/reference/print.mkinmod.html | 109 +++ docs/reference/schaefer07_complex_case.html | 131 +++ docs/reference/summary.mkinfit.html | 229 +++++ docs/reference/synthetic_data_for_UBA.html | 157 ++++ docs/reference/transform_odeparms.html | 276 ++++++ docs/reference/unknown-10.png | Bin 0 -> 18197 bytes docs/reference/unknown-2.png | Bin 0 -> 10552 bytes docs/reference/unknown-4.png | Bin 0 -> 10559 bytes docs/reference/unknown-6.png | Bin 0 -> 7945 bytes docs/reference/unknown-8.png | Bin 0 -> 13728 bytes 43 files changed, 7314 insertions(+) create mode 100644 docs/reference/DFOP.solution.html create mode 100644 docs/reference/Extract.mmkin.html create mode 100644 docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html create mode 100644 docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html create mode 100644 docs/reference/FOCUS_2006_HS_ref_A_to_F.html create mode 100644 docs/reference/FOCUS_2006_SFO_ref_A_to_F.html create mode 100644 docs/reference/FOCUS_2006_datasets.html create mode 100644 docs/reference/FOMC.solution.html create mode 100644 docs/reference/HS.solution.html create mode 100644 docs/reference/IORE.solution.html create mode 100644 docs/reference/SFO.solution.html create mode 100644 docs/reference/SFORB.solution.html create mode 100644 docs/reference/add_err.html create mode 100644 docs/reference/endpoints.html create mode 100644 docs/reference/geometric_mean.html create mode 100644 docs/reference/ilr.html create mode 100644 docs/reference/index.html create mode 100644 docs/reference/mccall81_245T.html create mode 100644 docs/reference/mkin_long_to_wide.html create mode 100644 docs/reference/mkin_wide_to_long.html create mode 100644 docs/reference/mkinds.html create mode 100644 docs/reference/mkinerrmin.html create mode 100644 docs/reference/mkinfit.html create mode 100644 docs/reference/mkinmod.html create mode 100644 docs/reference/mkinparplot.html create mode 100644 docs/reference/mkinplot.html create mode 100644 docs/reference/mkinpredict.html create mode 100644 docs/reference/mkinresplot.html create mode 100644 docs/reference/mkinsub.html create mode 100644 docs/reference/mmkin.html create mode 100644 docs/reference/plot.mkinfit.html create mode 100644 docs/reference/plot.mmkin.html create mode 100644 docs/reference/print.mkinds.html create mode 100644 docs/reference/print.mkinmod.html create mode 100644 docs/reference/schaefer07_complex_case.html create mode 100644 docs/reference/summary.mkinfit.html create mode 100644 docs/reference/synthetic_data_for_UBA.html create mode 100644 docs/reference/transform_odeparms.html create mode 100644 docs/reference/unknown-10.png create mode 100644 docs/reference/unknown-2.png create mode 100644 docs/reference/unknown-4.png create mode 100644 docs/reference/unknown-6.png create mode 100644 docs/reference/unknown-8.png (limited to 'docs/reference') diff --git a/docs/reference/DFOP.solution.html b/docs/reference/DFOP.solution.html new file mode 100644 index 00000000..3422c206 --- /dev/null +++ b/docs/reference/DFOP.solution.html @@ -0,0 +1,132 @@ + + + + + + + + +DFOP.solution. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Function describing decline from a defined starting value using the sum + of two exponential decline functions.

+ + +
DFOP.solution(t, parent.0, k1, k2, g)
+ +

Arguments

+
+
t
+
Time.
+
parent.0
+
Starting value for the response variable at time zero.
+
k1
+
First kinetic constant.
+
k2
+
Second kinetic constant.
+
g
+
Fraction of the starting value declining according to the + first kinetic constant. +
+
+ +
+

Value

+ +

The value of the response variable at time t.

+
+ +
+

References

+ +

FOCUS (2006) “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, + http://focus.jrc.ec.europa.eu/dk

+
+ +

Examples

+
plot(function(x) DFOP.solution(x, 100, 5, 0.5, 0.3), 0, 4, ylim=c(0,100))
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/Extract.mmkin.html b/docs/reference/Extract.mmkin.html new file mode 100644 index 00000000..b811eb95 --- /dev/null +++ b/docs/reference/Extract.mmkin.html @@ -0,0 +1,1192 @@ + + + + + + + + +[.mmkin. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Subsetting method for mmkin objects.

+ + +
# S3 method for mmkin
+[(x, i, j, ..., drop = FALSE)
+ +

Arguments

+
+
x
+
An mmkin object
+
i
+
Row index selecting the fits for specific models
+
j
+
Column index selecting the fits to specific datasets
+
...
+
Not used, only there to satisfy the generic method definition
+
drop
+
If FALSE, the method always returns an mmkin object, otherwise either + a list of mkinfit objects or a single mkinfit object.
+
+ +
+

Value

+ +

An object of class mmkin.

+
+ +

Examples

+
# 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) + fits["FOMC", ]
#> dataset +#> model B C +#> FOMC List,42 List,42 +#> attr(,"class") +#> [1] "mmkin" +#>
fits[, "B"]
#> dataset +#> model B +#> SFO List,42 +#> FOMC List,42 +#> attr(,"class") +#> [1] "mmkin" +#>
fits[, "B", drop = TRUE]$FOMC
#> $par +#> parent_0 log_alpha log_beta +#> 99.666193 2.549849 5.050586 +#> +#> $ssr +#> [1] 28.58291 +#> +#> $convergence +#> [1] 0 +#> +#> $iterations +#> [1] 21 +#> +#> $evaluations +#> function gradient +#> 25 78 +#> +#> $counts +#> [1] "both X-convergence and relative convergence (5)" +#> +#> $hessian +#> parent_0 log_alpha log_beta +#> parent_0 4.123033 -95.69983 93.17699 +#> log_alpha -95.699832 6618.85833 -6352.46648 +#> log_beta 93.176993 -6352.46648 6101.23483 +#> +#> $residuals +#> parent parent parent parent parent parent +#> 1.046192647 -3.322396479 3.655156669 -1.705316770 0.406306255 -0.123734689 +#> parent parent +#> -0.036886982 -0.006240458 +#> +#> $ms +#> [1] 3.572863 +#> +#> $var_ms +#> parent +#> 3.572863 +#> +#> $var_ms_unscaled +#> parent +#> 3.572863 +#> +#> $var_ms_unweighted +#> parent +#> 3.572863 +#> +#> $rank +#> [1] 3 +#> +#> $df.residual +#> [1] 5 +#> +#> $solution_type +#> [1] "analytical" +#> +#> $transform_rates +#> [1] TRUE +#> +#> $transform_fractions +#> [1] TRUE +#> +#> $method.modFit +#> [1] "Port" +#> +#> $maxit.modFit +#> [1] "auto" +#> +#> $calls +#> [1] 111 +#> +#> $time +#> user system elapsed +#> 0.256 0.000 0.257 +#> +#> $mkinmod +#> <mkinmod> model generated with +#> Use of formation fractions $use_of_ff: min +#> Specification $spec: +#> $parent +#> $type: FOMC; $sink: TRUE +#> +#> $observed +#> name time value +#> 1 parent 0 98.62 +#> 2 parent 3 81.43 +#> 3 parent 7 53.18 +#> 4 parent 14 34.89 +#> 5 parent 30 10.09 +#> 6 parent 62 1.50 +#> 7 parent 90 0.33 +#> 8 parent 118 0.08 +#> +#> $obs_vars +#> [1] "parent" +#> +#> $predicted +#> name time value +#> 1 parent 0.000000 99.66619265 +#> 2 parent 1.191919 90.41690342 +#> 3 parent 2.383838 82.08630014 +#> 4 parent 3.000000 78.10760352 +#> 5 parent 3.575758 74.57722848 +#> 6 parent 4.767677 67.80342415 +#> 7 parent 5.959596 61.68822425 +#> 8 parent 7.000000 56.83515667 +#> 9 parent 7.151515 56.16343898 +#> 10 parent 8.343434 51.16836285 +#> 11 parent 9.535354 46.64890734 +#> 12 parent 10.727273 42.55683931 +#> 13 parent 11.919192 38.84911158 +#> 14 parent 13.111111 35.48727414 +#> 15 parent 14.000000 33.18468323 +#> 16 parent 14.303030 32.43695565 +#> 17 parent 15.494949 29.66740651 +#> 18 parent 16.686869 27.15109578 +#> 19 parent 17.878788 24.86335532 +#> 20 parent 19.070707 22.78206538 +#> 21 parent 20.262626 20.88737647 +#> 22 parent 21.454545 19.16146324 +#> 23 parent 22.646465 17.58830644 +#> 24 parent 23.838384 16.15349953 +#> 25 parent 25.030303 14.84407724 +#> 26 parent 26.222222 13.64836315 +#> 27 parent 27.414141 12.55583436 +#> 28 parent 28.606061 11.55700107 +#> 29 parent 29.797980 10.64329940 +#> 30 parent 30.000000 10.49630626 +#> 31 parent 30.989899 9.80699593 +#> 32 parent 32.181818 9.04110261 +#> 33 parent 33.373737 8.33930082 +#> 34 parent 34.565657 7.69587362 +#> 35 parent 35.757576 7.10564515 +#> 36 parent 36.949495 6.56392657 +#> 37 parent 38.141414 6.06646759 +#> 38 parent 39.333333 5.60941311 +#> 39 parent 40.525253 5.18926438 +#> 40 parent 41.717172 4.80284421 +#> 41 parent 42.909091 4.44726569 +#> 42 parent 44.101010 4.11990420 +#> 43 parent 45.292929 3.81837216 +#> 44 parent 46.484848 3.54049644 +#> 45 parent 47.676768 3.28429799 +#> 46 parent 48.868687 3.04797350 +#> 47 parent 50.060606 2.82987892 +#> 48 parent 51.252525 2.62851456 +#> 49 parent 52.444444 2.44251172 +#> 50 parent 53.636364 2.27062056 +#> 51 parent 54.828283 2.11169922 +#> 52 parent 56.020202 1.96470393 +#> 53 parent 57.212121 1.82868009 +#> 54 parent 58.404040 1.70275424 +#> 55 parent 59.595960 1.58612677 +#> 56 parent 60.787879 1.47806529 +#> 57 parent 61.979798 1.37789865 +#> 58 parent 62.000000 1.37626531 +#> 59 parent 63.171717 1.28501157 +#> 60 parent 64.363636 1.19883967 +#> 61 parent 65.555556 1.11886504 +#> 62 parent 66.747475 1.04461220 +#> 63 parent 67.939394 0.97564441 +#> 64 parent 69.131313 0.91156031 +#> 65 parent 70.323232 0.85199096 +#> 66 parent 71.515152 0.79659697 +#> 67 parent 72.707071 0.74506609 +#> 68 parent 73.898990 0.69711084 +#> 69 parent 75.090909 0.65246649 +#> 70 parent 76.282828 0.61088912 +#> 71 parent 77.474747 0.57215389 +#> 72 parent 78.666667 0.53605348 +#> 73 parent 79.858586 0.50239663 +#> 74 parent 81.050505 0.47100683 +#> 75 parent 82.242424 0.44172111 +#> 76 parent 83.434343 0.41438896 +#> 77 parent 84.626263 0.38887128 +#> 78 parent 85.818182 0.36503953 +#> 79 parent 87.010101 0.34277481 +#> 80 parent 88.202020 0.32196716 +#> 81 parent 89.393939 0.30251479 +#> 82 parent 90.000000 0.29311302 +#> 83 parent 90.585859 0.28432347 +#> 84 parent 91.777778 0.26730596 +#> 85 parent 92.969697 0.25138141 +#> 86 parent 94.161616 0.23647487 +#> 87 parent 95.353535 0.22251689 +#> 88 parent 96.545455 0.20944302 +#> 89 parent 97.737374 0.19719349 +#> 90 parent 98.929293 0.18571281 +#> 91 parent 100.121212 0.17494947 +#> 92 parent 101.313131 0.16485560 +#> 93 parent 102.505051 0.15538676 +#> 94 parent 103.696970 0.14650163 +#> 95 parent 104.888889 0.13816179 +#> 96 parent 106.080808 0.13033150 +#> 97 parent 107.272727 0.12297753 +#> 98 parent 108.464646 0.11606895 +#> 99 parent 109.656566 0.10957695 +#> 100 parent 110.848485 0.10347470 +#> 101 parent 112.040404 0.09773723 +#> 102 parent 113.232323 0.09234125 +#> 103 parent 114.424242 0.08726506 +#> 104 parent 115.616162 0.08248842 +#> 105 parent 116.808081 0.07799245 +#> 106 parent 118.000000 0.07375954 +#> +#> $cost +#> function (P) +#> { +#> assign("calls", calls + 1, inherits = TRUE) +#> if (trace_parms) +#> cat(P, "\n") +#> if (length(state.ini.optim) > 0) { +#> odeini <- c(P[1:length(state.ini.optim)], state.ini.fixed) +#> names(odeini) <- c(state.ini.optim.boxnames, state.ini.fixed.boxnames) +#> } +#> else { +#> odeini <- state.ini.fixed +#> names(odeini) <- state.ini.fixed.boxnames +#> } +#> odeparms <- c(P[(length(state.ini.optim) + 1):length(P)], +#> transparms.fixed) +#> parms <- backtransform_odeparms(odeparms, mkinmod, transform_rates = transform_rates, +#> transform_fractions = transform_fractions) +#> out <- mkinpredict(mkinmod, parms, odeini, outtimes, solution_type = solution_type, +#> use_compiled = use_compiled, method.ode = method.ode, +#> atol = atol, rtol = rtol, ...) +#> assign("out_predicted", out, inherits = TRUE) +#> mC <- modCost(out, observed, y = "value", err = err, weight = weight, +#> scaleVar = scaleVar) +#> if (mC$model < cost.old) { +#> if (!quiet) +#> cat("Model cost at call ", calls, ": ", mC$model, +#> "\n") +#> if (plot) { +#> outtimes_plot = seq(min(observed$time), max(observed$time), +#> length.out = 100) +#> out_plot <- mkinpredict(mkinmod, parms, odeini, outtimes_plot, +#> solution_type = solution_type, use_compiled = use_compiled, +#> method.ode = method.ode, atol = atol, rtol = rtol, +#> ...) +#> plot(0, type = "n", xlim = range(observed$time), +#> ylim = c(0, max(observed$value, na.rm = TRUE)), +#> xlab = "Time", ylab = "Observed") +#> col_obs <- pch_obs <- 1:length(obs_vars) +#> lty_obs <- rep(1, length(obs_vars)) +#> names(col_obs) <- names(pch_obs) <- names(lty_obs) <- obs_vars +#> for (obs_var in obs_vars) { +#> points(subset(observed, name == obs_var, c(time, +#> value)), pch = pch_obs[obs_var], col = col_obs[obs_var]) +#> } +#> matlines(out_plot$time, out_plot[-1], col = col_obs, +#> lty = lty_obs) +#> legend("topright", inset = c(0.05, 0.05), legend = obs_vars, +#> col = col_obs, pch = pch_obs, lty = 1:length(pch_obs)) +#> } +#> assign("cost.old", mC$model, inherits = TRUE) +#> } +#> return(mC) +#> } +#> <environment: 0x27fc328> +#> +#> $cost_notrans +#> function (P) +#> { +#> if (length(state.ini.optim) > 0) { +#> odeini <- c(P[1:length(state.ini.optim)], state.ini.fixed) +#> names(odeini) <- c(state.ini.optim.boxnames, state.ini.fixed.boxnames) +#> } +#> else { +#> odeini <- state.ini.fixed +#> names(odeini) <- state.ini.fixed.boxnames +#> } +#> odeparms <- c(P[(length(state.ini.optim) + 1):length(P)], +#> parms.fixed) +#> out <- mkinpredict(mkinmod, odeparms, odeini, outtimes, solution_type = solution_type, +#> use_compiled = use_compiled, method.ode = method.ode, +#> atol = atol, rtol = rtol, ...) +#> mC <- modCost(out, observed, y = "value", err = err, weight = weight, +#> scaleVar = scaleVar) +#> return(mC) +#> } +#> <environment: 0x27fc328> +#> +#> $hessian_notrans +#> parent_0 alpha beta +#> parent_0 4.1230329 -7.473531 0.5968527 +#> alpha -7.4735307 40.365690 -3.1777189 +#> beta 0.5968527 -3.177719 0.2503425 +#> +#> $start +#> value type +#> parent_0 98.62 state +#> alpha 1.00 deparm +#> beta 10.00 deparm +#> +#> $start_transformed +#> value lower upper +#> parent_0 98.620000 -Inf Inf +#> log_alpha 0.000000 -Inf Inf +#> log_beta 2.302585 -Inf Inf +#> +#> $fixed +#> [1] value type +#> <0 rows> (or 0-length row.names) +#> +#> $data +#> time variable observed predicted residual +#> 1 0 parent 98.62 99.66619265 -1.046192647 +#> 2 3 parent 81.43 78.10760352 3.322396479 +#> 3 7 parent 53.18 56.83515667 -3.655156669 +#> 4 14 parent 34.89 33.18468323 1.705316770 +#> 5 30 parent 10.09 10.49630626 -0.406306255 +#> 6 62 parent 1.50 1.37626531 0.123734689 +#> 7 90 parent 0.33 0.29311302 0.036886982 +#> 8 118 parent 0.08 0.07375954 0.006240458 +#> +#> $atol +#> [1] 1e-08 +#> +#> $rtol +#> [1] 1e-10 +#> +#> $weight.ini +#> [1] "none" +#> +#> $reweight.tol +#> [1] 1e-08 +#> +#> $reweight.max.iter +#> [1] 10 +#> +#> $bparms.optim +#> parent_0 alpha beta +#> 99.66619 12.80517 156.11390 +#> +#> $bparms.fixed +#> numeric(0) +#> +#> $bparms.ode +#> alpha beta +#> 12.80517 156.11390 +#> +#> $bparms.state +#> parent +#> 99.66619 +#> +#> $date +#> [1] "Thu Oct 6 09:17:52 2016" +#> +#> attr(,"class") +#> [1] "mkinfit" "modFit" +#>
fits["SFO", "B"]
#> dataset +#> model B +#> SFO List,42 +#> attr(,"class") +#> [1] "mmkin" +#>
fits[["SFO", "B"]] # This is equivalent to
#> $par +#> parent_0 log_k_parent_sink +#> 99.174072 -2.549028 +#> +#> $ssr +#> [1] 30.65564 +#> +#> $convergence +#> [1] 0 +#> +#> $iterations +#> [1] 5 +#> +#> $evaluations +#> function gradient +#> 8 15 +#> +#> $counts +#> [1] "relative convergence (4)" +#> +#> $hessian +#> parent_0 log_k_parent_sink +#> parent_0 4.163631 -94.09343 +#> log_k_parent_sink -94.093431 6311.34610 +#> +#> $residuals +#> parent parent parent parent parent parent +#> 0.55407218 -2.98452128 4.20445742 -1.68599939 -0.58185357 -0.72033730 +#> parent parent +#> -0.24260405 -0.07020339 +#> +#> $ms +#> [1] 3.831956 +#> +#> $var_ms +#> parent +#> 3.831956 +#> +#> $var_ms_unscaled +#> parent +#> 3.831956 +#> +#> $var_ms_unweighted +#> parent +#> 3.831956 +#> +#> $rank +#> [1] 2 +#> +#> $df.residual +#> [1] 6 +#> +#> $solution_type +#> [1] "analytical" +#> +#> $transform_rates +#> [1] TRUE +#> +#> $transform_fractions +#> [1] TRUE +#> +#> $method.modFit +#> [1] "Port" +#> +#> $maxit.modFit +#> [1] "auto" +#> +#> $calls +#> [1] 29 +#> +#> $time +#> user system elapsed +#> 0.068 0.000 0.068 +#> +#> $mkinmod +#> <mkinmod> model generated with +#> Use of formation fractions $use_of_ff: min +#> Specification $spec: +#> $parent +#> $type: SFO; $sink: TRUE +#> Coefficient matrix $coefmat available +#> +#> $observed +#> name time value +#> 1 parent 0 98.62 +#> 2 parent 3 81.43 +#> 3 parent 7 53.18 +#> 4 parent 14 34.89 +#> 5 parent 30 10.09 +#> 6 parent 62 1.50 +#> 7 parent 90 0.33 +#> 8 parent 118 0.08 +#> +#> $obs_vars +#> [1] "parent" +#> +#> $predicted +#> name time value +#> 1 parent 0.000000 99.17407218 +#> 2 parent 1.191919 90.35253561 +#> 3 parent 2.383838 82.31567498 +#> 4 parent 3.000000 78.44547872 +#> 5 parent 3.575758 74.99369333 +#> 6 parent 4.767677 68.32300215 +#> 7 parent 5.959596 62.24566915 +#> 8 parent 7.000000 57.38445742 +#> 9 parent 7.151515 56.70891509 +#> 10 parent 8.343434 51.66465547 +#> 11 parent 9.535354 47.06908288 +#> 12 parent 10.727273 42.88228661 +#> 13 parent 11.919192 39.06790599 +#> 14 parent 13.111111 35.59281463 +#> 15 parent 14.000000 33.20400061 +#> 16 parent 14.303030 32.42683275 +#> 17 parent 15.494949 29.54246504 +#> 18 parent 16.686869 26.91466193 +#> 19 parent 17.878788 24.52060198 +#> 20 parent 19.070707 22.33949373 +#> 21 parent 20.262626 20.35239512 +#> 22 parent 21.454545 18.54204899 +#> 23 parent 22.646465 16.89273320 +#> 24 parent 23.838384 15.39012410 +#> 25 parent 25.030303 14.02117212 +#> 26 parent 26.222222 12.77398846 +#> 27 parent 27.414141 11.63774182 +#> 28 parent 28.606061 10.60256435 +#> 29 parent 29.797980 9.65946594 +#> 30 parent 30.000000 9.50814643 +#> 31 parent 30.989899 8.80025617 +#> 32 parent 32.181818 8.01747313 +#> 33 parent 33.373737 7.30431867 +#> 34 parent 34.565657 6.65459931 +#> 35 parent 35.757576 6.06267251 +#> 36 parent 36.949495 5.52339762 +#> 37 parent 38.141414 5.03209124 +#> 38 parent 39.333333 4.58448658 +#> 39 parent 40.525253 4.17669637 +#> 40 parent 41.717172 3.80517911 +#> 41 parent 42.909091 3.46670832 +#> 42 parent 44.101010 3.15834451 +#> 43 parent 45.292929 2.87740968 +#> 44 parent 46.484848 2.62146400 +#> 45 parent 47.676768 2.38828471 +#> 46 parent 48.868687 2.17584671 +#> 47 parent 50.060606 1.98230508 +#> 48 parent 51.252525 1.80597899 +#> 49 parent 52.444444 1.64533711 +#> 50 parent 53.636364 1.49898432 +#> 51 parent 54.828283 1.36564963 +#> 52 parent 56.020202 1.24417505 +#> 53 parent 57.212121 1.13350565 +#> 54 parent 58.404040 1.03268029 +#> 55 parent 59.595960 0.94082335 +#> 56 parent 60.787879 0.85713708 +#> 57 parent 61.979798 0.78089471 +#> 58 parent 62.000000 0.77966270 +#> 59 parent 63.171717 0.71143411 +#> 60 parent 64.363636 0.64815202 +#> 61 parent 65.555556 0.59049888 +#> 62 parent 66.747475 0.53797399 +#> 63 parent 67.939394 0.49012119 +#> 64 parent 69.131313 0.44652489 +#> 65 parent 70.323232 0.40680649 +#> 66 parent 71.515152 0.37062104 +#> 67 parent 72.707071 0.33765429 +#> 68 parent 73.898990 0.30761993 +#> 69 parent 75.090909 0.28025713 +#> 70 parent 76.282828 0.25532825 +#> 71 parent 77.474747 0.23261679 +#> 72 parent 78.666667 0.21192552 +#> 73 parent 79.858586 0.19307474 +#> 74 parent 81.050505 0.17590074 +#> 75 parent 82.242424 0.16025436 +#> 76 parent 83.434343 0.14599973 +#> 77 parent 84.626263 0.13301305 +#> 78 parent 85.818182 0.12118154 +#> 79 parent 87.010101 0.11040244 +#> 80 parent 88.202020 0.10058214 +#> 81 parent 89.393939 0.09163535 +#> 82 parent 90.000000 0.08739595 +#> 83 parent 90.585859 0.08348439 +#> 84 parent 91.777778 0.07605845 +#> 85 parent 92.969697 0.06929305 +#> 86 parent 94.161616 0.06312943 +#> 87 parent 95.353535 0.05751406 +#> 88 parent 96.545455 0.05239819 +#> 89 parent 97.737374 0.04773737 +#> 90 parent 98.929293 0.04349113 +#> 91 parent 100.121212 0.03962259 +#> 92 parent 101.313131 0.03609816 +#> 93 parent 102.505051 0.03288723 +#> 94 parent 103.696970 0.02996191 +#> 95 parent 104.888889 0.02729679 +#> 96 parent 106.080808 0.02486874 +#> 97 parent 107.272727 0.02265667 +#> 98 parent 108.464646 0.02064136 +#> 99 parent 109.656566 0.01880531 +#> 100 parent 110.848485 0.01713257 +#> 101 parent 112.040404 0.01560863 +#> 102 parent 113.232323 0.01422024 +#> 103 parent 114.424242 0.01295535 +#> 104 parent 115.616162 0.01180297 +#> 105 parent 116.808081 0.01075310 +#> 106 parent 118.000000 0.00979661 +#> +#> $cost +#> function (P) +#> { +#> assign("calls", calls + 1, inherits = TRUE) +#> if (trace_parms) +#> cat(P, "\n") +#> if (length(state.ini.optim) > 0) { +#> odeini <- c(P[1:length(state.ini.optim)], state.ini.fixed) +#> names(odeini) <- c(state.ini.optim.boxnames, state.ini.fixed.boxnames) +#> } +#> else { +#> odeini <- state.ini.fixed +#> names(odeini) <- state.ini.fixed.boxnames +#> } +#> odeparms <- c(P[(length(state.ini.optim) + 1):length(P)], +#> transparms.fixed) +#> parms <- backtransform_odeparms(odeparms, mkinmod, transform_rates = transform_rates, +#> transform_fractions = transform_fractions) +#> out <- mkinpredict(mkinmod, parms, odeini, outtimes, solution_type = solution_type, +#> use_compiled = use_compiled, method.ode = method.ode, +#> atol = atol, rtol = rtol, ...) +#> assign("out_predicted", out, inherits = TRUE) +#> mC <- modCost(out, observed, y = "value", err = err, weight = weight, +#> scaleVar = scaleVar) +#> if (mC$model < cost.old) { +#> if (!quiet) +#> cat("Model cost at call ", calls, ": ", mC$model, +#> "\n") +#> if (plot) { +#> outtimes_plot = seq(min(observed$time), max(observed$time), +#> length.out = 100) +#> out_plot <- mkinpredict(mkinmod, parms, odeini, outtimes_plot, +#> solution_type = solution_type, use_compiled = use_compiled, +#> method.ode = method.ode, atol = atol, rtol = rtol, +#> ...) +#> plot(0, type = "n", xlim = range(observed$time), +#> ylim = c(0, max(observed$value, na.rm = TRUE)), +#> xlab = "Time", ylab = "Observed") +#> col_obs <- pch_obs <- 1:length(obs_vars) +#> lty_obs <- rep(1, length(obs_vars)) +#> names(col_obs) <- names(pch_obs) <- names(lty_obs) <- obs_vars +#> for (obs_var in obs_vars) { +#> points(subset(observed, name == obs_var, c(time, +#> value)), pch = pch_obs[obs_var], col = col_obs[obs_var]) +#> } +#> matlines(out_plot$time, out_plot[-1], col = col_obs, +#> lty = lty_obs) +#> legend("topright", inset = c(0.05, 0.05), legend = obs_vars, +#> col = col_obs, pch = pch_obs, lty = 1:length(pch_obs)) +#> } +#> assign("cost.old", mC$model, inherits = TRUE) +#> } +#> return(mC) +#> } +#> <environment: 0x2e966b0> +#> +#> $cost_notrans +#> function (P) +#> { +#> if (length(state.ini.optim) > 0) { +#> odeini <- c(P[1:length(state.ini.optim)], state.ini.fixed) +#> names(odeini) <- c(state.ini.optim.boxnames, state.ini.fixed.boxnames) +#> } +#> else { +#> odeini <- state.ini.fixed +#> names(odeini) <- state.ini.fixed.boxnames +#> } +#> odeparms <- c(P[(length(state.ini.optim) + 1):length(P)], +#> parms.fixed) +#> out <- mkinpredict(mkinmod, odeparms, odeini, outtimes, solution_type = solution_type, +#> use_compiled = use_compiled, method.ode = method.ode, +#> atol = atol, rtol = rtol, ...) +#> mC <- modCost(out, observed, y = "value", err = err, weight = weight, +#> scaleVar = scaleVar) +#> return(mC) +#> } +#> <environment: 0x2e966b0> +#> +#> $hessian_notrans +#> parent_0 k_parent_sink +#> parent_0 4.163631 -1203.894 +#> k_parent_sink -1203.893702 1033188.753 +#> +#> $start +#> value type +#> parent_0 98.62 state +#> k_parent_sink 0.10 deparm +#> +#> $start_transformed +#> value lower upper +#> parent_0 98.620000 -Inf Inf +#> log_k_parent_sink -2.302585 -Inf Inf +#> +#> $fixed +#> [1] value type +#> <0 rows> (or 0-length row.names) +#> +#> $data +#> time variable observed predicted residual +#> 1 0 parent 98.62 99.17407218 -0.55407218 +#> 2 3 parent 81.43 78.44547872 2.98452128 +#> 3 7 parent 53.18 57.38445742 -4.20445742 +#> 4 14 parent 34.89 33.20400061 1.68599939 +#> 5 30 parent 10.09 9.50814643 0.58185357 +#> 6 62 parent 1.50 0.77966270 0.72033730 +#> 7 90 parent 0.33 0.08739595 0.24260405 +#> 8 118 parent 0.08 0.00979661 0.07020339 +#> +#> $atol +#> [1] 1e-08 +#> +#> $rtol +#> [1] 1e-10 +#> +#> $weight.ini +#> [1] "none" +#> +#> $reweight.tol +#> [1] 1e-08 +#> +#> $reweight.max.iter +#> [1] 10 +#> +#> $bparms.optim +#> parent_0 k_parent_sink +#> 99.17407218 0.07815759 +#> +#> $bparms.fixed +#> numeric(0) +#> +#> $bparms.ode +#> k_parent_sink +#> 0.07815759 +#> +#> $bparms.state +#> parent +#> 99.17407 +#> +#> $date +#> [1] "Thu Oct 6 09:17:51 2016" +#> +#> attr(,"class") +#> [1] "mkinfit" "modFit" +#>
fits["SFO", "B", drop = TRUE]
#> [[1]] +#> $par +#> parent_0 log_k_parent_sink +#> 99.174072 -2.549028 +#> +#> $ssr +#> [1] 30.65564 +#> +#> $convergence +#> [1] 0 +#> +#> $iterations +#> [1] 5 +#> +#> $evaluations +#> function gradient +#> 8 15 +#> +#> $counts +#> [1] "relative convergence (4)" +#> +#> $hessian +#> parent_0 log_k_parent_sink +#> parent_0 4.163631 -94.09343 +#> log_k_parent_sink -94.093431 6311.34610 +#> +#> $residuals +#> parent parent parent parent parent parent +#> 0.55407218 -2.98452128 4.20445742 -1.68599939 -0.58185357 -0.72033730 +#> parent parent +#> -0.24260405 -0.07020339 +#> +#> $ms +#> [1] 3.831956 +#> +#> $var_ms +#> parent +#> 3.831956 +#> +#> $var_ms_unscaled +#> parent +#> 3.831956 +#> +#> $var_ms_unweighted +#> parent +#> 3.831956 +#> +#> $rank +#> [1] 2 +#> +#> $df.residual +#> [1] 6 +#> +#> $solution_type +#> [1] "analytical" +#> +#> $transform_rates +#> [1] TRUE +#> +#> $transform_fractions +#> [1] TRUE +#> +#> $method.modFit +#> [1] "Port" +#> +#> $maxit.modFit +#> [1] "auto" +#> +#> $calls +#> [1] 29 +#> +#> $time +#> user system elapsed +#> 0.068 0.000 0.068 +#> +#> $mkinmod +#> <mkinmod> model generated with +#> Use of formation fractions $use_of_ff: min +#> Specification $spec: +#> $parent +#> $type: SFO; $sink: TRUE +#> Coefficient matrix $coefmat available +#> +#> $observed +#> name time value +#> 1 parent 0 98.62 +#> 2 parent 3 81.43 +#> 3 parent 7 53.18 +#> 4 parent 14 34.89 +#> 5 parent 30 10.09 +#> 6 parent 62 1.50 +#> 7 parent 90 0.33 +#> 8 parent 118 0.08 +#> +#> $obs_vars +#> [1] "parent" +#> +#> $predicted +#> name time value +#> 1 parent 0.000000 99.17407218 +#> 2 parent 1.191919 90.35253561 +#> 3 parent 2.383838 82.31567498 +#> 4 parent 3.000000 78.44547872 +#> 5 parent 3.575758 74.99369333 +#> 6 parent 4.767677 68.32300215 +#> 7 parent 5.959596 62.24566915 +#> 8 parent 7.000000 57.38445742 +#> 9 parent 7.151515 56.70891509 +#> 10 parent 8.343434 51.66465547 +#> 11 parent 9.535354 47.06908288 +#> 12 parent 10.727273 42.88228661 +#> 13 parent 11.919192 39.06790599 +#> 14 parent 13.111111 35.59281463 +#> 15 parent 14.000000 33.20400061 +#> 16 parent 14.303030 32.42683275 +#> 17 parent 15.494949 29.54246504 +#> 18 parent 16.686869 26.91466193 +#> 19 parent 17.878788 24.52060198 +#> 20 parent 19.070707 22.33949373 +#> 21 parent 20.262626 20.35239512 +#> 22 parent 21.454545 18.54204899 +#> 23 parent 22.646465 16.89273320 +#> 24 parent 23.838384 15.39012410 +#> 25 parent 25.030303 14.02117212 +#> 26 parent 26.222222 12.77398846 +#> 27 parent 27.414141 11.63774182 +#> 28 parent 28.606061 10.60256435 +#> 29 parent 29.797980 9.65946594 +#> 30 parent 30.000000 9.50814643 +#> 31 parent 30.989899 8.80025617 +#> 32 parent 32.181818 8.01747313 +#> 33 parent 33.373737 7.30431867 +#> 34 parent 34.565657 6.65459931 +#> 35 parent 35.757576 6.06267251 +#> 36 parent 36.949495 5.52339762 +#> 37 parent 38.141414 5.03209124 +#> 38 parent 39.333333 4.58448658 +#> 39 parent 40.525253 4.17669637 +#> 40 parent 41.717172 3.80517911 +#> 41 parent 42.909091 3.46670832 +#> 42 parent 44.101010 3.15834451 +#> 43 parent 45.292929 2.87740968 +#> 44 parent 46.484848 2.62146400 +#> 45 parent 47.676768 2.38828471 +#> 46 parent 48.868687 2.17584671 +#> 47 parent 50.060606 1.98230508 +#> 48 parent 51.252525 1.80597899 +#> 49 parent 52.444444 1.64533711 +#> 50 parent 53.636364 1.49898432 +#> 51 parent 54.828283 1.36564963 +#> 52 parent 56.020202 1.24417505 +#> 53 parent 57.212121 1.13350565 +#> 54 parent 58.404040 1.03268029 +#> 55 parent 59.595960 0.94082335 +#> 56 parent 60.787879 0.85713708 +#> 57 parent 61.979798 0.78089471 +#> 58 parent 62.000000 0.77966270 +#> 59 parent 63.171717 0.71143411 +#> 60 parent 64.363636 0.64815202 +#> 61 parent 65.555556 0.59049888 +#> 62 parent 66.747475 0.53797399 +#> 63 parent 67.939394 0.49012119 +#> 64 parent 69.131313 0.44652489 +#> 65 parent 70.323232 0.40680649 +#> 66 parent 71.515152 0.37062104 +#> 67 parent 72.707071 0.33765429 +#> 68 parent 73.898990 0.30761993 +#> 69 parent 75.090909 0.28025713 +#> 70 parent 76.282828 0.25532825 +#> 71 parent 77.474747 0.23261679 +#> 72 parent 78.666667 0.21192552 +#> 73 parent 79.858586 0.19307474 +#> 74 parent 81.050505 0.17590074 +#> 75 parent 82.242424 0.16025436 +#> 76 parent 83.434343 0.14599973 +#> 77 parent 84.626263 0.13301305 +#> 78 parent 85.818182 0.12118154 +#> 79 parent 87.010101 0.11040244 +#> 80 parent 88.202020 0.10058214 +#> 81 parent 89.393939 0.09163535 +#> 82 parent 90.000000 0.08739595 +#> 83 parent 90.585859 0.08348439 +#> 84 parent 91.777778 0.07605845 +#> 85 parent 92.969697 0.06929305 +#> 86 parent 94.161616 0.06312943 +#> 87 parent 95.353535 0.05751406 +#> 88 parent 96.545455 0.05239819 +#> 89 parent 97.737374 0.04773737 +#> 90 parent 98.929293 0.04349113 +#> 91 parent 100.121212 0.03962259 +#> 92 parent 101.313131 0.03609816 +#> 93 parent 102.505051 0.03288723 +#> 94 parent 103.696970 0.02996191 +#> 95 parent 104.888889 0.02729679 +#> 96 parent 106.080808 0.02486874 +#> 97 parent 107.272727 0.02265667 +#> 98 parent 108.464646 0.02064136 +#> 99 parent 109.656566 0.01880531 +#> 100 parent 110.848485 0.01713257 +#> 101 parent 112.040404 0.01560863 +#> 102 parent 113.232323 0.01422024 +#> 103 parent 114.424242 0.01295535 +#> 104 parent 115.616162 0.01180297 +#> 105 parent 116.808081 0.01075310 +#> 106 parent 118.000000 0.00979661 +#> +#> $cost +#> function (P) +#> { +#> assign("calls", calls + 1, inherits = TRUE) +#> if (trace_parms) +#> cat(P, "\n") +#> if (length(state.ini.optim) > 0) { +#> odeini <- c(P[1:length(state.ini.optim)], state.ini.fixed) +#> names(odeini) <- c(state.ini.optim.boxnames, state.ini.fixed.boxnames) +#> } +#> else { +#> odeini <- state.ini.fixed +#> names(odeini) <- state.ini.fixed.boxnames +#> } +#> odeparms <- c(P[(length(state.ini.optim) + 1):length(P)], +#> transparms.fixed) +#> parms <- backtransform_odeparms(odeparms, mkinmod, transform_rates = transform_rates, +#> transform_fractions = transform_fractions) +#> out <- mkinpredict(mkinmod, parms, odeini, outtimes, solution_type = solution_type, +#> use_compiled = use_compiled, method.ode = method.ode, +#> atol = atol, rtol = rtol, ...) +#> assign("out_predicted", out, inherits = TRUE) +#> mC <- modCost(out, observed, y = "value", err = err, weight = weight, +#> scaleVar = scaleVar) +#> if (mC$model < cost.old) { +#> if (!quiet) +#> cat("Model cost at call ", calls, ": ", mC$model, +#> "\n") +#> if (plot) { +#> outtimes_plot = seq(min(observed$time), max(observed$time), +#> length.out = 100) +#> out_plot <- mkinpredict(mkinmod, parms, odeini, outtimes_plot, +#> solution_type = solution_type, use_compiled = use_compiled, +#> method.ode = method.ode, atol = atol, rtol = rtol, +#> ...) +#> plot(0, type = "n", xlim = range(observed$time), +#> ylim = c(0, max(observed$value, na.rm = TRUE)), +#> xlab = "Time", ylab = "Observed") +#> col_obs <- pch_obs <- 1:length(obs_vars) +#> lty_obs <- rep(1, length(obs_vars)) +#> names(col_obs) <- names(pch_obs) <- names(lty_obs) <- obs_vars +#> for (obs_var in obs_vars) { +#> points(subset(observed, name == obs_var, c(time, +#> value)), pch = pch_obs[obs_var], col = col_obs[obs_var]) +#> } +#> matlines(out_plot$time, out_plot[-1], col = col_obs, +#> lty = lty_obs) +#> legend("topright", inset = c(0.05, 0.05), legend = obs_vars, +#> col = col_obs, pch = pch_obs, lty = 1:length(pch_obs)) +#> } +#> assign("cost.old", mC$model, inherits = TRUE) +#> } +#> return(mC) +#> } +#> <environment: 0x2e966b0> +#> +#> $cost_notrans +#> function (P) +#> { +#> if (length(state.ini.optim) > 0) { +#> odeini <- c(P[1:length(state.ini.optim)], state.ini.fixed) +#> names(odeini) <- c(state.ini.optim.boxnames, state.ini.fixed.boxnames) +#> } +#> else { +#> odeini <- state.ini.fixed +#> names(odeini) <- state.ini.fixed.boxnames +#> } +#> odeparms <- c(P[(length(state.ini.optim) + 1):length(P)], +#> parms.fixed) +#> out <- mkinpredict(mkinmod, odeparms, odeini, outtimes, solution_type = solution_type, +#> use_compiled = use_compiled, method.ode = method.ode, +#> atol = atol, rtol = rtol, ...) +#> mC <- modCost(out, observed, y = "value", err = err, weight = weight, +#> scaleVar = scaleVar) +#> return(mC) +#> } +#> <environment: 0x2e966b0> +#> +#> $hessian_notrans +#> parent_0 k_parent_sink +#> parent_0 4.163631 -1203.894 +#> k_parent_sink -1203.893702 1033188.753 +#> +#> $start +#> value type +#> parent_0 98.62 state +#> k_parent_sink 0.10 deparm +#> +#> $start_transformed +#> value lower upper +#> parent_0 98.620000 -Inf Inf +#> log_k_parent_sink -2.302585 -Inf Inf +#> +#> $fixed +#> [1] value type +#> <0 rows> (or 0-length row.names) +#> +#> $data +#> time variable observed predicted residual +#> 1 0 parent 98.62 99.17407218 -0.55407218 +#> 2 3 parent 81.43 78.44547872 2.98452128 +#> 3 7 parent 53.18 57.38445742 -4.20445742 +#> 4 14 parent 34.89 33.20400061 1.68599939 +#> 5 30 parent 10.09 9.50814643 0.58185357 +#> 6 62 parent 1.50 0.77966270 0.72033730 +#> 7 90 parent 0.33 0.08739595 0.24260405 +#> 8 118 parent 0.08 0.00979661 0.07020339 +#> +#> $atol +#> [1] 1e-08 +#> +#> $rtol +#> [1] 1e-10 +#> +#> $weight.ini +#> [1] "none" +#> +#> $reweight.tol +#> [1] 1e-08 +#> +#> $reweight.max.iter +#> [1] 10 +#> +#> $bparms.optim +#> parent_0 k_parent_sink +#> 99.17407218 0.07815759 +#> +#> $bparms.fixed +#> numeric(0) +#> +#> $bparms.ode +#> k_parent_sink +#> 0.07815759 +#> +#> $bparms.state +#> parent +#> 99.17407 +#> +#> $date +#> [1] "Thu Oct 6 09:17:51 2016" +#> +#> attr(,"class") +#> [1] "mkinfit" "modFit" +#> +#>
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html b/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html new file mode 100644 index 00000000..5c0faa43 --- /dev/null +++ b/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html @@ -0,0 +1,129 @@ + + + + + + + + +FOCUS_2006_DFOP_ref_A_to_B. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

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.

+ + +
data(FOCUS_2006_DFOP_ref_A_to_B)
+ +
+

Format

+ +

A data frame containing the following variables. +

+
package
a factor giving the name of the software package
+
M0
The fitted initial concentration of the parent compound
+
f
The fitted f parameter
+
k1
The fitted k1 parameter
+
k2
The fitted k2 parameter
+
DT50
The resulting half-life of the parent compound
+
DT90
The resulting DT90 of the parent compound
+
dataset
The FOCUS dataset that was used
+

+
+ +
+

Source

+ +

FOCUS (2006) “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, + http://focus.jrc.ec.europa.eu/dk

+
+ +

Examples

+
data(FOCUS_2006_DFOP_ref_A_to_B)
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html b/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html new file mode 100644 index 00000000..89faecbf --- /dev/null +++ b/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html @@ -0,0 +1,128 @@ + + + + + + + + +FOCUS_2006_FOMC_ref_A_to_F. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

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.

+ + +
data(FOCUS_2006_FOMC_ref_A_to_F)
+ +
+

Format

+ +

A data frame containing the following variables. +

+
package
a factor giving the name of the software package
+
M0
The fitted initial concentration of the parent compound
+
alpha
The fitted alpha parameter
+
beta
The fitted beta parameter
+
DT50
The resulting half-life of the parent compound
+
DT90
The resulting DT90 of the parent compound
+
dataset
The FOCUS dataset that was used
+

+
+ +
+

Source

+ +

FOCUS (2006) “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, + http://focus.jrc.ec.europa.eu/dk

+
+ +

Examples

+
data(FOCUS_2006_FOMC_ref_A_to_F)
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/FOCUS_2006_HS_ref_A_to_F.html b/docs/reference/FOCUS_2006_HS_ref_A_to_F.html new file mode 100644 index 00000000..2dfafec6 --- /dev/null +++ b/docs/reference/FOCUS_2006_HS_ref_A_to_F.html @@ -0,0 +1,129 @@ + + + + + + + + +FOCUS_2006_HS_ref_A_to_F. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

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.

+ + +
data(FOCUS_2006_HS_ref_A_to_F)
+ +
+

Format

+ +

A data frame containing the following variables. +

+
package
a factor giving the name of the software package
+
M0
The fitted initial concentration of the parent compound
+
tb
The fitted tb parameter
+
k1
The fitted k1 parameter
+
k2
The fitted k2 parameter
+
DT50
The resulting half-life of the parent compound
+
DT90
The resulting DT90 of the parent compound
+
dataset
The FOCUS dataset that was used
+

+
+ +
+

Source

+ +

FOCUS (2006) “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, + http://focus.jrc.ec.europa.eu/dk

+
+ +

Examples

+
data(FOCUS_2006_HS_ref_A_to_F)
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html b/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html new file mode 100644 index 00000000..ed3a4aff --- /dev/null +++ b/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html @@ -0,0 +1,127 @@ + + + + + + + + +FOCUS_2006_SFO_ref_A_to_F. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

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.

+ + +
data(FOCUS_2006_SFO_ref_A_to_F)
+ +
+

Format

+ +

A data frame containing the following variables. +

+
package
a factor giving the name of the software package
+
M0
The fitted initial concentration of the parent compound
+
k
The fitted first-order degradation rate constant
+
DT50
The resulting half-life of the parent compound
+
DT90
The resulting DT90 of the parent compound
+
dataset
The FOCUS dataset that was used
+

+
+ +
+

Source

+ +

FOCUS (2006) “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, + http://focus.jrc.ec.europa.eu/dk

+
+ +

Examples

+
data(FOCUS_2006_SFO_ref_A_to_F)
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/FOCUS_2006_datasets.html b/docs/reference/FOCUS_2006_datasets.html new file mode 100644 index 00000000..c1eacbd8 --- /dev/null +++ b/docs/reference/FOCUS_2006_datasets.html @@ -0,0 +1,130 @@ + + + + + + + + +FOCUS_2006_datasets. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Data taken from FOCUS (2006), p. 258.

+ + +
FOCUS_2006_datasets
+ +
+

Format

+ +

6 datasets with observations on the following variables. +

+
name
a factor containing the name of the observed variable
+
time
a numeric vector containing time points
+
value
a numeric vector containing concentrations in percent of applied radioactivity
+

+
+ +
+

Source

+ +

FOCUS (2006) “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, + http://focus.jrc.ec.europa.eu/dk

+
+ +

Examples

+
FOCUS_2006_C
#> name time value +#> 1 parent 0 85.1 +#> 2 parent 1 57.9 +#> 3 parent 3 29.9 +#> 4 parent 7 14.6 +#> 5 parent 14 9.7 +#> 6 parent 28 6.6 +#> 7 parent 63 4.0 +#> 8 parent 91 3.9 +#> 9 parent 119 0.6 +#>
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/FOMC.solution.html b/docs/reference/FOMC.solution.html new file mode 100644 index 00000000..912cf414 --- /dev/null +++ b/docs/reference/FOMC.solution.html @@ -0,0 +1,147 @@ + + + + + + + + +FOMC.solution. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

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 beta corresponds to 1/beta in the + original equation.

+ + +
FOMC.solution(t, parent.0, alpha, beta)
+ +

Arguments

+
+
t
+
Time.
+
parent.0
+
Starting value for the response variable at time zero.
+
alpha
+
+ Shape parameter determined by coefficient of variation of rate constant + values.
+
beta
+
+ Location parameter. +
+
+ +
+

Note

+ +

The solution of the FOMC kinetic model reduces to the + SFO.solution for large values of alpha and + beta with + \(k = \frac{\beta}{\alpha}\).

+
+ +
+

Value

+ +

The value of the response variable at time t.

+
+ +
+

References

+ +

FOCUS (2006) “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, + 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. Environmental Science and + Technology 24, 1032-1038

+
+ +

Examples

+
plot(function(x) FOMC.solution(x, 100, 10, 2), 0, 2, ylim = c(0, 100))
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/HS.solution.html b/docs/reference/HS.solution.html new file mode 100644 index 00000000..994f8373 --- /dev/null +++ b/docs/reference/HS.solution.html @@ -0,0 +1,131 @@ + + + + + + + + +HS.solution. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Function describing two exponential decline functions with a break point + between them.

+ + +
HS.solution(t, parent.0, k1, k2, tb)
+ +

Arguments

+
+
t
+
Time.
+
parent.0
+
Starting value for the response variable at time zero.
+
k1
+
First kinetic constant.
+
k2
+
Second kinetic constant.
+
tb
+
Break point. Before this time, exponential decline according + to k1 is calculated, after this time, exponential decline proceeds + according to k2.
+
+ +
+

Value

+ +

The value of the response variable at time t.

+
+ +
+

References

+ +

FOCUS (2006) “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, + http://focus.jrc.ec.europa.eu/dk

+
+ +

Examples

+
plot(function(x) HS.solution(x, 100, 2, 0.3, 0.5), 0, 2, ylim=c(0,100))
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/IORE.solution.html b/docs/reference/IORE.solution.html new file mode 100644 index 00000000..06f5c1ad --- /dev/null +++ b/docs/reference/IORE.solution.html @@ -0,0 +1,149 @@ + + + + + + + + +IORE.solution. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Function describing exponential decline from a defined starting value, with + a concentration dependent rate constant.

+ + +
IORE.solution(t, parent.0, k__iore, N)
+ +

Arguments

+
+
t
+
Time.
+
parent.0
+
Starting value for the response variable at time zero.
+
k__iore
+
Rate constant. Note that this depends on the concentration units used.
+
N
+
Exponent describing the nonlinearity of the rate equation
+
+ +
+

Note

+ +

The solution of the IORE kinetic model reduces to the + SFO.solution if N = 1. + The parameters of the IORE model can be transformed to equivalent parameters + of the FOMC mode - see the NAFTA guidance for details.

+
+ +
+

Value

+ +

The value of the response variable at time t.

+
+ +
+

References

+ +

NAFTA Technical Working Group on Pesticides (not dated) Guidance for + Evaluating and Calculating Degradation Kinetics in Environmental + Media

+
+ +

Examples

+
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) + fit.iore.deS <- mkinfit("IORE", FOCUS_2006_C, solution_type = "deSolve", quiet = TRUE) + + print(data.frame(coef(fit.fomc), coef(fit.iore), coef(fit.iore.deS), + 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, + 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 +#>
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/SFO.solution.html b/docs/reference/SFO.solution.html new file mode 100644 index 00000000..9cf069d7 --- /dev/null +++ b/docs/reference/SFO.solution.html @@ -0,0 +1,124 @@ + + + + + + + + +SFO.solution. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Function describing exponential decline from a defined starting value.

+ + +
SFO.solution(t, parent.0, k)
+ +

Arguments

+
+
t
+
Time.
+
parent.0
+
Starting value for the response variable at time zero.
+
k
+
Kinetic constant.
+
+ +
+

Value

+ +

The value of the response variable at time t.

+
+ +
+

References

+ +

FOCUS (2006) “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, + http://focus.jrc.ec.europa.eu/dk

+
+ +

Examples

+
## Not run: plot(function(x) SFO.solution(x, 100, 3), 0, 2)
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/SFORB.solution.html b/docs/reference/SFORB.solution.html new file mode 100644 index 00000000..57959f26 --- /dev/null +++ b/docs/reference/SFORB.solution.html @@ -0,0 +1,133 @@ + + + + + + + + +SFORB.solution. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Function describing the solution of the differential equations describing + the kinetic model with first-order terms for a two-way transfer from a free + to a bound fraction, and a first-order degradation term for the free + fraction. The initial condition is a defined amount in the free fraction and + no substance in the bound fraction.

+ + +
SFORB.solution(t, parent.0, k_12, k_21, k_1output)
+ +

Arguments

+
+
t
+
Time.
+
parent.0
+
Starting value for the response variable at time zero.
+
k_12
+
Kinetic constant describing transfer from free to bound.
+
k_21
+
Kinetic constant describing transfer from bound to free.
+
k_1output
+
Kinetic constant describing degradation of the free fraction.
+
+ +
+

Value

+ +

The value of the response variable, which is the sum of free and bound + fractions at time t.

+
+ +
+

References

+ +

FOCUS (2006) “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, + http://focus.jrc.ec.europa.eu/dk

+
+ +

Examples

+
## Not run: plot(function(x) SFORB.solution(x, 100, 0.5, 2, 3), 0, 2)
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/add_err.html b/docs/reference/add_err.html new file mode 100644 index 00000000..cbc925ca --- /dev/null +++ b/docs/reference/add_err.html @@ -0,0 +1,196 @@ + + + + + + + + +add_err. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Normally distributed errors are added to data predicted for a specific + degradation model using mkinpredict. The variance of the error + may depend on the predicted value and is specified as a standard deviation.

+ + +
add_err(prediction, sdfunc,
+          n = 1000, LOD = 0.1, reps = 2,
+          digits = 1, seed = NA)
+ +

Arguments

+
+
prediction
+
+ A prediction from a kinetic model as produced by mkinpredict. +
+
sdfunc
+
+ A function taking the predicted value as its only argument and returning + a standard deviation that should be used for generating the random error + terms for this value. +
+
n
+
+ The number of datasets to be generated. +
+
LOD
+
+ The limit of detection (LOD). Values that are below the LOD after adding + the random error will be set to NA. +
+
reps
+
+ The number of replicates to be generated within the datasets. +
+
digits
+
+ The number of digits to which the values will be rounded. +
+
seed
+
+ The seed used for the generation of random numbers. If NA, the seed + is not set. +
+
+ +
+

Value

+ +

A list of datasets compatible with mmkin, i.e. + the components of the list are datasets compatible with + mkinfit.

+
+ +
+

References

+ +

Ranke J and Lehmann R (2015) To t-test or not to t-test, that is the question. XV Symposium on Pesticide Chemistry 2-4 September 2015, Piacenza, Italy + http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf

+
+ +

Examples

+
# 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) + +# This is the prediction used for the "Type 2 datasets" on the Piacenza poster +# from 2015 +d_SFO_SFO <- mkinpredict(m_SFO_SFO, + c(k_parent = 0.1, f_parent_to_M1 = 0.5, + k_M1 = log(2)/1000), + c(parent = 100, M1 = 0), + sampling_times) + +# Add an error term with a constant (independent of the value) standard deviation +# of 10, and generate three datasets +d_SFO_SFO_err <- add_err(d_SFO_SFO, function(x) 10, n = 3, seed = 123456789 ) + +# Name the datasets for nicer plotting +names(d_SFO_SFO_err) <- paste("Dataset", 1:3) + +# Name the model in the list of models (with only one member in this case) +# for nicer plotting later on. +# Be quiet and use the faster Levenberg-Marquardt algorithm, as the datasets +# are easy and examples are run often. Use only one core not to offend CRAN +# checks +f_SFO_SFO <- mmkin(list("SFO-SFO" = m_SFO_SFO), + d_SFO_SFO_err, cores = 1, + quiet = TRUE, method.modFit = "Marq") + +plot(f_SFO_SFO)
+# We would like to inspect the fit for dataset 3 more closely +# Using double brackets makes the returned object an mkinfit object +# instead of a list of mkinfit objects, so plot.mkinfit is used +plot(f_SFO_SFO[[3]], show_residuals = TRUE)
+# If we use single brackets, we should give two indices (model and dataset), +# and plot.mmkin is used +plot(f_SFO_SFO[1, 3])
+
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/endpoints.html b/docs/reference/endpoints.html new file mode 100644 index 00000000..8ceb39d9 --- /dev/null +++ b/docs/reference/endpoints.html @@ -0,0 +1,123 @@ + + + + + + + + +endpoints. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

This function calculates DT50 and DT90 values as well as formation fractions from kinetic models +fitted with mkinfit. If the SFORB model was specified for one of the parents or metabolites, +the Eigenvalues are returned. These are equivalent to the rate constantes of the DFOP model, but +with the advantage that the SFORB model can also be used for metabolites.

+ + +
endpoints(fit)
+ +

Arguments

+
+
fit
+
+ An object of class mkinfit. +
+
+ +
+

Note

+ +

The function is used internally by summary.mkinfit.

+
+ +
+

Value

+ +

A list with the components mentioned above.

+
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/geometric_mean.html b/docs/reference/geometric_mean.html new file mode 100644 index 00000000..1d9a9e66 --- /dev/null +++ b/docs/reference/geometric_mean.html @@ -0,0 +1,115 @@ + + + + + + + + +geometric_mean. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Function calculating the geometric mean of numeric vectors

+ + +
geometric_mean(x, na.rm = FALSE)
+ +

Arguments

+
+
x
+
A numeric vector
+
na.rm
+
Should NA values be ignored
+
+ +
+

Value

+ +

The geometric mean.

+
+ +

Examples

+
geometric_mean(c(1,3, 9))
#> [1] 3 +#>
geometric_mean(c(1,3, NA))
#> [1] NA +#>
geometric_mean(c(1,3, NA), na.rm = TRUE)
#> [1] 1.732051 +#>
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/ilr.html b/docs/reference/ilr.html new file mode 100644 index 00000000..355cbb78 --- /dev/null +++ b/docs/reference/ilr.html @@ -0,0 +1,152 @@ + + + + + + + + +ilr. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

This implementation is a special case of the class of isometric log-ratio transformations.

+ + +
ilr(x)
+  invilr(x)
+ +

Arguments

+
+
x
+
+ A numeric vector. Naturally, the forward transformation is only sensible for + vectors with all elements being greater than zero. +
+
+ +
+

Value

+ +

The result of the forward or backward transformation. The returned components always + sum to 1 for the case of the inverse log-ratio transformation.

+
+ +
+

References

+ +

Peter Filzmoser, Karel Hron (2008) Outlier Detection for Compositional Data Using Robust Methods. Math Geosci 40 233-248

+
+ +
+

See also

+ +

Another implementation can be found in R package robCompositions.

+
+ +

Examples

+
# Order matters +ilr(c(0.1, 1, 10))
#> [1] -1.628174 -2.820079 +#>
ilr(c(10, 1, 0.1))
#> [1] 1.628174 2.820079 +#>
# Equal entries give ilr transformations with zeros as elements +ilr(c(3, 3, 3))
#> [1] 0 0 +#>
# Almost equal entries give small numbers +ilr(c(0.3, 0.4, 0.3))
#> [1] -0.2034219 0.1174457 +#>
# Only the ratio between the numbers counts, not their sum +invilr(ilr(c(0.7, 0.29, 0.01)))
#> [1] 0.70 0.29 0.01 +#>
invilr(ilr(2.1 * c(0.7, 0.29, 0.01)))
#> [1] 0.70 0.29 0.01 +#>
# Inverse transformation of larger numbers gives unequal elements +invilr(-10)
#> [1] 7.213536e-07 9.999993e-01 +#>
invilr(c(-10, 0))
#> [1] 7.207415e-07 9.991507e-01 8.486044e-04 +#>
# The sum of the elements of the inverse ilr is 1 +sum(invilr(c(-10, 0)))
#> [1] 1 +#>
# This is why we do not need all elements of the inverse transformation to go back: +a <- c(0.1, 0.3, 0.5) +b <- invilr(a) +length(b) # Four elements
#> [1] 4 +#>
ilr(c(b[1:3], 1 - sum(b[1:3]))) # Gives c(0.1, 0.3, 0.5)
#> [1] 0.1 0.3 0.5 +#>
+
+
+

Author

+ + René Lehmann and Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/index.html b/docs/reference/index.html new file mode 100644 index 00000000..869f61dd --- /dev/null +++ b/docs/reference/index.html @@ -0,0 +1,111 @@ + + + + + + + + +Function reference. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+
+

Main functions

+

Essential functionality

+ +
+
mkinfit
+
+
+
mkinmod
+
+
+
mmkin
+
+
+
+
+
+

Show results

+

+ +
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/mccall81_245T.html b/docs/reference/mccall81_245T.html new file mode 100644 index 00000000..edfce55a --- /dev/null +++ b/docs/reference/mccall81_245T.html @@ -0,0 +1,229 @@ + + + + + + + + +mccall81_245T. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Time course of 2,4,5-trichlorophenoxyacetic acid, and the corresponding + 2,4,5-trichlorophenol and 2,4,5-trichloroanisole as recovered in diethylether + extracts.

+ + +
mccall81_245T
+ +
+

Format

+ +

A dataframe containing the following variables. +

+
name
the name of the compound observed. Note that T245 is used as + an acronym for 2,4,5-T. T245 is a legitimate object name + in R, which is necessary for specifying models using + mkinmod.
+
time
a numeric vector containing sampling times in days after + treatment
+
value
a numeric vector containing concentrations in percent of applied radioactivity
+
soil
a factor containing the name of the soil
+

+
+ +
+

Source

+ +

McCall P, Vrona SA, Kelley SS (1981) Fate of uniformly carbon-14 ring labeled 2,4,5-Trichlorophenoxyacetic acid and 2,4-dichlorophenoxyacetic acid. J Agric Chem 29, 100-107 + http://dx.doi.org/10.1021/jf00103a026

+
+ +

Examples

+
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: ------------------------------------ +# fit.1 <- mkinfit(SFO_SFO_SFO, subset(mccall81_245T, soil == "Commerce")) +# summary(fit.1, data = FALSE) +# +## --------------------------------------------- + # No covariance matrix and k_phenol_sink is really small, therefore fix it to zero + fit.2 <- mkinfit(SFO_SFO_SFO, subset(mccall81_245T, soil == "Commerce"), + 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: Thu Oct 6 09:17:57 2016 +#> Date of summary: Thu Oct 6 09:17:57 2016 +#> +#> Equations: +#> d_T245 = - k_T245_sink * T245 - k_T245_phenol * T245 +#> d_phenol = + k_T245_phenol * T245 - k_phenol_sink * phenol - +#> k_phenol_anisole * phenol +#> d_anisole = + k_phenol_anisole * phenol - k_anisole_sink * anisole +#> +#> Model predictions using solution type deSolve +#> +#> Fitted with method Port using 246 model solutions performed in 1.508 s +#> +#> Weighting: none +#> +#> Starting values for parameters to be optimised: +#> value type +#> T245_0 100.9000 state +#> k_T245_sink 0.1000 deparm +#> k_T245_phenol 0.1001 deparm +#> k_phenol_anisole 0.1002 deparm +#> k_anisole_sink 0.1003 deparm +#> +#> Starting values for the transformed parameters actually optimised: +#> value lower upper +#> T245_0 100.900000 -Inf Inf +#> log_k_T245_sink -2.302585 -Inf Inf +#> log_k_T245_phenol -2.301586 -Inf Inf +#> log_k_phenol_anisole -2.300587 -Inf Inf +#> log_k_anisole_sink -2.299590 -Inf Inf +#> +#> Fixed parameter values: +#> value type +#> phenol_0 0 state +#> anisole_0 0 state +#> k_phenol_sink 0 deparm +#> +#> Optimised, transformed parameters with symmetric confidence intervals: +#> Estimate Std. Error Lower Upper +#> T245_0 103.9000 2.35200 98.930 108.8000 +#> log_k_T245_sink -4.1130 0.13250 -4.390 -3.8350 +#> log_k_T245_phenol -3.6120 0.05002 -3.716 -3.5070 +#> log_k_phenol_anisole -0.9037 0.30580 -1.544 -0.2637 +#> log_k_anisole_sink -5.0090 0.11180 -5.243 -4.7750 +#> +#> Parameter correlation: +#> T245_0 log_k_T245_sink log_k_T245_phenol +#> T245_0 1.00000 0.63761 -0.1742 +#> log_k_T245_sink 0.63761 1.00000 -0.3831 +#> log_k_T245_phenol -0.17416 -0.38313 1.0000 +#> log_k_phenol_anisole -0.05948 0.08745 -0.3047 +#> log_k_anisole_sink -0.16208 -0.60469 0.5227 +#> log_k_phenol_anisole log_k_anisole_sink +#> T245_0 -0.05948 -0.1621 +#> log_k_T245_sink 0.08745 -0.6047 +#> log_k_T245_phenol -0.30470 0.5227 +#> log_k_phenol_anisole 1.00000 -0.1774 +#> log_k_anisole_sink -0.17744 1.0000 +#> +#> Residual standard error: 2.706 on 19 degrees of freedom +#> +#> Backtransformed parameters: +#> Confidence intervals for internally transformed parameters are asymmetric. +#> t-test (unrealistically) based on the assumption of normal distribution +#> for estimators of untransformed parameters. +#> Estimate t value Pr(>t) Lower Upper +#> T245_0 1.039e+02 44.160 6.462e-21 98.930000 108.80000 +#> k_T245_sink 1.636e-02 7.545 1.978e-07 0.012400 0.02159 +#> k_T245_phenol 2.701e-02 19.990 1.607e-14 0.024320 0.02999 +#> k_phenol_anisole 4.051e-01 3.270 2.014e-03 0.213600 0.76820 +#> k_anisole_sink 6.679e-03 8.942 1.544e-08 0.005285 0.00844 +#> +#> Chi2 error levels in percent: +#> err.min n.optim df +#> All data 9.831 5 17 +#> T245 7.908 3 5 +#> phenol 99.808 1 6 +#> anisole 5.379 1 6 +#> +#> Resulting formation fractions: +#> ff +#> T245_sink 0.3772 +#> T245_phenol 0.6228 +#> phenol_anisole 1.0000 +#> phenol_sink 0.0000 +#> anisole_sink 1.0000 +#> +#> Estimated disappearance times: +#> DT50 DT90 +#> T245 15.982 53.091 +#> phenol 1.711 5.685 +#> anisole 103.784 344.763 +#>
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/mkin_long_to_wide.html b/docs/reference/mkin_long_to_wide.html new file mode 100644 index 00000000..5b1a8353 --- /dev/null +++ b/docs/reference/mkin_long_to_wide.html @@ -0,0 +1,152 @@ + + + + + + + + +mkin_long_to_wide. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

This function takes a dataframe in the long form as required by modCost + and converts it into a dataframe with one independent variable and several + dependent variables as columns.

+ + +
mkin_long_to_wide(long_data, time = "time", outtime = "time")
+ +

Arguments

+
+
long_data
+
+ The dataframe must contain one variable called "time" with the time values specified by the + time argument, one column called "name" with the grouping of the observed values, and + finally one column of observed values called "value". +
+
time
+
+ The name of the time variable in the long input data. +
+
outtime
+
+ The name of the time variable in the wide output data. +
+
+ +
+

Value

+ +

Dataframe in wide format.

+
+ +

Examples

+
mkin_long_to_wide(FOCUS_2006_D)
#> time parent m1 +#> 1 0 99.46 0.00 +#> 2 0 102.04 0.00 +#> 3 1 93.50 4.84 +#> 4 1 92.50 5.64 +#> 5 3 63.23 12.91 +#> 6 3 68.99 12.96 +#> 7 7 52.32 22.97 +#> 8 7 55.13 24.47 +#> 9 14 27.27 41.69 +#> 10 14 26.64 33.21 +#> 11 21 11.50 44.37 +#> 12 21 11.64 46.44 +#> 13 35 2.85 41.22 +#> 14 35 2.91 37.95 +#> 15 50 0.69 41.19 +#> 16 50 0.63 40.01 +#> 17 75 0.05 40.09 +#> 18 75 0.06 33.85 +#> 19 100 NA 31.04 +#> 20 100 NA 33.13 +#> 21 120 NA 25.15 +#> 22 120 NA 33.31 +#>
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/mkin_wide_to_long.html b/docs/reference/mkin_wide_to_long.html new file mode 100644 index 00000000..2a70ebbe --- /dev/null +++ b/docs/reference/mkin_wide_to_long.html @@ -0,0 +1,131 @@ + + + + + + + + +mkin_wide_to_long. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

This function simply takes a dataframe with one independent variable and several + dependent variable and converts it into the long form as required by modCost.

+ + +
mkin_wide_to_long(wide_data, time = "t")
+ +

Arguments

+
+
wide_data
+
+ The dataframe must contain one variable with the time values specified by the + time argument and usually more than one column of observed values. +
+
time
+
+ The name of the time variable. +
+
+ +
+

Value

+ +

Dataframe in long format as needed for modCost.

+
+ +

Examples

+
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 +#> 2 x 2 4 +#> 3 x 3 7 +#> 4 y 1 3 +#> 5 y 2 4 +#> 6 y 3 5 +#>
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/mkinds.html b/docs/reference/mkinds.html new file mode 100644 index 00000000..0b4341aa --- /dev/null +++ b/docs/reference/mkinds.html @@ -0,0 +1,120 @@ + + + + + + + + +mkinds. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

A dataset class for mkin

+ + +
mkinds
+ +
+

Format

+ +

An R6Class generator object.

+
+ +
+

Fields

+ +

+

+
title
A full title for the dataset

+

sampling
times The sampling times

+

time_unit
The time unit

+

observed
Names of the observed compounds

+

unit
The unit of the observations

+

replicates
The number of replicates

+

data
A dataframe with at least the columns name, time and value +in order to be compatible with mkinfit
+

+
+ +

Examples

+
mds <- mkinds$new("FOCUS A", FOCUS_2006_A)
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/mkinerrmin.html b/docs/reference/mkinerrmin.html new file mode 100644 index 00000000..cd9faf1a --- /dev/null +++ b/docs/reference/mkinerrmin.html @@ -0,0 +1,150 @@ + + + + + + + + +mkinerrmin. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

This function uses 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.

+ + +
mkinerrmin(fit, alpha = 0.05)
+ +

Arguments

+
+
fit
+
+ an object of class mkinfit. +
+
alpha
+
+ The confidence level chosen for the chi-squared test. +
+
+ +
+

Value

+ +

A dataframe with the following components:

+

The dataframe has one row for the total dataset and one further row for + each observed state variable in the model.

+
+ +
+

Details

+ +

This function is used internally by summary.mkinfit.

+
+ +
+

References

+ +

FOCUS (2006) “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, + http://focus.jrc.ec.europa.eu/dk

+
+ +

Examples

+
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.
+fit_FOCUS_D = mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE) +round(mkinerrmin(fit_FOCUS_D), 4)
#> err.min n.optim df +#> All data 0.0640 4 15 +#> parent 0.0646 2 7 +#> m1 0.0469 2 8 +#>
fit_FOCUS_E = mkinfit(SFO_SFO, FOCUS_2006_E, quiet = TRUE) +round(mkinerrmin(fit_FOCUS_E), 4)
#> err.min n.optim df +#> All data 0.1544 4 13 +#> parent 0.1659 2 7 +#> m1 0.1095 2 6 +#>
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html new file mode 100644 index 00000000..d1441f8b --- /dev/null +++ b/docs/reference/mkinfit.html @@ -0,0 +1,531 @@ + + + + + + + + +mkinfit. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

This function uses the Flexible Modelling Environment package + FME to create a function calculating the model cost, i.e. the + deviation between the kinetic model and the observed data. This model cost is + then minimised using the Port algorithm nlminb, + using the specified initial or fixed parameters and starting values. + Per default, parameters in the kinetic models are internally transformed in order + to better satisfy the assumption of a normal distribution of their estimators. + In each step of the optimsation, the kinetic model is solved using the + function mkinpredict. The variance of the residuals for each + observed variable can optionally be iteratively reweighted until convergence + using the argument reweight.method = "obs".

+ + +
mkinfit(mkinmod, observed,
+  parms.ini = "auto",
+  state.ini = "auto",
+  fixed_parms = NULL, fixed_initials = names(mkinmod$diffs)[-1],
+  from_max_mean = FALSE,
+  solution_type = c("auto", "analytical", "eigen", "deSolve"),
+  method.ode = "lsoda",
+  use_compiled = "auto",
+  method.modFit = c("Port", "Marq", "SANN", "Nelder-Mead", "BFGS", "CG", "L-BFGS-B"),
+  maxit.modFit = "auto",
+  control.modFit = list(),
+  transform_rates = TRUE,
+  transform_fractions = TRUE,
+  plot = FALSE, quiet = FALSE, err = NULL, weight = "none",
+  scaleVar = FALSE,
+  atol = 1e-8, rtol = 1e-10, n.outtimes = 100,
+  reweight.method = NULL,
+  reweight.tol = 1e-8, reweight.max.iter = 10,
+  trace_parms = FALSE, ...)
+ +

Arguments

+
+
mkinmod
+
+ A list of class mkinmod, containing the kinetic model to be + fitted to the data, or one of the shorthand names ("SFO", "FOMC", "DFOP", + "HS", "SFORB"). If a shorthand name is given, a parent only degradation + model is generated for the variable with the highest value in + observed. +
+
observed
+
+ The observed data. It has to be in the long format as described in + modFit, i.e. the first column called "name" must contain the + name of the observed variable for each data point. The second column must + contain the times of observation, named "time". The third column must be + named "value" and contain the observed values. Optionally, a further column + can contain weights for each data point. Its name must be passed as a + further argument named err which is then passed on to + modFit. +
+
parms.ini
+
+ A named vector of initial values for the parameters, including parameters + to be optimised and potentially also fixed parameters as indicated by + fixed_parms. If set to "auto", initial values for rate constants + are set to default values. Using parameter names that are not in the model + gives an error. + + It is possible to only specify a subset of the parameters that the model + needs. You can use the parameter lists "bparms.ode" from a previously + fitted model, which contains the differential equation parameters from this + model. This works nicely if the models are nested. An example is given + below. +
+
state.ini
+
+ A named vector of initial values for the state variables of the model. In + case the observed variables are represented by more than one model + variable, the names will differ from the names of the observed variables + (see map component of mkinmod). The default is to set + the initial value of the first model variable to the mean of the time zero + values for the variable with the maximum observed value, and all others to 0. + If this variable has no time zero observations, its initial value is set to 100. +
+
fixed_parms
+
+ The names of parameters that should not be optimised but rather kept at the + values specified in parms.ini. +
+
fixed_initials
+
+ The names of model variables for which the initial state at time 0 should + be excluded from the optimisation. Defaults to all state variables except + for the first one. +
+
from_max_mean
+
+ If this is set to TRUE, and the model has only one observed variable, then + data before the time of the maximum observed value (after averaging for each + sampling time) are discarded, and this time is subtracted from all + remaining time values, so the time of the maximum observed mean value is + the new time zero. +
+
solution_type
+
+ If set to "eigen", the solution of the system of differential equations is + based on the spectral decomposition of the coefficient matrix in cases that + this is possible. If set to "deSolve", a numerical ode solver from package + deSolve is used. If set to "analytical", an analytical + solution of the model is used. This is only implemented for simple + degradation experiments with only one state variable, i.e. with no + metabolites. The default is "auto", which uses "analytical" if possible, + otherwise "eigen" if the model can be expressed using eigenvalues and + eigenvectors, and finally "deSolve" for the remaining models (time + dependence of degradation rates and metabolites). This argument is passed + on to the helper function mkinpredict. +
+
method.ode
+
+ The solution method passed via mkinpredict to + ode in case the solution type is "deSolve". The default + "lsoda" is performant, but sometimes fails to converge. +
+
use_compiled
+
+ If set to FALSE, no compiled version of the mkinmod + model is used, in the calls to mkinpredict even if + a compiled verion is present. +
+
method.modFit
+
+ The optimisation method passed to modFit. + + In order to optimally deal with problems where local minima occur, the + "Port" algorithm is now used per default as it is less prone to get trapped + in local minima and depends less on starting values for parameters than + the Levenberg Marquardt variant selected by "Marq". However, "Port" needs + more iterations. + + The former default "Marq" is the Levenberg Marquardt algorithm + nls.lm from the package minpack.lm and usually needs + the least number of iterations. + + The "Pseudo" algorithm is not included because it needs finite parameter bounds + which are currently not supported. + + The "Newton" algorithm is not included because its number of iterations + can not be controlled by control.modFit and it does not appear + to provide advantages over the other algorithms. +
+
maxit.modFit
+
+ Maximum number of iterations in the optimisation. If not "auto", this will + be passed to the method called by modFit, overriding + what may be specified in the next argument control.modFit. +
+
control.modFit
+
+ Additional arguments passed to the optimisation method used by + modFit. +
+
transform_rates
+
+ Boolean specifying if kinetic rate constants should be transformed in the + model specification used in the fitting for better compliance with the + assumption of normal distribution of the estimator. If TRUE, also + alpha and beta parameters of the FOMC model are log-transformed, as well + as k1 and k2 rate constants for the DFOP and HS models and the break point + tb of the HS model. + If FALSE, zero is used as a lower bound for the rates in the optimisation. +
+
transform_fractions
+
+ Boolean specifying if formation fractions constants should be transformed in the + model specification used in the fitting for better compliance with the + assumption of normal distribution of the estimator. The default (TRUE) is + 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 + ilr transformation. +
+
plot
+
+ Should the observed values and the numerical solutions be plotted at each + stage of the optimisation? +
+
quiet
+
+ Suppress printing out the current model cost after each improvement? +
+
err
+
either NULL, or the name of the column with the + error estimates, used to weigh the residuals (see details of + modCost); if NULL, then the residuals are not weighed. +
+
weight
+
+ only if err=NULL: how to weight the residuals, one of "none", + "std", "mean", see details of modCost. +
+
scaleVar
+
+ Will be passed to modCost. Default is not to scale Variables + according to the number of observations. +
+
atol
+
+ Absolute error tolerance, passed to ode. Default is 1e-8, + lower than in lsoda. +
+
rtol
+
+ Absolute error tolerance, passed to ode. Default is 1e-10, + much lower than in lsoda. +
+
n.outtimes
+
+ The length of the dataseries that is produced by the model prediction + function mkinpredict. This impacts the accuracy of + the numerical solver if that is used (see solution_type argument. + The default value is 100. +
+
reweight.method
+
+ The method used for iteratively reweighting residuals, also known + as iteratively reweighted least squares (IRLS). Default is NULL, + the other method implemented is called "obs", meaning that each + observed variable is assumed to have its own variance, this is + estimated from the fit and used for weighting the residuals + in each iteration until convergence of this estimate up to + reweight.tol or up to the maximum number of iterations + specified by reweight.max.iter. +
+
reweight.tol
+
+ Tolerance for convergence criterion for the variance components + in IRLS fits. +
+
reweight.max.iter
+
+ Maximum iterations in IRLS fits. +
+
trace_parms
+
+ Should a trace of the parameter values be listed? +
+
&#8230;
+
+ Further arguments that will be passed to modFit. +
+
+ +
+

Value

+ +

A list with "mkinfit" and "modFit" in the class attribute. + A summary can be obtained by summary.mkinfit.

+
+ +
+

See also

+ +

Plotting methods plot.mkinfit and + mkinparplot.

+

Fitting of several models to several datasets in a single call to + mmkin.

+
+ +
+

Note

+ +

The implementation of iteratively reweighted least squares is inspired by the + work of the KinGUII team at Bayer Crop Science (Walter Schmitt and Zhenglei + Gao). A similar implemention can also be found in CAKE 2.0, which is the + other GUI derivative of mkin, sponsored by Syngenta.

+
+ +
+

Note

+ +

When using the "IORE" submodel for metabolites, fitting with + "transform_rates = TRUE" (the default) often leads to failures of the + numerical ODE solver. In this situation it may help to switch off the + internal rate transformation.

+
+ +

Examples

+
# 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: Thu Oct 6 09:17:59 2016 +#> Date of summary: Thu Oct 6 09:17:59 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.153 s +#> +#> Weighting: none +#> +#> Starting values for parameters to be optimised: +#> value type +#> parent_0 85.1 state +#> alpha 1.0 deparm +#> beta 10.0 deparm +#> +#> Starting values for the transformed parameters actually optimised: +#> value lower upper +#> parent_0 85.100000 -Inf Inf +#> log_alpha 0.000000 -Inf Inf +#> log_beta 2.302585 -Inf Inf +#> +#> Fixed parameter values: +#> None +#> +#> Optimised, transformed parameters with symmetric confidence intervals: +#> Estimate Std. Error Lower Upper +#> parent_0 85.87000 2.2460 80.38000 91.3700 +#> log_alpha 0.05192 0.1605 -0.34080 0.4446 +#> log_beta 0.65100 0.2801 -0.03452 1.3360 +#> +#> Parameter correlation: +#> parent_0 log_alpha log_beta +#> parent_0 1.0000 -0.2033 -0.3624 +#> log_alpha -0.2033 1.0000 0.9547 +#> log_beta -0.3624 0.9547 1.0000 +#> +#> Residual standard error: 2.275 on 6 degrees of freedom +#> +#> Backtransformed parameters: +#> Confidence intervals for internally transformed parameters are asymmetric. +#> t-test (unrealistically) based on the assumption of normal distribution +#> for estimators of untransformed parameters. +#> Estimate t value Pr(>t) Lower Upper +#> parent_0 85.870 38.230 1.069e-08 80.3800 91.370 +#> alpha 1.053 6.231 3.953e-04 0.7112 1.560 +#> beta 1.917 3.570 5.895e-03 0.9661 3.806 +#> +#> Chi2 error levels in percent: +#> err.min n.optim df +#> All data 6.657 3 6 +#> parent 6.657 3 6 +#> +#> Estimated disappearance times: +#> DT50 DT90 DT50back +#> parent 1.785 15.15 4.56 +#> +#> Data: +#> time variable observed predicted residual +#> 0 parent 85.1 85.875 -0.7749 +#> 1 parent 57.9 55.191 2.7091 +#> 3 parent 29.9 31.845 -1.9452 +#> 7 parent 14.6 17.012 -2.4124 +#> 14 parent 9.7 9.241 0.4590 +#> 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 +#>
+# 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.252 1.176 0.914 +#>
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 +#> parent_sink parent_m1 m1_sink +#> 0.485524 0.514476 1.000000 +#> +#> $SFORB +#> logical(0) +#> +#> $distimes +#> 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, +# solution_type = "deSolve"))) +# coef(fit.deSolve) +# endpoints(fit.deSolve) +## --------------------------------------------- + +# Use stepwise fitting, using optimised parameters from parent only fit, FOMC +## Not run: ------------------------------------ +# FOMC_SFO <- mkinmod( +# parent = mkinsub("FOMC", "m1"), +# m1 = mkinsub("SFO")) +# # Fit the model to the FOCUS example dataset D using defaults +# fit.FOMC_SFO <- mkinfit(FOMC_SFO, FOCUS_2006_D) +# # Use starting parameters from parent only FOMC fit +# fit.FOMC = mkinfit("FOMC", FOCUS_2006_D, plot=TRUE) +# fit.FOMC_SFO <- mkinfit(FOMC_SFO, FOCUS_2006_D, +# parms.ini = fit.FOMC$bparms.ode, plot=TRUE) +# +# # Use stepwise fitting, using optimised parameters from parent only fit, SFORB +# SFORB_SFO <- mkinmod( +# parent = list(type = "SFORB", to = "m1", sink = TRUE), +# m1 = list(type = "SFO")) +# # Fit the model to the FOCUS example dataset D using defaults +# fit.SFORB_SFO <- mkinfit(SFORB_SFO, FOCUS_2006_D) +# fit.SFORB_SFO.deSolve <- mkinfit(SFORB_SFO, FOCUS_2006_D, solution_type = "deSolve") +# # Use starting parameters from parent only SFORB fit (not really needed in this case) +# fit.SFORB = mkinfit("SFORB", FOCUS_2006_D) +# fit.SFORB_SFO <- mkinfit(SFORB_SFO, FOCUS_2006_D, parms.ini = fit.SFORB$bparms.ode) +## --------------------------------------------- + +## Not run: ------------------------------------ +# # Weighted fits, including IRLS +# SFO_SFO.ff <- mkinmod(parent = mkinsub("SFO", "m1"), +# m1 = mkinsub("SFO"), use_of_ff = "max") +# f.noweight <- mkinfit(SFO_SFO.ff, FOCUS_2006_D) +# summary(f.noweight) +# f.irls <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, reweight.method = "obs") +# summary(f.irls) +# f.w.mean <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, weight = "mean") +# summary(f.w.mean) +# f.w.value <- mkinfit(SFO_SFO.ff, subset(FOCUS_2006_D, value != 0), err = "value") +# summary(f.w.value) +## --------------------------------------------- + +## Not run: ------------------------------------ +# # Manual weighting +# dw <- FOCUS_2006_D +# errors <- c(parent = 2, m1 = 1) +# dw$err.man <- errors[FOCUS_2006_D$name] +# f.w.man <- mkinfit(SFO_SFO.ff, dw, err = "err.man") +# summary(f.w.man) +# f.w.man.irls <- mkinfit(SFO_SFO.ff, dw, err = "err.man", +# reweight.method = "obs") +# summary(f.w.man.irls) +## ---------------------------------------------
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html new file mode 100644 index 00000000..9dd8fca0 --- /dev/null +++ b/docs/reference/mkinmod.html @@ -0,0 +1,206 @@ + + + + + + + + +mkinmod. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

The function usually takes several expressions, each assigning a compound name to + a list, specifying the kinetic model type and reaction or transfer to other + observed compartments. Instead of specifying several expressions, a list + of lists can be given in the speclist argument.

+ +

For the definition of model types and their parameters, the equations given + in the FOCUS and NAFTA guidance documents are used.

+ + +
mkinmod(..., use_of_ff = "min", speclist = NULL, quiet = FALSE, verbose = FALSE)
+ +

Arguments

+
+
...
+
+ For each observed variable, a list has to be specified as an argument, containing + at least a component type, specifying the type of kinetics to use + for the variable. Currently, single first order kinetics "SFO", + indeterminate order rate equation kinetics "IORE", or + single first order with reversible binding "SFORB" are implemented for all + variables, while + "FOMC", "DFOP" and "HS" can additionally be chosen for the first + variable which is assumed to be the source compartment. + Additionally, each component of the list can include a character vector to, + specifying names of variables to which a transfer is to be assumed in the + model. + If the argument use_of_ff is set to "min" (default) and the model for + the compartment is "SFO" or "SFORB", an additional component of the list + can be "sink=FALSE" effectively fixing the flux to sink to zero. +
+
use_of_ff
+
+ Specification of the use of formation fractions in the model equations and, if + applicable, the coefficient matrix. If "min", a minimum use of formation + fractions is made in order to avoid fitting the product of formation fractions + and rate constants. If "max", formation fractions are always used. +
+
speclist
+
+ The specification of the observed variables and their submodel types and + pathways can be given as a single list using this argument. Default is NULL. +
+
quiet
+
+ Should messages be suppressed? +
+
verbose
+
+ If TRUE, passed to cfunction if applicable to give + detailed information about the C function being built. +
+
+ +
+

Value

+ +

A list of class mkinmod for use with mkinfit, containing

+
+ +
+

Note

+ +

The IORE submodel is not well tested (yet). When using this model for metabolites, + you may want to read the second note in the help page to + mkinfit.

+
+ +
+

References

+ +

FOCUS (2006) “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, + http://focus.jrc.ec.europa.eu/dk

+

NAFTA Technical Working Group on Pesticides (not dated) Guidance for + Evaluating and Calculating Degradation Kinetics in Environmental + Media

+
+ +

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( +# parent = list(type = "SFO", to = "m1"), +# m1 = list(type = "SFO")) +# +# # Show details of creating the C function +# SFO_SFO <- mkinmod( +# parent = mkinsub("SFO", "m1"), +# m1 = mkinsub("SFO"), verbose = TRUE) +# +# # If we have several parallel metabolites +# # (compare tests/testthat/test_synthetic_data_for_UBA_2014.R) +# m_synth_DFOP_par <- mkinmod(parent = mkinsub("DFOP", c("M1", "M2")), +# M1 = mkinsub("SFO"), +# M2 = mkinsub("SFO"), +# use_of_ff = "max", quiet = TRUE) +# +# fit_DFOP_par_c <- mkinfit(m_synth_DFOP_par, +# synthetic_data_for_UBA_2014[[12]]$data, +# quiet = TRUE) +## ---------------------------------------------
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/mkinparplot.html b/docs/reference/mkinparplot.html new file mode 100644 index 00000000..f2fae22d --- /dev/null +++ b/docs/reference/mkinparplot.html @@ -0,0 +1,122 @@ + + + + + + + + +mkinparplot. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

This function plots the confidence intervals for the parameters + fitted using mkinfit.

+ + +
mkinparplot(object)
+ +

Arguments

+
+
object
+
+ A fit represented in an mkinfit object. +
+
+ +
+

Value

+ +

Nothing is returned by this function, as it is called for its side effect, namely to produce a plot.

+
+ +

Examples

+
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) +mkinparplot(fit)
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/mkinplot.html b/docs/reference/mkinplot.html new file mode 100644 index 00000000..51ca3992 --- /dev/null +++ b/docs/reference/mkinplot.html @@ -0,0 +1,118 @@ + + + + + + + + +mkinplot. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Deprecated function. It now only calls the plot method plot.mkinfit.

+ + +
mkinplot(fit, ...)
+ +

Arguments

+
+
fit
+
+ an object of class mkinfit. +
+
&#8230;
+
+ further arguments passed to plot.mkinfit. +
+
+ +
+

Value

+ +

The function is called for its side effect.

+
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html new file mode 100644 index 00000000..730792c1 --- /dev/null +++ b/docs/reference/mkinpredict.html @@ -0,0 +1,318 @@ + + + + + + + + +mkinpredict. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

This function produces a time series for all the observed variables in a + kinetic model as specified by mkinmod, using a specific set of + kinetic parameters and initial values for the state variables.

+ + +
mkinpredict(mkinmod, odeparms, odeini, outtimes, solution_type = "deSolve",
+              use_compiled = "auto", method.ode = "lsoda", atol = 1e-08, rtol = 1e-10,
+        map_output = TRUE, ...)
+ +

Arguments

+
+
mkinmod
+
+ A kinetic model as produced by mkinmod. +
+
odeparms
+
+ A numeric vector specifying the parameters used in the kinetic model, which + is generally defined as a set of ordinary differential equations. +
+
odeini
+
+ A numeric vectory containing the initial values of the state variables of + the model. Note that the state variables can differ from the observed + variables, for example in the case of the SFORB model. +
+
outtimes
+
+ A numeric vector specifying the time points for which model predictions + should be generated. +
+
solution_type
+
+ The method that should be used for producing the predictions. This should + generally be "analytical" if there is only one observed variable, and + usually "deSolve" in the case of several observed variables. The third + possibility "eigen" is faster but not applicable to some models e.g. + using FOMC for the parent compound. +
+
method.ode
+
+ The solution method passed via mkinpredict to + ode in case the solution type is "deSolve". The default + "lsoda" is performant, but sometimes fails to converge. +
+
use_compiled
+
+ If set to FALSE, no compiled version of the mkinmod + model is used, even if is present. +
+
atol
+
+ Absolute error tolerance, passed to ode. Default is 1e-8, + lower than in lsoda. +
+
rtol
+
+ Absolute error tolerance, passed to ode. Default is 1e-10, + much lower than in lsoda. +
+
map_output
+
+ Boolean to specify if the output should list values for the observed + variables (default) or for all state variables (if set to FALSE). +
+
&#8230;
+
+ Further arguments passed to the ode solver in case such a solver is used. +
+
+ +
+

Value

+ +

A matrix in the same format as the output of ode.

+
+ +

Examples

+
SFO <- mkinmod(degradinol = list(type = "SFO")) + # Compare solution types + mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, + solution_type = "analytical")
#> time degradinol +#> 1 0 100.0000000 +#> 2 1 74.0818221 +#> 3 2 54.8811636 +#> 4 3 40.6569660 +#> 5 4 30.1194212 +#> 6 5 22.3130160 +#> 7 6 16.5298888 +#> 8 7 12.2456428 +#> 9 8 9.0717953 +#> 10 9 6.7205513 +#> 11 10 4.9787068 +#> 12 11 3.6883167 +#> 13 12 2.7323722 +#> 14 13 2.0241911 +#> 15 14 1.4995577 +#> 16 15 1.1108997 +#> 17 16 0.8229747 +#> 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, + solution_type = "deSolve")
#> time degradinol +#> 1 0 100.0000000 +#> 2 1 74.0818221 +#> 3 2 54.8811636 +#> 4 3 40.6569660 +#> 5 4 30.1194212 +#> 6 5 22.3130160 +#> 7 6 16.5298888 +#> 8 7 12.2456428 +#> 9 8 9.0717953 +#> 10 9 6.7205513 +#> 11 10 4.9787068 +#> 12 11 3.6883167 +#> 13 12 2.7323722 +#> 14 13 2.0241911 +#> 15 14 1.4995577 +#> 16 15 1.1108996 +#> 17 16 0.8229747 +#> 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, + solution_type = "deSolve", use_compiled = FALSE)
#> time degradinol +#> 1 0 100.0000000 +#> 2 1 74.0818221 +#> 3 2 54.8811636 +#> 4 3 40.6569660 +#> 5 4 30.1194212 +#> 6 5 22.3130160 +#> 7 6 16.5298888 +#> 8 7 12.2456428 +#> 9 8 9.0717953 +#> 10 9 6.7205513 +#> 11 10 4.9787068 +#> 12 11 3.6883167 +#> 13 12 2.7323722 +#> 14 13 2.0241911 +#> 15 14 1.4995577 +#> 16 15 1.1108996 +#> 17 16 0.8229747 +#> 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, + solution_type = "eigen")
#> time degradinol +#> 1 0 100.0000000 +#> 2 1 74.0818221 +#> 3 2 54.8811636 +#> 4 3 40.6569660 +#> 5 4 30.1194212 +#> 6 5 22.3130160 +#> 7 6 16.5298888 +#> 8 7 12.2456428 +#> 9 8 9.0717953 +#> 10 9 6.7205513 +#> 11 10 4.9787068 +#> 12 11 3.6883167 +#> 13 12 2.7323722 +#> 14 13 2.0241911 +#> 15 14 1.4995577 +#> 16 15 1.1108997 +#> 17 16 0.8229747 +#> 18 17 0.6096747 +#> 19 18 0.4516581 +#> 20 19 0.3345965 +#> 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, + method = "lsoda")[21,]
#> time degradinol +#> 21 20 0.2478752 +#>
mkinpredict(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, + method = "rk4")[21,]
#> time degradinol +#> 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), + seq(0, 20, by = 0.01))[2001,]
#> time degradinol +#> 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( + 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.000 0.028 0.004 +#>
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 = "deSolve")[201,]))
#> time parent m1 +#> 201 20 4.978707 27.46227 +#>
#> user system elapsed +#> 0.016 0.004 0.002 +#>
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 = "deSolve", use_compiled = FALSE)[201,]))
#> time parent m1 +#> 201 20 4.978707 27.46227 +#>
#> user system elapsed +#> 0.036 0.000 0.035 +#>
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/mkinresplot.html b/docs/reference/mkinresplot.html new file mode 100644 index 00000000..fb9ab40d --- /dev/null +++ b/docs/reference/mkinresplot.html @@ -0,0 +1,166 @@ + + + + + + + + +mkinresplot. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

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 + using the argument show_residuals = TRUE.

+ + +
mkinresplot(object,
+    obs_vars = names(object$mkinmod$map),
+    xlim = c(0, 1.1 * max(object$data$time)),
+    xlab = "Time", ylab = "Residual",
+    maxabs = "auto", legend = TRUE, lpos = "topright", ...)
+ +

Arguments

+
+
object
+
+ A fit represented in an mkinfit object. +
+
obs_vars
+
+ A character vector of names of the observed variables for which residuals + should be plotted. Defaults to all observed variables in the model +
+
xlim
+
+ plot range in x direction. +
+
xlab
+
+ Label for the x axis. Defaults to "Time [days]". +
+
ylab
+
+ Label for the y axis. Defaults to "Residual [% of applied radioactivity]". +
+
maxabs
+
+ Maximum absolute value of the residuals. This is used for the scaling of + the y axis and defaults to "auto". +
+
legend
+
+ Should a legend be plotted? Defaults to "TRUE". +
+
lpos
+
+ Where should the legend be placed? Default is "topright". Will be passed on to + legend.
+
&#8230;
+
+ further arguments passed to plot. +
+
+ +
+

Value

+ +

Nothing is returned by this function, as it is called for its side effect, namely to produce a plot.

+
+ +
+

See also

+ +

mkinplot, for a way to plot the data and the fitted lines of the + mkinfit object.

+
+ +

Examples

+
model <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"))
Successfully compiled differential equation model from auto-generated C code.
fit <- mkinfit(model, FOCUS_2006_D, quiet = TRUE) +mkinresplot(fit, "m1")
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/mkinsub.html b/docs/reference/mkinsub.html new file mode 100644 index 00000000..6b079c40 --- /dev/null +++ b/docs/reference/mkinsub.html @@ -0,0 +1,147 @@ + + + + + + + + +mkinsub. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

This is a convenience function to set up the lists used as arguments for + mkinmod.

+ + +
mkinsub(submodel, to = NULL, sink = TRUE, full_name = NA)
+ +

Arguments

+
+
submodel
+
+ Character vector of length one to specify the submodel type. See + mkinmod for the list of allowed submodel names. +
+
to
+
+ Vector of the names of the state variable to which a transformation + shall be included in the model. +
+
sink
+
+ Should a pathway to sink be included in the model in addition to the + pathways to other state variables? +
+
full_name
+
+ An optional name to be used e.g. for plotting fits performed with the model. + You can use non-ASCII characters here, but then your R code will not be + portable, i.e. may produce unintended plot results on other + operating systems or system configurations. +
+
+ +
+

Value

+ +

A list for use with mkinmod.

+
+ +

Examples

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

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html new file mode 100644 index 00000000..5b624893 --- /dev/null +++ b/docs/reference/mmkin.html @@ -0,0 +1,178 @@ + + + + + + + + +mmkin. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

This function calls mkinfit on all combinations of models and datasets + specified in its first two arguments.

+ + +
mmkin(models, datasets,
+      cores = round(detectCores()/2), cluster = NULL, ...)
+ +

Arguments

+
+
models
+
+ Either a character vector of shorthand names ("SFO", "FOMC", "DFOP", + "HS", "SFORB"), or an optionally named list of mkinmod + objects. +
+
datasets
+
+ An optionally named list of datasets suitable as observed data for + mkinfit. +
+
cores
+
+ The number of cores to be used for multicore processing. This is only + used when the cluster argument is NULL. +
+
cluster
+
+ A cluster as returned by makeCluster to be used for parallel + execution. +
+
&#8230;
+
+ Further arguments that will be passed to mkinfit. +
+
+ +
+

Value

+ +

A matrix of mkinfit objects that can be indexed using the model + and dataset names as row and column indices.

+
+ +
+

See also

+ +

[.mmkin for subsetting, plot.mmkin for plotting.

+
+ +

Examples

+
## Not run: ------------------------------------ +# m_synth_SFO_lin <- mkinmod(parent = mkinsub("SFO", "M1"), +# M1 = mkinsub("SFO", "M2"), +# M2 = mkinsub("SFO"), use_of_ff = "max") +# +# m_synth_FOMC_lin <- mkinmod(parent = mkinsub("FOMC", "M1"), +# M1 = mkinsub("SFO", "M2"), +# M2 = mkinsub("SFO"), use_of_ff = "max") +# +# models <- list(SFO_lin = m_synth_SFO_lin, FOMC_lin = m_synth_FOMC_lin) +# datasets <- lapply(synthetic_data_for_UBA_2014[1:3], function(x) x$data) +# names(datasets) <- paste("Dataset", 1:3) +# +# time_default <- system.time(fits.0 <- mmkin(models, datasets)) +# time_1 <- system.time(fits.1 <- mmkin(models, datasets, cores = 1)) +# +# time_default +# time_1 +# +# endpoints(fits[["SFO_lin", 2]]) +# +# # Plot.mkinfit handles rows or columns of mmkin result objects +# plot(fits.0[1, ]) +# plot(fits.0[1, ], obs_var = c("M1", "M2")) +# plot(fits.0[, 1]) +# # Use double brackets to extract a single mkinfit object, which will be plotted +# # by plot.mkinfit +# plot(fits.0[[1, 1]], sep_obs = TRUE, show_residuals = TRUE, show_errmin = TRUE) +# # Plotting with mmkin (single brackets, extracting an mmkin object) does not +# # allow to plot the observed variables separately +# plot(fits.0[1, 1]) +## ---------------------------------------------
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/plot.mkinfit.html b/docs/reference/plot.mkinfit.html new file mode 100644 index 00000000..94aebf63 --- /dev/null +++ b/docs/reference/plot.mkinfit.html @@ -0,0 +1,231 @@ + + + + + + + + +plot.mkinfit. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Solves the differential equations with the optimised and fixed parameters + from a previous successful call to mkinfit and plots + the observed data together with the solution of the fitted model.

+ + +
# S3 method for mkinfit
+plot(x, fit = x,
+  obs_vars = names(fit$mkinmod$map),
+  xlab = "Time", ylab = "Observed", 
+  xlim = range(fit$data$time),
+  ylim = "default",
+  col_obs = 1:length(obs_vars), pch_obs = col_obs, 
+  lty_obs = rep(1, length(obs_vars)),
+  add = FALSE, legend = !add,
+  show_residuals = FALSE, maxabs = "auto",
+  sep_obs = FALSE, rel.height.middle = 0.9,
+  lpos = "topright", inset = c(0.05, 0.05), 
+  show_errmin = FALSE, errmin_digits = 3, …)
+plot_sep(fit, sep_obs = TRUE,  show_residuals = TRUE, show_errmin = TRUE, …)
+ +

Arguments

+
+
x
+
+ Alias for fit introduced for compatibility with the generic S3 method. +
+
fit
+
+ An object of class mkinfit. +
+
obs_vars
+
+ A character vector of names of the observed variables for which the + data and the model should be plotted. Defauls to all observed variables + in the model. +
+
xlab
+
+ Label for the x axis. +
+
ylab
+
+ Label for the y axis. +
+
xlim
+
+ Plot range in x direction. +
+
ylim
+
+ Plot range in y direction. +
+
col_obs
+
+ Colors used for plotting the observed data and the corresponding model prediction lines. +
+
pch_obs
+
+ Symbols to be used for plotting the data. +
+
lty_obs
+
+ Line types to be used for the model predictions. +
+
add
+
+ Should the plot be added to an existing plot? +
+
legend
+
+ Should a legend be added to the plot? +
+
show_residuals
+
+ Should residuals be shown? If only one plot of the fits is shown, the + residual plot is in the lower third of the plot? Otherwise, i.e. if + "sep_obs" is given, the residual plots will be located to the right of + the plots of the fitted curves. +
+
maxabs
+
+ Maximum absolute value of the residuals. This is used for the scaling of + the y axis and defaults to "auto". +
+
sep_obs
+
+ Should the observed variables be shown in separate subplots? If yes, residual plots + requested by "show_residuals" will be shown next to, not below the plot of the fits. +
+
rel.height.middle
+
+ The relative height of the middle plot, if more than two rows of plots are shown. +
+
lpos
+
+ Position(s) of the legend(s). Passed to legend as the first argument. + If not length one, this should be of the same length as the obs_var argument. +
+
inset
+
+ Passed to legend if applicable. +
+
show_errmin
+
+ Should the FOCUS chi2 error value be shown in the upper margin of the plot? +
+
errmin_digits
+
+ The number of significant digits for rounding the FOCUS chi2 error percentage. +
+
&#8230;
+
+ Further arguments passed to plot. +
+
+ +
+

Value

+ +

The function is called for its side effect.

+
+ +

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") +plot(fit)
plot(fit, show_residuals = TRUE)
+# Show the observed variables separately +plot(fit, sep_obs = TRUE, lpos = c("topright", "bottomright"))
+# Show the observed variables separately, with residuals +plot(fit, sep_obs = TRUE, show_residuals = TRUE, lpos = c("topright", "bottomright"), + show_errmin = TRUE)
+# The same can be obtained with less typing, using the convenience function plot_sep +plot_sep(fit, lpos = c("topright", "bottomright"))
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/plot.mmkin.html b/docs/reference/plot.mmkin.html new file mode 100644 index 00000000..358da679 --- /dev/null +++ b/docs/reference/plot.mmkin.html @@ -0,0 +1,156 @@ + + + + + + + + +plot.mmkin. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

When x is a row selected from an mmkin object ([.mmkin), the same model + fitted for at least one dataset is shown. When it is a column, the fit of at least one model + to the same dataset is shown.

+ + +
# S3 method for mmkin
+plot(x, main = "auto", legends = 1, errmin_var = "All data", errmin_digits = 3,
+              cex = 0.7, rel.height.middle = 0.9, ...)
+ +

Arguments

+
+
x
+
+ An object of class mmkin, with either one row or one column. +
+
main
+
+ The main title placed on the outer margin of the plot. +
+
legends
+
+ An index for the fits for which legends should be shown. +
+
errmin_var
+
+ The variable for which the FOCUS chi2 error value should be shown. +
+
errmin_digits
+
+ The number of significant digits for rounding the FOCUS chi2 error percentage. +
+
cex
+
+ Passed to the plot functions and mtext. +
+
rel.height.middle
+
+ The relative height of the middle plot, if more than two rows of plots are shown. +
+
&#8230;
+
+ Further arguments passed to plot.mkinfit and mkinresplot. +
+
+ +
+

Value

+ +

The function is called for its side effect.

+
+ +

Examples

+
# 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") + plot(fits[, "FOCUS C"])
plot(fits["FOMC", ])
+ # We can also plot a single fit, if we like the way mmkin works, but then the plot + # height should be smaller than the plot width (this is not possible for the html pages + # generated by staticdocs, as far as I know). + plot(fits["FOMC", "FOCUS C"]) # same as plot(fits[1, 2])
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/print.mkinds.html b/docs/reference/print.mkinds.html new file mode 100644 index 00000000..dea5f75c --- /dev/null +++ b/docs/reference/print.mkinds.html @@ -0,0 +1,109 @@ + + + + + + + + +print.mkinds. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Print mkinds objects.

+ + +
# S3 method for mkinds
+print(x, ...)
+ +

Arguments

+
+
x
+
+ An mkinds object. +
+
&#8230;
+
+ Not used. +
+
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/print.mkinmod.html b/docs/reference/print.mkinmod.html new file mode 100644 index 00000000..38663f8f --- /dev/null +++ b/docs/reference/print.mkinmod.html @@ -0,0 +1,109 @@ + + + + + + + + +print.mkinmod. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Print mkinmod objects in a way that the user finds his way to get to its components.

+ + +
# S3 method for mkinmod
+print(x, ...)
+ +

Arguments

+
+
x
+
+ An mkinmod object. +
+
&#8230;
+
+ Not used. +
+
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/schaefer07_complex_case.html b/docs/reference/schaefer07_complex_case.html new file mode 100644 index 00000000..12776c74 --- /dev/null +++ b/docs/reference/schaefer07_complex_case.html @@ -0,0 +1,131 @@ + + + + + + + + +schaefer07_complex_case. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

This dataset was used for a comparison of KinGUI and ModelMaker to check the + software quality of KinGUI in the original publication (Schäfer et al., 2007). + The results from the fitting are also included.

+ + +
data(schaefer07_complex_case)
+ +
+

Format

+ +

The data set is a data frame with 8 observations on the following 6 variables. +

+
time
a numeric vector
+
parent
a numeric vector
+
A1
a numeric vector
+
B1
a numeric vector
+
C1
a numeric vector
+
A2
a numeric vector
+

+

The results are a data frame with 14 results for different parameter values

+
+ +
+

References

+ +

Schäfer D, Mikolasch B, 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.

+
+ +

Examples

+
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)
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html new file mode 100644 index 00000000..e0cdfe23 --- /dev/null +++ b/docs/reference/summary.mkinfit.html @@ -0,0 +1,229 @@ + + + + + + + + +summary.mkinfit. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

Lists model equations, the summary as returned by summary.modFit, + the chi2 error levels calculated according to FOCUS guidance (2006) as far + as defined therein, and optionally the data, consisting of observed, predicted + and residual values.

+ + +
# S3 method for mkinfit
+summary(object, data = TRUE, distimes = TRUE, alpha = 0.05, ...)
+# S3 method for summary.mkinfit
+print(x, digits = max(3, getOption("digits") - 3), ...)
+ +

Arguments

+
+
object
+
+ an object of class mkinfit. +
+
x
+
+ an object of class summary.mkinfit. +
+
data
+
+ logical, indicating whether the data should be included in the summary. +
+
distimes
+
+ logical, indicating whether DT50 and DT90 values should be included. +
+
alpha
+
+ error level for confidence interval estimation from t distribution +
+
digits
+
+ Number of digits to use for printing +
+
&#8230;
+
+ optional arguments passed to methods like print. +
+
+ +
+

Value

+ +

The summary function returns a list derived from + summary.modFit, with components, among others

+

The print method is called for its side effect, i.e. printing the summary.

+
+ +
+

References

+ +

FOCUS (2006) “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, + http://focus.jrc.ec.europa.eu/dk

+
+ +

Examples

+
summary(mkinfit(mkinmod(parent = list(type = "SFO")), FOCUS_2006_A, quiet = TRUE))
#> mkin version: 0.9.44.9000 +#> R version: 3.3.1 +#> Date of fit: Thu Oct 6 09:18:07 2016 +#> Date of summary: Thu Oct 6 09:18:07 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.079 s +#> +#> Weighting: none +#> +#> Starting values for parameters to be optimised: +#> value type +#> parent_0 101.24 state +#> k_parent_sink 0.10 deparm +#> +#> Starting values for the transformed parameters actually optimised: +#> value lower upper +#> parent_0 101.240000 -Inf Inf +#> log_k_parent_sink -2.302585 -Inf Inf +#> +#> Fixed parameter values: +#> None +#> +#> Optimised, transformed parameters with symmetric confidence intervals: +#> Estimate Std. Error Lower Upper +#> parent_0 109.200 4.3910 98.410 119.900 +#> log_k_parent_sink -3.291 0.1152 -3.573 -3.009 +#> +#> Parameter correlation: +#> parent_0 log_k_parent_sink +#> parent_0 1.000 0.575 +#> log_k_parent_sink 0.575 1.000 +#> +#> Residual standard error: 6.08 on 6 degrees of freedom +#> +#> Backtransformed parameters: +#> Confidence intervals for internally transformed parameters are asymmetric. +#> t-test (unrealistically) based on the assumption of normal distribution +#> for estimators of untransformed parameters. +#> Estimate t value Pr(>t) Lower Upper +#> parent_0 109.20000 24.860 1.394e-07 98.41000 119.90000 +#> k_parent_sink 0.03722 8.679 6.457e-05 0.02807 0.04934 +#> +#> Chi2 error levels in percent: +#> err.min n.optim df +#> All data 8.385 2 6 +#> parent 8.385 2 6 +#> +#> Resulting formation fractions: +#> ff +#> parent_sink 1 +#> +#> Estimated disappearance times: +#> DT50 DT90 +#> parent 18.62 61.87 +#> +#> Data: +#> time variable observed predicted residual +#> 0 parent 101.24 109.153 -7.9132 +#> 3 parent 99.27 97.622 1.6484 +#> 7 parent 90.11 84.119 5.9913 +#> 14 parent 72.19 64.826 7.3641 +#> 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 +#>
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/synthetic_data_for_UBA.html b/docs/reference/synthetic_data_for_UBA.html new file mode 100644 index 00000000..04550199 --- /dev/null +++ b/docs/reference/synthetic_data_for_UBA.html @@ -0,0 +1,157 @@ + + + + + + + + +synthetic_data_for_UBA_2014. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

The 12 datasets were generated using four different models and three different + variance components. The four models are either the SFO or the DFOP model with either + two sequential or two parallel metabolites.

+ +

Variance component 'a' is based on a normal distribution with standard deviation of 3, + Variance component 'b' is also based on a normal distribution, but with a standard deviation of 7. + Variance component 'c' is based on the error model from Rocke and Lorenzato (1995), with the + minimum standard deviation (for small y values) of 0.5, and a proportionality constant of 0.07 + for the increase of the standard deviation with y.

+ +

Initial concentrations for metabolites and all values where adding the variance component resulted + in a value below the assumed limit of detection of 0.1 were set to NA.

+ +

As an example, the first dataset has the title SFO_lin_a and is based on the SFO model + with two sequential metabolites (linear pathway), with added variance component 'a'.

+ +

Compare also the code in the example section to see the degradation models.

+ + +
synthetic_data_for_UBA_2014
+ +
+

Format

+ +

A list containing datasets in the form internally used by the 'gmkin' package. + The list has twelfe components. Each of the components is one dataset that has, + among others, the following components +

+
title
The name of the dataset, e.g. SFO_lin_a
+
data
A data frame with the data in the form expected by mkinfit
+

+
+ +
+

Source

+ +

Ranke (2014) Prüfung und Validierung von Modellierungssoftware als Alternative + zu ModelMaker 4.0, Umweltbundesamt Projektnummer 27452

+

Rocke, David M. und Lorenzato, Stefan (1995) A two-component model for + measurement error in analytical chemistry. Technometrics 37(2), 176-184.

+
+ +

Examples

+
## Not run: ------------------------------------ +# m_synth_SFO_lin <- mkinmod(parent = list(type = "SFO", to = "M1"), +# M1 = list(type = "SFO", to = "M2"), +# M2 = list(type = "SFO"), use_of_ff = "max") +# +# +# m_synth_SFO_par <- mkinmod(parent = list(type = "SFO", to = c("M1", "M2"), +# sink = FALSE), +# M1 = list(type = "SFO"), +# M2 = list(type = "SFO"), use_of_ff = "max") +# +# m_synth_DFOP_lin <- mkinmod(parent = list(type = "DFOP", to = "M1"), +# M1 = list(type = "SFO", to = "M2"), +# M2 = list(type = "SFO"), use_of_ff = "max") +# +# m_synth_DFOP_par <- mkinmod(parent = list(type = "DFOP", to = c("M1", "M2"), +# sink = FALSE), +# M1 = list(type = "SFO"), +# M2 = list(type = "SFO"), use_of_ff = "max") +# +# mkinfit(m_synth_SFO_lin, synthetic_data_for_UBA_2014[[1]]$data) +## ---------------------------------------------
+
+
+
+
+ + +
+ + + diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html new file mode 100644 index 00000000..3b8be856 --- /dev/null +++ b/docs/reference/transform_odeparms.html @@ -0,0 +1,276 @@ + + + + + + + + +transform_odeparms. mkin + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+
+ +

The transformations are intended to map parameters that should only take + on restricted values to the full scale of real numbers. For kinetic rate + 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 ilr 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. + This is no problem for the internal use in mkinfit.

+ + +
transform_odeparms(parms, mkinmod,
+                   transform_rates = TRUE, transform_fractions = TRUE)
+backtransform_odeparms(transparms, mkinmod,
+                       transform_rates = TRUE, transform_fractions = TRUE)
+ +

Arguments

+
+
parms
+
+ Parameters of kinetic models as used in the differential equations. +
+
transparms
+
+ Transformed parameters of kinetic models as used in the fitting procedure. +
+
mkinmod
+
+ The kinetic model of class mkinmod, containing the names of + the model variables that are needed for grouping the formation fractions + before ilr transformation, the parameter names and + the information if the pathway to sink is included in the model. +
+
transform_rates
+
+ Boolean specifying if kinetic rate constants should be transformed in the + model specification used in the fitting for better compliance with the + assumption of normal distribution of the estimator. If TRUE, also + alpha and beta parameters of the FOMC model are log-transformed, as well + as k1 and k2 rate constants for the DFOP and HS models and the break point tb + of the HS model. +
+
transform_fractions
+
+ Boolean specifying if formation fractions constants should be transformed in the + model specification used in the fitting for better compliance with the + assumption of normal distribution of the estimator. The default (TRUE) is + to do transformations. 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 ilr + transformation. +
+
+ +
+

Value

+ +

A vector of transformed or backtransformed parameters with the same names + as the original parameters.

+
+ +

Examples

+
SFO_SFO <- mkinmod( + parent = list(type = "SFO", to = "m1", sink = TRUE), + m1 = list(type = "SFO"))
Successfully compiled differential equation model from auto-generated C code.
# 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: Thu Oct 6 09:18:08 2016 +#> Date of summary: Thu Oct 6 09:18:08 2016 +#> +#> Equations: +#> d_parent = - k_parent_sink * parent - k_parent_m1 * parent +#> d_m1 = + k_parent_m1 * parent - k_m1_sink * m1 +#> +#> Model predictions using solution type deSolve +#> +#> Fitted with method Port using 153 model solutions performed in 0.636 s +#> +#> Weighting: none +#> +#> Starting values for parameters to be optimised: +#> value type +#> parent_0 100.7500 state +#> k_parent_sink 0.1000 deparm +#> k_parent_m1 0.1001 deparm +#> k_m1_sink 0.1002 deparm +#> +#> Starting values for the transformed parameters actually optimised: +#> value lower upper +#> parent_0 100.750000 -Inf Inf +#> log_k_parent_sink -2.302585 -Inf Inf +#> log_k_parent_m1 -2.301586 -Inf Inf +#> log_k_m1_sink -2.300587 -Inf Inf +#> +#> Fixed parameter values: +#> value type +#> m1_0 0 state +#> +#> Optimised, transformed parameters with symmetric confidence intervals: +#> Estimate Std. Error Lower Upper +#> parent_0 99.600 1.61400 96.330 102.900 +#> log_k_parent_sink -3.038 0.07826 -3.197 -2.879 +#> log_k_parent_m1 -2.980 0.04124 -3.064 -2.897 +#> log_k_m1_sink -5.248 0.13610 -5.523 -4.972 +#> +#> Parameter correlation: +#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink +#> parent_0 1.00000 0.6075 -0.06625 -0.1701 +#> log_k_parent_sink 0.60752 1.0000 -0.08740 -0.6253 +#> log_k_parent_m1 -0.06625 -0.0874 1.00000 0.4716 +#> log_k_m1_sink -0.17006 -0.6253 0.47163 1.0000 +#> +#> Residual standard error: 3.211 on 36 degrees of freedom +#> +#> Backtransformed parameters: +#> Confidence intervals for internally transformed parameters are asymmetric. +#> t-test (unrealistically) based on the assumption of normal distribution +#> for estimators of untransformed parameters. +#> Estimate t value Pr(>t) Lower Upper +#> parent_0 99.600000 61.720 2.024e-38 96.330000 1.029e+02 +#> k_parent_sink 0.047920 12.780 3.050e-15 0.040890 5.616e-02 +#> k_parent_m1 0.050780 24.250 3.407e-24 0.046700 5.521e-02 +#> k_m1_sink 0.005261 7.349 5.758e-09 0.003992 6.933e-03 +#> +#> Chi2 error levels in percent: +#> err.min n.optim df +#> All data 6.398 4 15 +#> parent 6.827 3 6 +#> m1 4.490 1 9 +#> +#> Resulting formation fractions: +#> ff +#> parent_sink 0.4855 +#> parent_m1 0.5145 +#> m1_sink 1.0000 +#> +#> Estimated disappearance times: +#> DT50 DT90 +#> parent 7.023 23.33 +#> m1 131.761 437.70 +#>
+## Not run: ------------------------------------ +# fit.2 <- mkinfit(SFO_SFO, FOCUS_2006_D, transform_rates = FALSE) +# summary(fit.2, data=FALSE) +## --------------------------------------------- + +initials <- fit$start$value +names(initials) <- rownames(fit$start) +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 +#>
+## Not run: ------------------------------------ +# # The case of formation fractions +# SFO_SFO.ff <- mkinmod( +# parent = list(type = "SFO", to = "m1", sink = TRUE), +# m1 = list(type = "SFO"), +# use_of_ff = "max") +# +# fit.ff <- mkinfit(SFO_SFO.ff, FOCUS_2006_D) +# summary(fit.ff, data = FALSE) +# initials <- c("f_parent_to_m1" = 0.5) +# transformed <- transform_odeparms(initials, SFO_SFO.ff) +# backtransform_odeparms(transformed, SFO_SFO.ff) +# +# # And without sink +# SFO_SFO.ff.2 <- mkinmod( +# parent = list(type = "SFO", to = "m1", sink = FALSE), +# m1 = list(type = "SFO"), +# use_of_ff = "max") +# +# +# fit.ff.2 <- mkinfit(SFO_SFO.ff.2, FOCUS_2006_D) +# summary(fit.ff.2, data = FALSE) +## ---------------------------------------------
+
+
+

Author

+ + Johannes Ranke + +
+
+ + +
+ + + diff --git a/docs/reference/unknown-10.png b/docs/reference/unknown-10.png new file mode 100644 index 00000000..09bb687c Binary files /dev/null and b/docs/reference/unknown-10.png differ diff --git a/docs/reference/unknown-2.png b/docs/reference/unknown-2.png new file mode 100644 index 00000000..a26e413f Binary files /dev/null and b/docs/reference/unknown-2.png differ diff --git a/docs/reference/unknown-4.png b/docs/reference/unknown-4.png new file mode 100644 index 00000000..f23ed172 Binary files /dev/null and b/docs/reference/unknown-4.png differ diff --git a/docs/reference/unknown-6.png b/docs/reference/unknown-6.png new file mode 100644 index 00000000..dc24d92f Binary files /dev/null and b/docs/reference/unknown-6.png differ diff --git a/docs/reference/unknown-8.png b/docs/reference/unknown-8.png new file mode 100644 index 00000000..e4ab674a Binary files /dev/null and b/docs/reference/unknown-8.png differ -- cgit v1.2.1