From b5ee48a86e4b1d4c05aaadb80b44954e2e994ebc Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 27 May 2020 07:12:51 +0200 Subject: Add docs generated using released version 0.9.52 --- docs/reference/AIC.mmkin.html | 6 +- docs/reference/Extract.mmkin.html | 2 +- docs/reference/NAFTA_SOP_Attachment.html | 4 +- docs/reference/confint.mkinfit.html | 78 ++--- docs/reference/create_deg_func.html | 10 +- docs/reference/experimental_data_for_UBA-1.png | Bin 107146 -> 107152 bytes docs/reference/get_deg_func.html | 5 +- docs/reference/index.html | 11 +- docs/reference/loftest-3.png | Bin 78761 -> 78754 bytes docs/reference/logistic.solution-3.png | Bin 80598 -> 0 bytes docs/reference/logistic.solution-4.png | Bin 29336 -> 0 bytes docs/reference/logistic.solution.html | 14 +- docs/reference/mccall81_245T-1.png | Bin 58310 -> 0 bytes docs/reference/mccall81_245T.html | 20 +- docs/reference/mkinfit.html | 216 ++++++------ docs/reference/mkinmod.html | 2 +- docs/reference/mkinparplot-1.png | Bin 16468 -> 16468 bytes docs/reference/mkinpredict.html | 8 +- docs/reference/mmkin-3.png | Bin 100799 -> 100817 bytes docs/reference/mmkin-5.png | Bin 66958 -> 66959 bytes docs/reference/mmkin.html | 20 +- docs/reference/nlme-1.png | Bin 70555 -> 71631 bytes docs/reference/nlme.html | 31 +- docs/reference/nlme.mmkin.html | 79 ++--- docs/reference/parms.html | 105 +----- docs/reference/plot.nlme.mmkin-2.png | Bin 35346 -> 35346 bytes docs/reference/saemix-1.png | Bin 31551 -> 0 bytes docs/reference/saemix-2.png | Bin 58815 -> 0 bytes docs/reference/saemix-3.png | Bin 40023 -> 0 bytes docs/reference/saemix-4.png | Bin 37936 -> 0 bytes docs/reference/saemix-5.png | Bin 12062 -> 0 bytes docs/reference/saemix.html | 446 ------------------------ docs/reference/schaefer07_complex_case-1.png | Bin 67740 -> 67741 bytes docs/reference/schaefer07_complex_case.html | 10 +- docs/reference/summary.mkinfit.html | 12 +- docs/reference/synthetic_data_for_UBA_2014.html | 36 +- docs/reference/test_data_from_UBA_2014.html | 30 +- docs/reference/transform_odeparms.html | 16 +- docs/reference/update.mkinfit.html | 2 +- 39 files changed, 308 insertions(+), 855 deletions(-) delete mode 100644 docs/reference/logistic.solution-3.png delete mode 100644 docs/reference/logistic.solution-4.png delete mode 100644 docs/reference/mccall81_245T-1.png delete mode 100644 docs/reference/saemix-1.png delete mode 100644 docs/reference/saemix-2.png delete mode 100644 docs/reference/saemix-3.png delete mode 100644 docs/reference/saemix-4.png delete mode 100644 docs/reference/saemix-5.png delete mode 100644 docs/reference/saemix.html (limited to 'docs/reference') diff --git a/docs/reference/AIC.mmkin.html b/docs/reference/AIC.mmkin.html index 3f474d56..58590f52 100644 --- a/docs/reference/AIC.mmkin.html +++ b/docs/reference/AIC.mmkin.html @@ -189,13 +189,13 @@ dataframe if there are several fits in the column).

# of parameters, the higher (worse) the AIC AIC(f[, "FOCUS A"])
#> df AIC #> SFO 3 55.28197 -#> FOMC 4 57.28211 +#> FOMC 4 57.28202 #> DFOP 5 59.28197
AIC(f[, "FOCUS A"], k = 0) # If we do not penalize additional parameters, we get nearly the same
#> df AIC #> SFO 3 49.28197 -#> FOMC 4 49.28211 +#> FOMC 4 49.28202 #> DFOP 5 49.28197
BIC(f[, "FOCUS A"]) # Comparing the BIC gives a very similar picture
#> df BIC #> SFO 3 55.52030 -#> FOMC 4 57.59987 +#> FOMC 4 57.59979 #> DFOP 5 59.67918
# For FOCUS C, the more complex models fit better AIC(f[, "FOCUS C"])
#> df AIC diff --git a/docs/reference/Extract.mmkin.html b/docs/reference/Extract.mmkin.html index b7e8427e..a0916dba 100644 --- a/docs/reference/Extract.mmkin.html +++ b/docs/reference/Extract.mmkin.html @@ -214,7 +214,7 @@ either a list of mkinfit objects or a single mkinfit object.

#> #> $evaluations #> function gradient -#> 25 78 +#> 25 72 #> #> $message #> [1] "both X-convergence and relative convergence (5)" diff --git a/docs/reference/NAFTA_SOP_Attachment.html b/docs/reference/NAFTA_SOP_Attachment.html index 99b9f8c3..eadab723 100644 --- a/docs/reference/NAFTA_SOP_Attachment.html +++ b/docs/reference/NAFTA_SOP_Attachment.html @@ -188,7 +188,7 @@ #> Estimate Pr(>t) Lower Upper #> parent_0 9.99e+01 1.41e-26 98.8116 101.0810 #> k1 2.67e-02 5.05e-06 0.0243 0.0295 -#> k2 2.17e-12 5.00e-01 0.0000 Inf +#> k2 2.86e-12 5.00e-01 0.0000 Inf #> g 6.47e-01 3.67e-06 0.6248 0.6677 #> sigma 1.27e+00 8.91e-06 0.8395 1.6929 #> @@ -197,7 +197,7 @@ #> DT50 DT90 DT50_rep #> SFO 67.7 2.25e+02 6.77e+01 #> IORE 58.2 1.07e+03 3.22e+02 -#> DFOP 55.5 5.83e+11 3.20e+11 +#> DFOP 55.5 4.42e+11 2.42e+11 #> #> Representative half-life: #> [1] 321.51
plot(nafta_att_p5a)
diff --git a/docs/reference/confint.mkinfit.html b/docs/reference/confint.mkinfit.html index 0686c7bb..a9080c39 100644 --- a/docs/reference/confint.mkinfit.html +++ b/docs/reference/confint.mkinfit.html @@ -79,7 +79,7 @@ method of Venzon and Moolgavkar (1988)." /> mkin - 0.9.50.3 + 0.9.50.2 @@ -116,9 +116,6 @@ method of Venzon and Moolgavkar (1988)." />
  • Example evaluation of NAFTA SOP Attachment examples
  • -
  • - Some benchmark timings -
  • @@ -171,8 +168,7 @@ method of Venzon and Moolgavkar (1988).

    method = c("quadratic", "profile"), transformed = TRUE, backtransform = TRUE, - cores = parallel::detectCores(), - rel_tol = 0.01, + cores = round(detectCores()/2), quiet = FALSE, ... ) @@ -226,12 +222,6 @@ their confidence intervals?

    cores

    The number of cores to be used for multicore processing. On Windows machines, cores > 1 is currently not supported.

    - - - rel_tol -

    If the method is 'profile', what should be the accuracy -of the lower and upper bounds, relative to the estimate obtained from -the quadratic method?

    quiet @@ -281,28 +271,28 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, use_of_ff = "max", quiet = TRUE) f_d_1 <- mkinfit(SFO_SFO, subset(FOCUS_2006_D, value != 0), quiet = TRUE) system.time(ci_profile <- confint(f_d_1, method = "profile", cores = 1, quiet = TRUE))
    #> user system elapsed -#> 3.689 0.991 3.361
    # Using more cores does not save much time here, as parent_0 takes up most of the time +#> 3.430 0.000 3.432
    # Using more cores does not save much time here, as parent_0 takes up most of the time # If we additionally exclude parent_0 (the confidence of which is often of # minor interest), we get a nice performance improvement from about 50 # seconds to about 12 seconds if we use at least four cores system.time(ci_profile_no_parent_0 <- confint(f_d_1, method = "profile", - c("k_parent_sink", "k_parent_m1", "k_m1_sink", "sigma"), cores = n_cores))
    #> Profiling the likelihood
    #> Warning: scheduled cores 2, 1, 3 encountered errors in user code, all values of the jobs will be affected
    #> Error in dimnames(x) <- dn: length of 'dimnames' [2] not equal to array extent
    #> Timing stopped at: 0.007 0.042 0.193
    ci_profile
    #> 2.5% 97.5% + c("k_parent_sink", "k_parent_m1", "k_m1_sink", "sigma"), cores = n_cores))
    #> Profiling the likelihood
    #> Warning: scheduled cores 1, 2, 3 encountered errors in user code, all values of the jobs will be affected
    #> Error in dimnames(x) <- dn: length of 'dimnames' [2] not equal to array extent
    #> Timing stopped at: 0.012 0.042 0.211
    ci_profile
    #> 2.5% 97.5% #> parent_0 96.456003640 1.027703e+02 #> k_parent 0.090911032 1.071578e-01 #> k_m1 0.003892605 6.702778e-03 #> f_parent_to_m1 0.471328495 5.611550e-01 #> sigma 2.535612399 3.985263e+00
    ci_quadratic_transformed <- confint(f_d_1, method = "quadratic") ci_quadratic_transformed
    #> 2.5% 97.5% -#> parent_0 96.403839460 1.027931e+02 +#> parent_0 96.403839476 1.027931e+02 #> k_parent 0.090823790 1.072543e-01 #> k_m1 0.004012216 6.897547e-03 #> f_parent_to_m1 0.469118713 5.595960e-01 #> sigma 2.396089689 3.854918e+00
    ci_quadratic_untransformed <- confint(f_d_1, method = "quadratic", transformed = FALSE) ci_quadratic_untransformed
    #> 2.5% 97.5% -#> parent_0 96.403839413 1.027931e+02 +#> parent_0 96.403839429 1.027931e+02 #> k_parent 0.090491931 1.069035e-01 #> k_m1 0.003835483 6.685819e-03 -#> f_parent_to_m1 0.469113365 5.598386e-01 +#> f_parent_to_m1 0.469113364 5.598386e-01 #> sigma 2.396089689 3.854918e+00
    # Against the expectation based on Bates and Watts (1988), the confidence # intervals based on the internal parameter transformation are less # congruent with the likelihood based intervals. Note the superiority of the @@ -314,7 +304,7 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, #> k_parent TRUE TRUE #> k_m1 FALSE FALSE #> f_parent_to_m1 TRUE FALSE -#> sigma FALSE FALSE
    signif(rel_diffs_transformed, 3)
    #> 2.5% 97.5% +#> sigma FALSE TRUE
    signif(rel_diffs_transformed, 3)
    #> 2.5% 97.5% #> parent_0 0.000541 0.000222 #> k_parent 0.000960 0.000900 #> k_m1 0.030700 0.029100 @@ -335,16 +325,16 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, #> f_parent_to_m1 0.471328495 5.611550e-01 #> sigma 2.535612399 3.985263e+00
    ci_quadratic_transformed_ff <- confint(f_d_2, method = "quadratic") ci_quadratic_transformed_ff
    #> 2.5% 97.5% -#> parent_0 96.403839460 1.027931e+02 +#> parent_0 96.403839476 1.027931e+02 #> k_parent 0.090823790 1.072543e-01 #> k_m1 0.004012216 6.897547e-03 #> f_parent_to_m1 0.469118713 5.595960e-01 #> sigma 2.396089689 3.854918e+00
    ci_quadratic_untransformed_ff <- confint(f_d_2, method = "quadratic", transformed = FALSE) ci_quadratic_untransformed_ff
    #> 2.5% 97.5% -#> parent_0 96.403839413 1.027931e+02 +#> parent_0 96.403839429 1.027931e+02 #> k_parent 0.090491931 1.069035e-01 #> k_m1 0.003835483 6.685819e-03 -#> f_parent_to_m1 0.469113365 5.598386e-01 +#> f_parent_to_m1 0.469113364 5.598386e-01 #> sigma 2.396089689 3.854918e+00
    rel_diffs_transformed_ff <- abs((ci_quadratic_transformed_ff - ci_profile_ff)/ci_profile_ff) rel_diffs_untransformed_ff <- abs((ci_quadratic_untransformed_ff - ci_profile_ff)/ci_profile_ff) # While the confidence interval for the parent rate constant is closer to @@ -356,17 +346,17 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, #> k_parent TRUE TRUE #> k_m1 FALSE FALSE #> f_parent_to_m1 TRUE FALSE -#> sigma FALSE FALSE
    rel_diffs_transformed_ff
    #> 2.5% 97.5% -#> parent_0 0.0005408080 0.0002217794 +#> sigma FALSE TRUE
    rel_diffs_transformed_ff
    #> 2.5% 97.5% +#> parent_0 0.0005408078 0.0002217796 #> k_parent 0.0009596417 0.0009003876 -#> k_m1 0.0307277370 0.0290579182 -#> f_parent_to_m1 0.0046884130 0.0027782556 -#> sigma 0.0550252516 0.0327066836
    rel_diffs_untransformed_ff
    #> 2.5% 97.5% -#> parent_0 0.0005408085 0.0002217799 -#> k_parent 0.0046100096 0.0023730229 -#> k_m1 0.0146746469 0.0025301011 -#> f_parent_to_m1 0.0046997599 0.0023460223 -#> sigma 0.0550252516 0.0327066836
    +#> k_m1 0.0307277372 0.0290579184 +#> f_parent_to_m1 0.0046884131 0.0027782558 +#> sigma 0.0550252516 0.0327066836
    rel_diffs_untransformed_ff
    #> 2.5% 97.5% +#> parent_0 0.0005408083 0.000221780 +#> k_parent 0.0046100096 0.002373023 +#> k_m1 0.0146746467 0.002530101 +#> f_parent_to_m1 0.0046997600 0.002346022 +#> sigma 0.0550252516 0.032706684
    # The profiling for the following fit does not finish in a reasonable time, # therefore we use the quadratic approximation m_synth_DFOP_par <- mkinmod(parent = mkinsub("DFOP", c("M1", "M2")), @@ -375,19 +365,19 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, use_of_ff = "max", quiet = TRUE) DFOP_par_c <- synthetic_data_for_UBA_2014[[12]]$data f_tc_2 <- mkinfit(m_synth_DFOP_par, DFOP_par_c, error_model = "tc", - error_model_algorithm = "direct", quiet = TRUE) -confint(f_tc_2, method = "quadratic")
    #> 2.5% 97.5% -#> parent_0 94.59613833 106.19939215 -#> k_M1 0.03760542 0.04490759 -#> k_M2 0.00856874 0.01087675 -#> f_parent_to_M1 0.02146166 0.62023888 -#> f_parent_to_M2 0.01516502 0.37975343 -#> k1 0.27389751 0.33388078 -#> k2 0.01861456 0.02250379 -#> g 0.67194349 0.73583256 -#> sigma_low 0.25128383 0.83992146 -#> rsd_high 0.04041100 0.07662001
    confint(f_tc_2, "parent_0", method = "quadratic")
    #> 2.5% 97.5% -#> parent_0 94.59614 106.1994
    # } + error_model_algorithm = "direct", quiet = TRUE)
    #> Warning: Optimisation did not converge: +#> iteration limit reached without convergence (10)
    confint(f_tc_2, method = "quadratic")
    #> 2.5% 97.5% +#> parent_0 95.654015524 105.79279749 +#> k_M1 0.037723773 0.04447598 +#> k_M2 0.008586438 0.01078076 +#> f_parent_to_M1 0.230403596 0.61953014 +#> f_parent_to_M2 0.162909765 0.38019017 +#> k1 0.275434628 0.33331386 +#> k2 0.018602188 0.02249211 +#> g 0.675149759 0.73520889 +#> sigma_low 0.251416929 0.84272023 +#> rsd_high 0.040371818 0.07666540
    confint(f_tc_2, "parent_0", method = "quadratic")
    #> 2.5% 97.5% +#> parent_0 95.65402 105.7928
    # }
    #> Lade nötiges Paket: rbenchmark
    #> test replications elapsed relative user.self sys.self user.child -#> 1 analytical 2 0.410 1.000 0.410 0.000 0 -#> 2 deSolve 2 0.704 1.717 0.703 0.001 0 + replications = 2)
    #> Loading required package: rbenchmark
    #> test replications elapsed relative user.self sys.self user.child +#> 1 analytical 2 0.407 1.000 0.407 0 0 +#> 2 deSolve 2 0.699 1.717 0.698 0 0 #> sys.child #> 1 0 #> 2 0
    DFOP_SFO <- mkinmod( @@ -186,8 +186,8 @@ analytical = mkinfit(DFOP_SFO, FOCUS_D, solution_type = "analytical", quiet = TRUE), deSolve = mkinfit(DFOP_SFO, FOCUS_D, solution_type = "deSolve", quiet = TRUE), replications = 2)
    #> test replications elapsed relative user.self sys.self user.child -#> 1 analytical 2 0.894 1.000 0.894 0.000 0 -#> 2 deSolve 2 1.717 1.921 1.716 0.001 0 +#> 1 analytical 2 0.887 1.000 0.886 0 0 +#> 2 deSolve 2 1.639 1.848 1.638 0 0 #> sys.child #> 1 0 #> 2 0
    # } diff --git a/docs/reference/experimental_data_for_UBA-1.png b/docs/reference/experimental_data_for_UBA-1.png index 6c225daa..b316a5db 100644 Binary files a/docs/reference/experimental_data_for_UBA-1.png and b/docs/reference/experimental_data_for_UBA-1.png differ diff --git a/docs/reference/get_deg_func.html b/docs/reference/get_deg_func.html index 6eedafd2..812b25d7 100644 --- a/docs/reference/get_deg_func.html +++ b/docs/reference/get_deg_func.html @@ -72,7 +72,7 @@ mkin - 0.9.50.3 + 0.9.50.2
    @@ -109,9 +109,6 @@
  • Example evaluation of NAFTA SOP Attachment examples
  • -
  • - Some benchmark timings -
  • diff --git a/docs/reference/index.html b/docs/reference/index.html index 10d3b53a..961352e0 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -71,7 +71,7 @@ mkin - 0.9.50.3 + 0.9.50.2 @@ -108,9 +108,6 @@
  • Example evaluation of NAFTA SOP Attachment examples
  • -
  • - Some benchmark timings -
  • @@ -330,12 +327,6 @@ of an mmkin object

    Helper functions to create nlme models from mmkin row objects

    - -

    saemix_model() saemix_data()

    - -

    Create saemix models from mmkin row objects

    - -

    get_deg_func()

    diff --git a/docs/reference/loftest-3.png b/docs/reference/loftest-3.png index 39fca72d..cb55838c 100644 Binary files a/docs/reference/loftest-3.png and b/docs/reference/loftest-3.png differ diff --git a/docs/reference/logistic.solution-3.png b/docs/reference/logistic.solution-3.png deleted file mode 100644 index fd11d0c0..00000000 Binary files a/docs/reference/logistic.solution-3.png and /dev/null differ diff --git a/docs/reference/logistic.solution-4.png b/docs/reference/logistic.solution-4.png deleted file mode 100644 index 78a31f93..00000000 Binary files a/docs/reference/logistic.solution-4.png and /dev/null differ diff --git a/docs/reference/logistic.solution.html b/docs/reference/logistic.solution.html index 4820d25f..87dc78a9 100644 --- a/docs/reference/logistic.solution.html +++ b/docs/reference/logistic.solution.html @@ -229,18 +229,18 @@ Version 1.1, 18 December 2014 m <- mkinfit("logistic", d_2_1, quiet = TRUE) plot_sep(m)
    summary(m)$bpar
    #> Estimate se_notrans t value Pr(>t) Lower -#> parent_0 1.057896e+02 1.9023449703 55.610119 3.768361e-16 1.016451e+02 -#> kmax 6.398190e-02 0.0143201031 4.467978 3.841829e-04 3.929235e-02 -#> k0 1.612775e-04 0.0005866813 0.274898 3.940351e-01 5.846688e-08 -#> r 2.263946e-01 0.1718110715 1.317695 1.061044e-01 4.335843e-02 +#> parent_0 1.057896e+02 1.9023449649 55.610120 3.768361e-16 1.016451e+02 +#> kmax 6.398190e-02 0.0143201029 4.467978 3.841828e-04 3.929235e-02 +#> k0 1.612775e-04 0.0005866813 0.274898 3.940351e-01 5.846685e-08 +#> r 2.263946e-01 0.1718110773 1.317695 1.061044e-01 4.335843e-02 #> sigma 5.332935e+00 0.9145907310 5.830952 4.036926e-05 3.340213e+00 #> Upper #> parent_0 109.9341588 #> kmax 0.1041853 -#> k0 0.4448749 -#> r 1.1821120 +#> k0 0.4448750 +#> r 1.1821121 #> sigma 7.3256566
    endpoints(m)$distimes
    #> DT50 DT90 DT50_k0 DT50_kmax -#> parent 36.86533 62.41511 4297.853 10.83349
    +#> parent 36.86533 62.41511 4297.854 10.83349
    #> Successfully compiled differential equation model from auto-generated C code.
    # \dontrun{ fit.1 <- mkinfit(SFO_SFO_SFO, subset(mccall81_245T, soil == "Commerce"), quiet = TRUE)
    #> Warning: Observations with value of zero were removed from the data
    summary(fit.1)$bpar
    #> Estimate se_notrans t value Pr(>t) -#> T245_0 1.038550e+02 2.184707514 47.537272 4.472189e-18 +#> T245_0 1.038550e+02 2.184707509 47.537272 4.472189e-18 #> k_T245 4.337042e-02 0.001898397 22.845818 2.276912e-13 -#> k_phenol 4.050581e-01 0.298699428 1.356073 9.756994e-02 +#> k_phenol 4.050581e-01 0.298699410 1.356073 9.756993e-02 #> k_anisole 6.678742e-03 0.000802144 8.326114 2.623179e-07 -#> f_T245_to_phenol 6.227599e-01 0.398534167 1.562626 6.949418e-02 -#> f_phenol_to_anisole 1.000000e+00 0.671844168 1.488440 7.867794e-02 -#> sigma 2.514628e+00 0.490755943 5.123989 6.233164e-05 +#> f_T245_to_phenol 6.227599e-01 0.398534147 1.562626 6.949418e-02 +#> f_phenol_to_anisole 1.000000e+00 0.671844135 1.488440 7.867793e-02 +#> sigma 2.514628e+00 0.490755933 5.123989 6.233163e-05 #> Lower Upper -#> T245_0 99.246061371 1.084640e+02 +#> T245_0 99.246061427 1.084640e+02 #> k_T245 0.039631621 4.746194e-02 #> k_phenol 0.218013878 7.525762e-01 #> k_anisole 0.005370739 8.305299e-03 @@ -191,7 +191,7 @@ #> f_phenol_to_anisole 0.000000000 1.000000e+00 #> sigma 1.706607296 3.322649e+00
    endpoints(fit.1)
    #> $ff #> T245_phenol T245_sink phenol_anisole phenol_sink -#> 6.227599e-01 3.772401e-01 1.000000e+00 1.748047e-10 +#> 6.227599e-01 3.772401e-01 1.000000e+00 1.005127e-10 #> #> $distimes #> DT50 DT90 @@ -201,16 +201,16 @@ #>
    # 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)
    #> Warning: Observations with value of zero were removed from the data
    #> Warning: Initial parameter(s) k_phenol_sink not used in the model
    #> Error in data.frame(value = c(state.ini.fixed, parms.fixed)): Zeilennamen enthalten fehlende Werte
    summary(fit.2)$bpar
    #> Error in summary(fit.2): Objekt 'fit.2' nicht gefunden
    endpoints(fit.1)
    #> $ff + fixed_parms = "k_phenol_sink", quiet = TRUE)
    #> Warning: Observations with value of zero were removed from the data
    #> Warning: Initial parameter(s) k_phenol_sink not used in the model
    #> Error in data.frame(value = c(state.ini.fixed, parms.fixed)): row names contain missing values
    summary(fit.2)$bpar
    #> Error in summary(fit.2): object 'fit.2' not found
    endpoints(fit.1)
    #> $ff #> T245_phenol T245_sink phenol_anisole phenol_sink -#> 6.227599e-01 3.772401e-01 1.000000e+00 1.748047e-10 +#> 6.227599e-01 3.772401e-01 1.000000e+00 1.005127e-10 #> #> $distimes #> DT50 DT90 #> T245 15.982025 53.09114 #> phenol 1.711229 5.68458 #> anisole 103.784092 344.76329 -#>
    plot_sep(fit.2)
    #> Error in identical(fit$err_mod, "const"): Objekt 'fit.2' nicht gefunden
    # } +#>
    plot_sep(fit.2)
    #> Error in identical(fit$err_mod, "const"): object 'fit.2' not found
    # }
    @@ -117,9 +115,6 @@ likelihood function." />
  • Example evaluation of NAFTA SOP Attachment examples
  • -
  • - Some benchmark timings -
  • @@ -153,11 +148,9 @@ likelihood function." />

    This function maximises the likelihood of the observed data using the Port -algorithm stats::nlminb(), and the specified initial or fixed +algorithm nlminb, and the specified initial or fixed parameters and starting values. In each step of the optimisation, the -kinetic model is solved using the function mkinpredict(), except -if an analytical solution is implemented, in which case the model is solved -using the degradation function in the mkinmod object. The +kinetic model is solved using the function mkinpredict. The parameters of the selected error model are fitted simultaneously with the degradation model parameters, as both of them are arguments of the likelihood function.

    @@ -195,7 +188,7 @@ likelihood function.

    mkinmod -

    A list of class mkinmod, containing the kinetic +

    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", "IORE"). If a shorthand name is given, a parent only degradation model is generated for the variable with the @@ -231,7 +224,7 @@ given below.

    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 +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 @@ -270,28 +263,30 @@ observed mean value is the new time zero.

    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 relatively simple degradation models. The default is -"auto", which uses "analytical" if possible, otherwise "deSolve" if a -compiler is present, and "eigen" if no compiler is present and the model -can be expressed using eigenvalues and eigenvectors.

    +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 "deSolve" if a compiler is present, +and "eigen" if no compiler is present and the model can be expressed using +eigenvalues and eigenvectors. This argument is passed on to the helper +function mkinpredict.

    method.ode -

    The solution method passed via mkinpredict() -to deSolve::ode() in case the solution type is "deSolve". The default +

    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 -version is present.

    +mkinmod model is used in the calls to +mkinpredict even if a compiled version is present.

    control -

    A list of control arguments passed to stats::nlminb().

    +

    A list of control arguments passed to nlminb.

    transform_rates @@ -311,7 +306,7 @@ 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.

    +transformations is the ilr transformation.

    quiet @@ -320,14 +315,13 @@ log-likelihood after each improvement?

    atol -

    Absolute error tolerance, passed to deSolve::ode(). Default -is 1e-8, which is lower than the default in the deSolve::lsoda() -function which is used per default.

    +

    Absolute error tolerance, passed to ode. Default +is 1e-8, lower than in lsoda.

    rtol -

    Absolute error tolerance, passed to deSolve::ode(). Default -is 1e-10, much lower than in deSolve::lsoda().

    +

    Absolute error tolerance, passed to ode. Default +is 1e-10, much lower than in lsoda.

    error_model @@ -348,9 +342,11 @@ normal distribution as assumed by this method.

    the error model. If the error model is "const", unweighted nonlinear least squares fitting ("OLS") is selected. If the error model is "obs", or "tc", the "d_3" algorithm is selected.

    -

    The algorithm "d_3" will directly minimize the negative log-likelihood -and independently also use the three step algorithm described below. -The fit with the higher likelihood is returned.

    +

    The algorithm "d_3" will directly minimize the negative log-likelihood and

      +
    • independently - also use the three step algorithm described below. The +fit with the higher likelihood is returned.

    • +
    +

    The algorithm "direct" will directly minimize the negative log-likelihood.

    The algorithm "twostep" will minimize the negative log-likelihood after an initial unweighted least squares optimisation step.

    @@ -385,13 +381,14 @@ the error model parameters in IRLS fits.

    ...

    Further arguments that will be passed on to -deSolve::ode().

    +deSolve.

    Value

    -

    A list with "mkinfit" in the class attribute.

    +

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

    Details

    Per default, parameters in the kinetic models are internally transformed in @@ -412,7 +409,8 @@ Degradation Data. Environments 6(12) 124 doi:10.3390/environments6120124.

    See also

    -

    summary.mkinfit, plot.mkinfit, parms and lrtest.

    +

    Plotting methods plot.mkinfit and +mkinparplot.

    Comparisons of models fitted to the same data can be made using AIC by virtue of the method logLik.mkinfit.

    Fitting of several models to several datasets in a single call to @@ -422,17 +420,17 @@ Degradation Data. Environments 6(12) 124

    # Use shorthand notation for parent only degradation fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE) -summary(fit)
    #> mkin version used for fitting: 0.9.50.3 +summary(fit)
    #> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Mon May 25 12:29:22 2020 -#> Date of summary: Mon May 25 12:29:22 2020 +#> Date of fit: Wed May 27 07:03:45 2020 +#> Date of summary: Wed May 27 07:03:45 2020 #> #> Equations: #> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent #> #> Model predictions using solution type analytical #> -#> Fitted using 222 model solutions performed in 0.048 s +#> Fitted using 222 model solutions performed in 0.043 s #> #> Error model: Constant variance #> @@ -467,10 +465,10 @@ Degradation Data. Environments 6(12) 124 #> #> Parameter correlation: #> parent_0 log_alpha log_beta sigma -#> parent_0 1.000e+00 -1.565e-01 -3.142e-01 4.758e-08 -#> log_alpha -1.565e-01 1.000e+00 9.564e-01 1.007e-07 -#> log_beta -3.142e-01 9.564e-01 1.000e+00 8.568e-08 -#> sigma 4.758e-08 1.007e-07 8.568e-08 1.000e+00 +#> parent_0 1.000e+00 -1.565e-01 -3.142e-01 4.770e-08 +#> log_alpha -1.565e-01 1.000e+00 9.564e-01 9.974e-08 +#> log_beta -3.142e-01 9.564e-01 1.000e+00 8.468e-08 +#> sigma 4.770e-08 9.974e-08 8.468e-08 1.000e+00 #> #> Backtransformed parameters: #> Confidence intervals for internally transformed parameters are asymmetric. @@ -509,15 +507,15 @@ Degradation Data. Environments 6(12) 124 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)))
    #> Warning: Observations with value of zero were removed from the data
    #> user system elapsed -#> 0.407 0.013 0.423
    parms(fit)
    #> parent_0 k_parent k_m1 f_parent_to_m1 sigma -#> 99.598483222 0.098697734 0.005260651 0.514475962 3.125503875
    #> $ff +#> 0.400 0.004 0.404
    parms(fit)
    #> parent_0 k_parent k_m1 f_parent_to_m1 sigma +#> 99.598481046 0.098697740 0.005260651 0.514475962 3.125503875
    #> $ff #> parent_m1 parent_sink #> 0.514476 0.485524 #> #> $distimes #> DT50 DT90 -#> parent 7.022929 23.32967 -#> m1 131.760715 437.69962 +#> parent 7.022929 23.32966 +#> m1 131.760724 437.69965 #>
    # \dontrun{ # deSolve is slower when no C compiler (gcc) was available during model generation print(system.time(fit.deSolve <- mkinfit(SFO_SFO, FOCUS_2006_D, @@ -534,19 +532,19 @@ Degradation Data. Environments 6(12) 124 #> Sum of squared residuals at call 29: 1017.417 #> Sum of squared residuals at call 31: 1017.417 #> Sum of squared residuals at call 33: 1017.416 -#> Sum of squared residuals at call 34: 644.0471 -#> Sum of squared residuals at call 36: 644.0469 -#> Sum of squared residuals at call 38: 644.0469 +#> Sum of squared residuals at call 34: 644.0472 +#> Sum of squared residuals at call 36: 644.047 +#> Sum of squared residuals at call 38: 644.047 #> Sum of squared residuals at call 39: 590.5025 #> Sum of squared residuals at call 41: 590.5022 #> Sum of squared residuals at call 43: 590.5016 -#> Sum of squared residuals at call 44: 543.219 -#> Sum of squared residuals at call 45: 543.2187 -#> Sum of squared residuals at call 46: 543.2186 +#> Sum of squared residuals at call 44: 543.2196 +#> Sum of squared residuals at call 45: 543.2193 +#> Sum of squared residuals at call 46: 543.2192 #> Sum of squared residuals at call 50: 391.348 #> Sum of squared residuals at call 51: 391.3479 -#> Sum of squared residuals at call 56: 386.4789 -#> Sum of squared residuals at call 58: 386.4789 +#> Sum of squared residuals at call 56: 386.479 +#> Sum of squared residuals at call 58: 386.479 #> Sum of squared residuals at call 60: 386.4779 #> Sum of squared residuals at call 61: 384.0686 #> Sum of squared residuals at call 63: 384.0686 @@ -565,49 +563,49 @@ Degradation Data. Environments 6(12) 124 #> Sum of squared residuals at call 91: 374.5774 #> Sum of squared residuals at call 93: 374.5774 #> Sum of squared residuals at call 95: 374.5774 -#> Sum of squared residuals at call 96: 373.5433 -#> Sum of squared residuals at call 100: 373.5433 -#> Sum of squared residuals at call 102: 373.2654 -#> Sum of squared residuals at call 104: 373.2654 -#> Sum of squared residuals at call 107: 372.6841 -#> Sum of squared residuals at call 111: 372.684 -#> Sum of squared residuals at call 114: 372.6374 -#> Sum of squared residuals at call 116: 372.6374 -#> Sum of squared residuals at call 119: 372.6223 -#> Sum of squared residuals at call 121: 372.6223 -#> Sum of squared residuals at call 123: 372.6223 -#> Sum of squared residuals at call 124: 372.5903 -#> Sum of squared residuals at call 126: 372.5903 -#> Sum of squared residuals at call 129: 372.5445 -#> Sum of squared residuals at call 130: 372.4921 -#> Sum of squared residuals at call 131: 372.2377 -#> Sum of squared residuals at call 132: 371.5434 -#> Sum of squared residuals at call 134: 371.5434 -#> Sum of squared residuals at call 137: 371.2857 -#> Sum of squared residuals at call 139: 371.2857 -#> Sum of squared residuals at call 143: 371.2247 -#> Sum of squared residuals at call 144: 371.2247 -#> Sum of squared residuals at call 149: 371.2189 -#> Sum of squared residuals at call 150: 371.2145 -#> Sum of squared residuals at call 153: 371.2145 -#> Sum of squared residuals at call 155: 371.2138 -#> Sum of squared residuals at call 156: 371.2138 -#> Sum of squared residuals at call 157: 371.2138 -#> Sum of squared residuals at call 161: 371.2134 -#> Sum of squared residuals at call 162: 371.2134 +#> Sum of squared residuals at call 96: 373.5438 +#> Sum of squared residuals at call 100: 373.5438 +#> Sum of squared residuals at call 102: 373.265 +#> Sum of squared residuals at call 104: 373.265 +#> Sum of squared residuals at call 107: 372.6825 +#> Sum of squared residuals at call 111: 372.6825 +#> Sum of squared residuals at call 114: 372.6356 +#> Sum of squared residuals at call 116: 372.6356 +#> Sum of squared residuals at call 119: 372.6199 +#> Sum of squared residuals at call 121: 372.6199 +#> Sum of squared residuals at call 123: 372.6199 +#> Sum of squared residuals at call 124: 372.5881 +#> Sum of squared residuals at call 126: 372.5881 +#> Sum of squared residuals at call 129: 372.5418 +#> Sum of squared residuals at call 130: 372.4866 +#> Sum of squared residuals at call 131: 372.2242 +#> Sum of squared residuals at call 132: 371.5237 +#> Sum of squared residuals at call 134: 371.5237 +#> Sum of squared residuals at call 137: 371.292 +#> Sum of squared residuals at call 139: 371.292 +#> Sum of squared residuals at call 143: 371.2256 +#> Sum of squared residuals at call 144: 371.2256 +#> Sum of squared residuals at call 146: 371.2256 +#> Sum of squared residuals at call 149: 371.2194 +#> Sum of squared residuals at call 150: 371.2147 +#> Sum of squared residuals at call 153: 371.2147 +#> Sum of squared residuals at call 155: 371.2137 +#> Sum of squared residuals at call 156: 371.2137 +#> Sum of squared residuals at call 157: 371.2137 +#> Sum of squared residuals at call 160: 371.2134 +#> Sum of squared residuals at call 164: 371.2134 #> Sum of squared residuals at call 165: 371.2134 -#> Sum of squared residuals at call 166: 371.2134 -#> Sum of squared residuals at call 168: 371.2134 -#> Negative log-likelihood at call 178: 97.22429
    #> Optimisation successfully terminated.
    #> user system elapsed -#> 0.351 0.000 0.352
    parms(fit.deSolve)
    #> parent_0 k_parent k_m1 f_parent_to_m1 sigma -#> 99.598480759 0.098697739 0.005260651 0.514475958 3.125503874
    endpoints(fit.deSolve)
    #> $ff +#> Sum of squared residuals at call 167: 371.2134 +#> Negative log-likelihood at call 177: 97.22429
    #> Optimisation successfully terminated.
    #> user system elapsed +#> 0.360 0.000 0.361
    parms(fit.deSolve)
    #> parent_0 k_parent k_m1 f_parent_to_m1 sigma +#> 99.598480300 0.098697739 0.005260651 0.514475968 3.125503874
    endpoints(fit.deSolve)
    #> $ff #> parent_m1 parent_sink #> 0.514476 0.485524 #> #> $distimes #> DT50 DT90 #> parent 7.022929 23.32966 -#> m1 131.760731 437.69967 +#> m1 131.760721 437.69964 #>
    # } # Use stepwise fitting, using optimised parameters from parent only fit, FOMC @@ -631,10 +629,10 @@ Degradation Data. Environments 6(12) 124 # \dontrun{ # Weighted fits, including IRLS (error_model = "obs") SFO_SFO.ff <- mkinmod(parent = mkinsub("SFO", "m1"), - m1 = mkinsub("SFO"), use_of_ff = "max")
    #> Successfully compiled differential equation model from auto-generated C code.
    f.noweight <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE)
    #> Warning: Observations with value of zero were removed from the data
    summary(f.noweight)
    #> mkin version used for fitting: 0.9.50.3 + m1 = mkinsub("SFO"), use_of_ff = "max")
    #> Successfully compiled differential equation model from auto-generated C code.
    f.noweight <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE)
    #> Warning: Observations with value of zero were removed from the data
    summary(f.noweight)
    #> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Mon May 25 12:29:28 2020 -#> Date of summary: Mon May 25 12:29:28 2020 +#> Date of fit: Wed May 27 07:03:50 2020 +#> Date of summary: Wed May 27 07:03:50 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -642,7 +640,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type analytical #> -#> Fitted using 421 model solutions performed in 0.147 s +#> Fitted using 421 model solutions performed in 0.129 s #> #> Error model: Constant variance #> @@ -681,11 +679,11 @@ Degradation Data. Environments 6(12) 124 #> #> Parameter correlation: #> parent_0 log_k_parent log_k_m1 f_parent_ilr_1 sigma -#> parent_0 1.000e+00 5.174e-01 -1.688e-01 -5.471e-01 -3.214e-07 +#> parent_0 1.000e+00 5.174e-01 -1.688e-01 -5.471e-01 -3.190e-07 #> log_k_parent 5.174e-01 1.000e+00 -3.263e-01 -5.426e-01 3.168e-07 -#> log_k_m1 -1.688e-01 -3.263e-01 1.000e+00 7.478e-01 -1.410e-07 -#> f_parent_ilr_1 -5.471e-01 -5.426e-01 7.478e-01 1.000e+00 5.093e-10 -#> sigma -3.214e-07 3.168e-07 -1.410e-07 5.093e-10 1.000e+00 +#> log_k_m1 -1.688e-01 -3.263e-01 1.000e+00 7.478e-01 -1.406e-07 +#> f_parent_ilr_1 -5.471e-01 -5.426e-01 7.478e-01 1.000e+00 -1.587e-10 +#> sigma -3.190e-07 3.168e-07 -1.406e-07 -1.587e-10 1.000e+00 #> #> Backtransformed parameters: #> Confidence intervals for internally transformed parameters are asymmetric. @@ -753,10 +751,10 @@ Degradation Data. Environments 6(12) 124 #> 100 m1 31.04 31.98163 -9.416e-01 #> 100 m1 33.13 31.98163 1.148e+00 #> 120 m1 25.15 28.78984 -3.640e+00 -#> 120 m1 33.31 28.78984 4.520e+00
    f.obs <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "obs", quiet = TRUE)
    #> Warning: Observations with value of zero were removed from the data
    summary(f.obs)
    #> mkin version used for fitting: 0.9.50.3 +#> 120 m1 33.31 28.78984 4.520e+00
    f.obs <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "obs", quiet = TRUE)
    #> Warning: Observations with value of zero were removed from the data
    summary(f.obs)
    #> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Mon May 25 12:29:28 2020 -#> Date of summary: Mon May 25 12:29:28 2020 +#> Date of fit: Wed May 27 07:03:50 2020 +#> Date of summary: Wed May 27 07:03:50 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -764,7 +762,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type analytical #> -#> Fitted using 978 model solutions performed in 0.337 s +#> Fitted using 978 model solutions performed in 0.407 s #> #> Error model: Variance unique to each observed variable #> @@ -890,10 +888,10 @@ Degradation Data. Environments 6(12) 124 #> 100 m1 31.04 31.98773 -9.477e-01 #> 100 m1 33.13 31.98773 1.142e+00 #> 120 m1 25.15 28.80429 -3.654e+00 -#> 120 m1 33.31 28.80429 4.506e+00
    f.tc <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "tc", quiet = TRUE)
    #> Warning: Observations with value of zero were removed from the data
    summary(f.tc)
    #> mkin version used for fitting: 0.9.50.3 +#> 120 m1 33.31 28.80429 4.506e+00
    f.tc <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, error_model = "tc", quiet = TRUE)
    #> Warning: Observations with value of zero were removed from the data
    summary(f.tc)
    #> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Mon May 25 12:29:29 2020 -#> Date of summary: Mon May 25 12:29:29 2020 +#> Date of fit: Wed May 27 07:03:51 2020 +#> Date of summary: Wed May 27 07:03:51 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -901,7 +899,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type analytical #> -#> Fitted using 1875 model solutions performed in 0.644 s +#> Fitted using 2088 model solutions performed in 0.722 s #> #> Error model: Two-component variance function #> diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html index 79b21d33..40cc2ef4 100644 --- a/docs/reference/mkinmod.html +++ b/docs/reference/mkinmod.html @@ -255,7 +255,7 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media

    SFO_SFO <- mkinmod( parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), verbose = TRUE)
    #> Compilation argument: -#> /usr/lib/R/bin/R CMD SHLIB file61b4ce789c7.c 2> file61b4ce789c7.c.err.txt +#> /usr/lib/R/bin/R CMD SHLIB file5d7f45129ff2.c 2> file5d7f45129ff2.c.err.txt #> Program source: #> 1: #include <R.h> #> 2: diff --git a/docs/reference/mkinparplot-1.png b/docs/reference/mkinparplot-1.png index 6853a4ba..31800c09 100644 Binary files a/docs/reference/mkinparplot-1.png and b/docs/reference/mkinparplot-1.png differ diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html index 89f48a09..e16de283 100644 --- a/docs/reference/mkinpredict.html +++ b/docs/reference/mkinpredict.html @@ -397,10 +397,10 @@ solver is used.

    c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "analytical", use_compiled = FALSE)[201,]) }
    #> test relative elapsed -#> 2 deSolve_compiled 1.0 0.005 -#> 4 analytical 1.0 0.005 -#> 1 eigen 4.0 0.020 -#> 3 deSolve 43.6 0.218
    +#> 2 deSolve_compiled 1.00 0.004 +#> 4 analytical 1.00 0.004 +#> 1 eigen 4.75 0.019 +#> 3 deSolve 54.75 0.219
    # \dontrun{ # Predict from a fitted model f <- mkinfit(SFO_SFO, FOCUS_2006_C, quiet = TRUE) diff --git a/docs/reference/mmkin-3.png b/docs/reference/mmkin-3.png index bce34531..e80448ab 100644 Binary files a/docs/reference/mmkin-3.png and b/docs/reference/mmkin-3.png differ diff --git a/docs/reference/mmkin-5.png b/docs/reference/mmkin-5.png index 56750342..4c771bc9 100644 Binary files a/docs/reference/mmkin-5.png and b/docs/reference/mmkin-5.png differ diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html index 9628c017..67837ea3 100644 --- a/docs/reference/mmkin.html +++ b/docs/reference/mmkin.html @@ -75,7 +75,7 @@ datasets specified in its first two arguments." /> mkin - 0.9.50.3 + 0.9.50.2
    @@ -112,9 +112,6 @@ datasets specified in its first two arguments." />
  • Example evaluation of NAFTA SOP Attachment examples
  • -
  • - Some benchmark timings -
  • @@ -155,7 +152,7 @@ datasets specified in its first two arguments.

    mmkin(
       models = c("SFO", "FOMC", "DFOP"),
       datasets,
    -  cores = detectCores(),
    +  cores = round(detectCores()/2),
       cluster = NULL,
       ...
     )
    @@ -179,8 +176,7 @@ data for mkinfit.

    The number of cores to be used for multicore processing. This is only used when the cluster argument is NULL. On Windows machines, cores > 1 is not supported, you need to use the cluster -argument to use multiple logical processors. Per default, all cores -detected by parallel::detectCores() are used.

    +argument to use multiple logical processors.

    cluster @@ -220,17 +216,17 @@ plotting.

    time_1 <- system.time(fits.4 <- mmkin(models, datasets, cores = 1, quiet = TRUE))
    #> Warning: Optimisation did not converge: #> false convergence (8)
    time_default
    #> user system elapsed -#> 4.457 0.561 1.328
    time_1
    #> user system elapsed -#> 5.031 0.004 5.038
    +#> 4.471 0.405 1.961
    time_1
    #> user system elapsed +#> 5.883 0.000 5.887
    endpoints(fits.0[["SFO_lin", 2]])
    #> $ff #> parent_M1 parent_sink M1_M2 M1_sink -#> 0.7340478 0.2659522 0.7505691 0.2494309 +#> 0.7340479 0.2659521 0.7505687 0.2494313 #> #> $distimes #> DT50 DT90 #> parent 0.8777688 2.915885 -#> M1 2.3257466 7.725963 -#> M2 33.7200800 112.015681 +#> M1 2.3257457 7.725960 +#> M2 33.7200848 112.015697 #>
    # 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 diff --git a/docs/reference/nlme-1.png b/docs/reference/nlme-1.png index 68ccb43f..bc04dea8 100644 Binary files a/docs/reference/nlme-1.png and b/docs/reference/nlme-1.png differ diff --git a/docs/reference/nlme.html b/docs/reference/nlme.html index 3462e52e..85929929 100644 --- a/docs/reference/nlme.html +++ b/docs/reference/nlme.html @@ -43,7 +43,7 @@ +datasets." /> @@ -75,7 +75,7 @@ datasets. They are used internally by the nlme.mmkin() method." /> mkin - 0.9.50.3 + 0.9.50.2
    @@ -112,9 +112,6 @@ datasets. They are used internally by the nlme.mmkin() method." />
  • Example evaluation of NAFTA SOP Attachment examples
  • -
  • - Some benchmark timings -
  • @@ -150,7 +147,7 @@ datasets. They are used internally by the nlme.mmkin() method." />

    These functions facilitate setting up a nonlinear mixed effects model for an mmkin row object. An mmkin row object is essentially a list of mkinfit objects that have been obtained by fitting the same model to a list of -datasets. They are used internally by the nlme.mmkin() method.

    +datasets.

    nlme_function(object)
    @@ -178,7 +175,7 @@ datasets. They are used internally by the nlme.m
     

    If random is FALSE (default), a named vector containing mean values of the fitted degradation model parameters. If random is TRUE, a list with fixed and random effects, in the format required by the start argument of -nlme for the case of a single grouping variable ds.

    +nlme for the case of a single grouping variable ds?

    A groupedData object

    See also

    @@ -225,28 +222,28 @@ nlme for the case of a single grouping variable ds.

    #> Model: value ~ nlme_f(name, time, parent_0, log_k_parent_sink) #> Data: grouped_data #> AIC BIC logLik -#> 298.2781 307.7372 -144.1391 +#> 252.7798 262.1358 -121.3899 #> #> Random effects: #> Formula: list(parent_0 ~ 1, log_k_parent_sink ~ 1) #> Level: ds #> Structure: Diagonal -#> parent_0 log_k_parent_sink Residual -#> StdDev: 0.9374733 0.7098105 3.83543 +#> parent_0 log_k_parent_sink Residual +#> StdDev: 0.004139378 0.6800778 2.489396 #> #> Fixed effects: parent_0 + log_k_parent_sink ~ 1 -#> Value Std.Error DF t-value p-value -#> parent_0 101.76838 1.1445444 45 88.91606 0 -#> log_k_parent_sink -3.05444 0.4195622 45 -7.28008 0 +#> Value Std.Error DF t-value p-value +#> parent_0 101.74884 0.6456057 44 157.60213 0 +#> log_k_parent_sink -3.05575 0.4015812 44 -7.60929 0 #> Correlation: #> prnt_0 -#> log_k_parent_sink 0.034 +#> log_k_parent_sink 0.026 #> #> Standardized Within-Group Residuals: -#> Min Q1 Med Q3 Max -#> -2.6169360 -0.2185329 0.0574070 0.5720937 3.0459868 +#> Min Q1 Med Q3 Max +#> -2.13168782 -0.68780415 0.08282907 0.85913228 2.95298904 #> -#> Number of Observations: 49 +#> Number of Observations: 48 #> Number of Groups: 3
    plot(augPred(m_nlme, level = 0:1), layout = c(3, 1))
    # augPred does not seem to work on fits with more than one state # variable diff --git a/docs/reference/nlme.mmkin.html b/docs/reference/nlme.mmkin.html index 2ada9501..c0fb499d 100644 --- a/docs/reference/nlme.mmkin.html +++ b/docs/reference/nlme.mmkin.html @@ -74,7 +74,7 @@ have been obtained by fitting the same model to a list of datasets." /> mkin - 0.9.50.3 + 0.9.50.2
    @@ -111,9 +111,6 @@ have been obtained by fitting the same model to a list of datasets." />
  • Example evaluation of NAFTA SOP Attachment examples
  • -
  • - Some benchmark timings -
  • @@ -184,7 +181,7 @@ have been obtained by fitting the same model to a list of datasets.

    data -

    Ignored, data are taken from the mmkin model

    +

    Should the data be printed?

    fixed @@ -274,19 +271,19 @@ with additional elements

    #> Log-likelihood: -307.5269 #> Fixed: list(parent_0 ~ 1, log_k_parent_sink ~ 1) #> parent_0 log_k_parent_sink -#> 85.541149 -3.229596 +#> 85.540979 -3.229602 #> #> Random effects: #> Formula: list(parent_0 ~ 1, log_k_parent_sink ~ 1) #> Level: ds #> Structure: Diagonal #> parent_0 log_k_parent_sink Residual -#> StdDev: 1.30857 1.288591 6.304906 +#> StdDev: 1.308245 1.288586 6.304923 #> #> Number of Observations: 90 #> Number of Groups: 5
    endpoints(f_nlme)
    #> $distimes #> DT50 DT90 -#> parent 17.51545 58.18505 +#> parent 17.51556 58.18543 #>
    # \dontrun{ f_nlme_2 <- nlme(f, start = c(parent_0 = 100, log_k_parent_sink = 0.1)) update(f_nlme_2, random = parent_0 ~ 1)
    #> Nonlinear mixed-effects model fit by maximum likelihood @@ -300,7 +297,7 @@ with additional elements

    #> Random effects: #> Formula: parent_0 ~ 1 | ds #> parent_0 Residual -#> StdDev: 0.002416792 21.63027 +#> StdDev: 0.002416802 21.63027 #> #> Number of Observations: 90 #> Number of Groups: 5
    # Test on some real data @@ -332,88 +329,88 @@ with additional elements

    f_nlme_fomc_sfo <- nlme(f_2["FOMC-SFO", ], control = list(pnlsMaxIter = 100, tolerance = 1e-4), verbose = TRUE)
    #> #> **Iteration 1 -#> LME step: Loglik: -394.1603, nlminb iterations: 3 +#> LME step: Loglik: -394.1603, nlminb iterations: 2 #> reStruct parameters: #> ds1 ds2 ds3 ds4 ds5 -#> -0.2079793 0.8563830 1.7454105 1.0917354 1.2756825 +#> -0.2079863 0.8563823 1.7454253 1.0917707 1.2756955 #> Beginning PNLS step: .. completed fit_nlme() step. -#> PNLS step: RSS = 643.8803 -#> fixed effects: 94.17379 -5.473193 -0.6970236 -0.2025091 2.103883 +#> PNLS step: RSS = 643.8814 +#> fixed effects: 94.17379 -5.473189 -0.6970234 -0.202509 2.103883 #> iterations: 100 #> Convergence crit. (must all become <= tolerance = 0.0001): #> fixed reStruct -#> 0.7960134 0.1447728 +#> 0.7959873 0.1447512 #> #> **Iteration 2 #> LME step: Loglik: -396.3824, nlminb iterations: 7 #> reStruct parameters: #> ds1 ds2 ds3 ds4 ds5 -#> -1.712404e-01 -2.432655e-05 1.842120e+00 1.073975e+00 1.322925e+00 +#> -1.712406e-01 -2.278541e-05 1.842120e+00 1.073975e+00 1.322924e+00 #> Beginning PNLS step: .. completed fit_nlme() step. -#> PNLS step: RSS = 643.8035 -#> fixed effects: 94.17385 -5.473487 -0.6970404 -0.2025137 2.103871 +#> PNLS step: RSS = 643.8025 +#> fixed effects: 94.17385 -5.473491 -0.6970406 -0.2025139 2.103871 #> iterations: 100 #> Convergence crit. (must all become <= tolerance = 0.0001): -#> fixed reStruct -#> 5.382757e-05 1.236667e-03 +#> fixed reStruct +#> 5.51758e-05 1.26861e-03 #> #> **Iteration 3 #> LME step: Loglik: -396.3825, nlminb iterations: 7 #> reStruct parameters: #> ds1 ds2 ds3 ds4 ds5 -#> -0.1712499044 -0.0001499831 1.8420971364 1.0739799123 1.3229167796 +#> -0.1712500923 -0.0001515734 1.8420972550 1.0739796967 1.3229177241 #> Beginning PNLS step: .. completed fit_nlme() step. -#> PNLS step: RSS = 643.7948 -#> fixed effects: 94.17386 -5.473521 -0.6970422 -0.2025144 2.10387 +#> PNLS step: RSS = 643.7941 +#> fixed effects: 94.17386 -5.473523 -0.6970424 -0.2025146 2.103869 #> iterations: 100 #> Convergence crit. (must all become <= tolerance = 0.0001): #> fixed reStruct -#> 6.072817e-06 1.400857e-04 +#> 5.792621e-06 1.335434e-04 #> #> **Iteration 4 #> LME step: Loglik: -396.3825, nlminb iterations: 7 #> reStruct parameters: #> ds1 ds2 ds3 ds4 ds5 -#> -0.1712529502 -0.0001641277 1.8420957542 1.0739797181 1.3229173076 +#> -0.1712517206 -0.0001651603 1.8420950864 1.0739800294 1.3229173529 #> Beginning PNLS step: .. completed fit_nlme() step. -#> PNLS step: RSS = 643.7936 -#> fixed effects: 94.17386 -5.473526 -0.6970426 -0.2025146 2.103869 +#> PNLS step: RSS = 643.7949 +#> fixed effects: 94.17386 -5.473521 -0.6970423 -0.2025145 2.10387 #> iterations: 100 #> Convergence crit. (must all become <= tolerance = 0.0001): #> fixed reStruct -#> 1.027451e-06 2.275704e-05
    f_nlme_dfop_sfo <- nlme(f_2["DFOP-SFO", ], +#> 4.025781e-07 9.628656e-06
    f_nlme_dfop_sfo <- nlme(f_2["DFOP-SFO", ], control = list(pnlsMaxIter = 120, tolerance = 5e-4), verbose = TRUE)
    #> #> **Iteration 1 -#> LME step: Loglik: -404.9582, nlminb iterations: 1 +#> LME step: Loglik: -404.9583, nlminb iterations: 1 #> reStruct parameters: #> ds1 ds2 ds3 ds4 ds5 ds6 -#> -0.4114355 0.9798697 1.6990037 0.7293315 0.3354323 1.7113046 +#> -0.4114357 0.9798641 1.6990035 0.7293314 0.3354323 1.7113047 #> Beginning PNLS step: .. completed fit_nlme() step. -#> PNLS step: RSS = 630.3644 -#> fixed effects: 93.82269 -5.455991 -0.6788957 -1.862196 -4.199671 0.05532828 +#> PNLS step: RSS = 630.3642 +#> fixed effects: 93.82269 -5.455991 -0.6788957 -1.862196 -4.199671 0.0553284 #> iterations: 120 #> Convergence crit. (must all become <= tolerance = 0.0005): #> fixed reStruct -#> 0.7885368 0.5822683 +#> 0.7879730 0.5822574 #> #> **Iteration 2 #> LME step: Loglik: -407.7755, nlminb iterations: 11 #> reStruct parameters: #> ds1 ds2 ds3 ds4 ds5 ds6 -#> -0.371224133 0.003056179 1.789939402 0.724671158 0.301602977 1.754200729 +#> -0.371224105 0.003056163 1.789939431 0.724671132 0.301602942 1.754200482 #> Beginning PNLS step: .. completed fit_nlme() step. -#> PNLS step: RSS = 630.3633 -#> fixed effects: 93.82269 -5.455992 -0.6788958 -1.862196 -4.199671 0.05532831 +#> PNLS step: RSS = 630.364 +#> fixed effects: 93.82269 -5.455991 -0.6788958 -1.862196 -4.199671 0.05532834 #> iterations: 120 #> Convergence crit. (must all become <= tolerance = 0.0005): #> fixed reStruct -#> 4.789774e-07 2.200661e-05
    plot(f_2["FOMC-SFO", 3:4])
    plot(f_nlme_fomc_sfo, 3:4)
    +#> 9.814652e-07 1.059239e-05
    plot(f_2["FOMC-SFO", 3:4])
    plot(f_nlme_fomc_sfo, 3:4)
    plot(f_2["DFOP-SFO", 3:4])
    plot(f_nlme_dfop_sfo, 3:4)
    anova(f_nlme_dfop_sfo, f_nlme_fomc_sfo, f_nlme_sfo_sfo)
    #> Model df AIC BIC logLik Test L.Ratio p-value -#> f_nlme_dfop_sfo 1 13 843.8547 884.6201 -408.9273 -#> f_nlme_fomc_sfo 2 11 818.5149 853.0087 -398.2575 1 vs 2 21.33975 <.0001 -#> f_nlme_sfo_sfo 3 9 1085.1821 1113.4043 -533.5910 2 vs 3 270.66716 <.0001
    anova(f_nlme_dfop_sfo, f_nlme_sfo_sfo) # if we ignore FOMC
    #> Model df AIC BIC logLik Test L.Ratio p-value -#> f_nlme_dfop_sfo 1 13 843.8547 884.6201 -408.9273 +#> f_nlme_dfop_sfo 1 13 843.8547 884.6201 -408.9274 +#> f_nlme_fomc_sfo 2 11 818.5151 853.0089 -398.2576 1 vs 2 21.33957 <.0001 +#> f_nlme_sfo_sfo 3 9 1085.1821 1113.4043 -533.5910 2 vs 3 270.66697 <.0001
    anova(f_nlme_dfop_sfo, f_nlme_sfo_sfo) # if we ignore FOMC
    #> Model df AIC BIC logLik Test L.Ratio p-value +#> f_nlme_dfop_sfo 1 13 843.8547 884.6201 -408.9274 #> f_nlme_sfo_sfo 2 9 1085.1821 1113.4043 -533.5910 1 vs 2 249.3274 <.0001
    endpoints(f_nlme_sfo_sfo)
    #> $ff #> parent_sink parent_A1 A1_sink @@ -430,7 +427,7 @@ with additional elements

    #> $distimes #> DT50 DT90 DT50_k1 DT50_k2 #> parent 11.07091 104.6320 4.462384 46.20825 -#> A1 162.30536 539.1667 NA NA +#> A1 162.30518 539.1661 NA NA #>
    # }
    diff --git a/docs/reference/parms.html b/docs/reference/parms.html index 2fe91c26..f62b3898 100644 --- a/docs/reference/parms.html +++ b/docs/reference/parms.html @@ -74,7 +74,7 @@ considering the error structure that was assumed for the fit." /> mkin - 0.9.50.3 + 0.9.50.2 @@ -111,9 +111,6 @@ considering the error structure that was assumed for the fit." />
  • Example evaluation of NAFTA SOP Attachment examples
  • -
  • - Some benchmark timings -
  • @@ -154,9 +151,6 @@ considering the error structure that was assumed for the fit.

    parms(object, ...)
     
     # S3 method for mkinfit
    -parms(object, transformed = FALSE, ...)
    -
    -# S3 method for mmkin
     parms(object, transformed = FALSE, ...)

    Arguments

    @@ -164,8 +158,7 @@ considering the error structure that was assumed for the fit.

    object -

    A fitted model object. Methods are implemented for -mkinfit() objects and for mmkin() objects.

    +

    A fitted model object

    ... @@ -180,88 +173,24 @@ as used internally during the optimisation?

    Value

    -

    For mkinfit objects, a numeric vector of fitted model parameters. -For mmkin row objects, a matrix with the parameters with a -row for each dataset. If the mmkin object has more than one row, a list of -such matrices is returned.

    +

    A numeric vector of fitted model parameters

    Examples

    -
    # mkinfit objects -fit <- mkinfit("SFO", FOCUS_2006_C, quiet = TRUE) -parms(fit)
    #> parent_0 k_parent_sink sigma +
    fit <- mkinfit("SFO", FOCUS_2006_C)
    #> Ordinary least squares optimisation
    #> Sum of squared residuals at call 1: 2388.077 +#> Sum of squared residuals at call 3: 2388.077 +#> Sum of squared residuals at call 4: 247.1962 +#> Sum of squared residuals at call 7: 200.6791 +#> Sum of squared residuals at call 10: 197.7231 +#> Sum of squared residuals at call 11: 197.0872 +#> Sum of squared residuals at call 14: 196.535 +#> Sum of squared residuals at call 15: 196.535 +#> Sum of squared residuals at call 16: 196.535 +#> Sum of squared residuals at call 17: 196.5334 +#> Sum of squared residuals at call 20: 196.5334 +#> Sum of squared residuals at call 25: 196.5334 +#> Negative log-likelihood at call 31: 26.64668
    #> Optimisation successfully terminated.
    parms(fit)
    #> parent_0 k_parent_sink sigma #> 82.4921598 0.3060633 4.6730124
    parms(fit, transformed = TRUE)
    #> parent_0 log_k_parent_sink sigma -#> 82.492160 -1.183963 4.673012
    -# mmkin objects -ds <- lapply(experimental_data_for_UBA_2019[6:10], - function(x) subset(x$data[c("name", "time", "value")])) -names(ds) <- paste("Dataset", 6:10) -# \dontrun{ -fits <- mmkin(c("SFO", "FOMC", "DFOP"), ds, quiet = TRUE, cores = 1) -parms(fits["SFO", ])
    #> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 -#> parent_0 88.52275400 82.666781678 86.8547308 91.7779306 82.14809450 -#> k_parent_sink 0.05794659 0.009647805 0.2102974 0.1232258 0.00720421 -#> sigma 5.15274487 7.040168584 3.6769645 6.4669234 6.50457673
    parms(fits[, 2])
    #> $SFO -#> Dataset 7 -#> parent_0 82.666781678 -#> k_parent_sink 0.009647805 -#> sigma 7.040168584 -#> -#> $FOMC -#> Dataset 7 -#> parent_0 92.6837649 -#> alpha 0.4967832 -#> beta 14.1451255 -#> sigma 1.9167519 -#> -#> $DFOP -#> Dataset 7 -#> parent_0 91.058971503 -#> k1 0.044946770 -#> k2 0.002868336 -#> g 0.526942415 -#> sigma 2.221302196 -#>
    parms(fits)
    #> $SFO -#> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 -#> parent_0 88.52275400 82.666781678 86.8547308 91.7779306 82.14809450 -#> k_parent_sink 0.05794659 0.009647805 0.2102974 0.1232258 0.00720421 -#> sigma 5.15274487 7.040168584 3.6769645 6.4669234 6.50457673 -#> -#> $FOMC -#> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 -#> parent_0 95.558575 92.6837649 90.719787 98.383939 94.8481458 -#> alpha 1.338667 0.4967832 1.639099 1.074460 0.2805272 -#> beta 13.033315 14.1451255 5.007077 4.397126 6.9052224 -#> sigma 1.847671 1.9167519 1.066063 3.146056 1.6222778 -#> -#> $DFOP -#> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 -#> parent_0 96.55213663 91.058971503 90.34509469 98.14858850 94.311323409 -#> k1 0.21954589 0.044946770 0.41232289 0.31697588 0.080663853 -#> k2 0.02957934 0.002868336 0.07581767 0.03260384 0.003425417 -#> g 0.44845068 0.526942415 0.66091965 0.65322767 0.342652880 -#> sigma 1.35690468 2.221302196 1.34169076 2.87159846 1.942067831 -#>
    parms(fits, transformed = TRUE)
    #> $SFO -#> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 -#> parent_0 88.522754 82.666782 86.854731 91.777931 82.148094 -#> log_k_parent_sink -2.848234 -4.641025 -1.559232 -2.093737 -4.933090 -#> sigma 5.152745 7.040169 3.676964 6.466923 6.504577 -#> -#> $FOMC -#> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 -#> parent_0 95.5585751 92.6837649 90.7197870 98.38393897 94.848146 -#> log_alpha 0.2916741 -0.6996015 0.4941466 0.07181816 -1.271085 -#> log_beta 2.5675088 2.6493701 1.6108523 1.48095106 1.932278 -#> sigma 1.8476712 1.9167519 1.0660627 3.14605557 1.622278 -#> -#> $DFOP -#> Dataset 6 Dataset 7 Dataset 8 Dataset 9 Dataset 10 -#> parent_0 96.5521366 91.05897150 90.3450947 98.1485885 94.311323 -#> log_k1 -1.5161940 -3.10227638 -0.8859485 -1.1489296 -2.517465 -#> log_k2 -3.5206791 -5.85402317 -2.5794240 -3.4233253 -5.676532 -#> g_ilr -0.1463234 0.07627854 0.4719196 0.4477805 -0.460676 -#> sigma 1.3569047 2.22130220 1.3416908 2.8715985 1.942068 -#>
    # } -
    +#> 82.492160 -1.183963 4.673012
    endpoints(fit)
    #> $ff #> parent_A1 parent_B1 parent_C1 parent_sink A1_A2 A1_sink -#> 0.3809618 0.1954667 0.4235715 0.0000000 0.4479625 0.5520375 +#> 0.3809619 0.1954667 0.4235714 0.0000000 0.4479609 0.5520391 #> #> $distimes #> DT50 DT90 #> parent 13.95078 46.34350 -#> A1 49.75346 165.27741 -#> B1 37.26904 123.80508 -#> C1 11.23130 37.30958 -#> A2 28.50628 94.69580 +#> A1 49.75343 165.27733 +#> B1 37.26907 123.80517 +#> C1 11.23131 37.30959 +#> A2 28.50638 94.69614 #>
    # } # Compare with the results obtained in the original publication print(schaefer07_complex_results)
    #> compound parameter KinGUI ModelMaker deviation diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html index 55ce22cf..ad6217e6 100644 --- a/docs/reference/summary.mkinfit.html +++ b/docs/reference/summary.mkinfit.html @@ -231,15 +231,15 @@ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
    summary(mkinfit(mkinmod(parent = mkinsub("SFO")), FOCUS_2006_A, quiet = TRUE))
    #> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 15:31:20 2020 -#> Date of summary: Tue May 12 15:31:20 2020 +#> Date of fit: Wed May 27 07:05:18 2020 +#> Date of summary: Wed May 27 07:05:18 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent #> #> Model predictions using solution type analytical #> -#> Fitted using 131 model solutions performed in 0.027 s +#> Fitted using 131 model solutions performed in 0.026 s #> #> Error model: Constant variance #> @@ -271,9 +271,9 @@ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, #> #> Parameter correlation: #> parent_0 log_k_parent sigma -#> parent_0 1.000e+00 5.428e-01 1.642e-07 -#> log_k_parent 5.428e-01 1.000e+00 2.507e-07 -#> sigma 1.642e-07 2.507e-07 1.000e+00 +#> parent_0 1.000e+00 5.428e-01 1.648e-07 +#> log_k_parent 5.428e-01 1.000e+00 2.513e-07 +#> sigma 1.648e-07 2.513e-07 1.000e+00 #> #> Backtransformed parameters: #> Confidence intervals for internally transformed parameters are asymmetric. diff --git a/docs/reference/synthetic_data_for_UBA_2014.html b/docs/reference/synthetic_data_for_UBA_2014.html index 17d2f973..1444be76 100644 --- a/docs/reference/synthetic_data_for_UBA_2014.html +++ b/docs/reference/synthetic_data_for_UBA_2014.html @@ -290,8 +290,8 @@ Compare also the code in the example section to see the degradation models." /> quiet = TRUE) plot_sep(fit)
    summary(fit)
    #> mkin version used for fitting: 0.9.50.2 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 15:31:29 2020 -#> Date of summary: Tue May 12 15:31:29 2020 +#> Date of fit: Wed May 27 07:05:27 2020 +#> Date of summary: Wed May 27 07:05:27 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -300,7 +300,7 @@ Compare also the code in the example section to see the degradation models." /> #> #> Model predictions using solution type deSolve #> -#> Fitted using 819 model solutions performed in 0.619 s +#> Fitted using 817 model solutions performed in 0.627 s #> #> Error model: Constant variance #> @@ -352,15 +352,15 @@ Compare also the code in the example section to see the degradation models." /> #> log_k_M2 2.819e-02 7.166e-02 -3.929e-01 1.000e+00 -2.658e-01 #> f_parent_ilr_1 -4.624e-01 -5.682e-01 7.478e-01 -2.658e-01 1.000e+00 #> f_M1_ilr_1 1.614e-01 4.102e-01 -8.109e-01 5.419e-01 -8.605e-01 -#> sigma 1.285e-07 1.054e-07 -1.671e-07 3.644e-08 -2.503e-07 +#> sigma -1.384e-07 -2.581e-07 9.499e-08 1.518e-07 1.236e-07 #> f_M1_ilr_1 sigma -#> parent_0 1.614e-01 1.285e-07 -#> log_k_parent 4.102e-01 1.054e-07 -#> log_k_M1 -8.109e-01 -1.671e-07 -#> log_k_M2 5.419e-01 3.644e-08 -#> f_parent_ilr_1 -8.605e-01 -2.503e-07 -#> f_M1_ilr_1 1.000e+00 2.636e-07 -#> sigma 2.636e-07 1.000e+00 +#> parent_0 1.614e-01 -1.384e-07 +#> log_k_parent 4.102e-01 -2.581e-07 +#> log_k_M1 -8.109e-01 9.499e-08 +#> log_k_M2 5.419e-01 1.518e-07 +#> f_parent_ilr_1 -8.605e-01 1.236e-07 +#> f_M1_ilr_1 1.000e+00 8.795e-09 +#> sigma 8.795e-09 1.000e+00 #> #> Backtransformed parameters: #> Confidence intervals for internally transformed parameters are asymmetric. @@ -397,8 +397,8 @@ Compare also the code in the example section to see the degradation models." /> #> #> Data: #> time variable observed predicted residual -#> 0 parent 101.5 1.021e+02 -0.56249 -#> 0 parent 101.2 1.021e+02 -0.86249 +#> 0 parent 101.5 1.021e+02 -0.56248 +#> 0 parent 101.2 1.021e+02 -0.86248 #> 1 parent 53.9 4.873e+01 5.17118 #> 1 parent 47.5 4.873e+01 -1.22882 #> 3 parent 10.4 1.111e+01 -0.70773 @@ -407,8 +407,8 @@ Compare also the code in the example section to see the degradation models." /> #> 7 parent 0.3 5.772e-01 -0.27717 #> 14 parent 3.5 3.264e-03 3.49674 #> 28 parent 3.2 1.045e-07 3.20000 -#> 90 parent 0.6 9.531e-10 0.60000 -#> 120 parent 3.5 -5.940e-10 3.50000 +#> 90 parent 0.6 9.535e-10 0.60000 +#> 120 parent 3.5 -5.941e-10 3.50000 #> 1 M1 36.4 3.479e+01 1.61088 #> 1 M1 37.4 3.479e+01 2.61088 #> 3 M1 34.3 3.937e+01 -5.07027 @@ -418,9 +418,9 @@ Compare also the code in the example section to see the degradation models." /> #> 14 M1 5.8 1.995e+00 3.80469 #> 14 M1 1.2 1.995e+00 -0.79531 #> 60 M1 0.5 2.111e-06 0.50000 -#> 90 M1 3.2 -9.670e-10 3.20000 -#> 120 M1 1.5 7.670e-10 1.50000 -#> 120 M1 0.6 7.670e-10 0.60000 +#> 90 M1 3.2 -9.676e-10 3.20000 +#> 120 M1 1.5 7.671e-10 1.50000 +#> 120 M1 0.6 7.671e-10 0.60000 #> 1 M2 4.8 4.455e+00 0.34517 #> 3 M2 20.9 2.153e+01 -0.62527 #> 3 M2 19.3 2.153e+01 -2.22527 diff --git a/docs/reference/test_data_from_UBA_2014.html b/docs/reference/test_data_from_UBA_2014.html index 237149a5..6059a4d2 100644 --- a/docs/reference/test_data_from_UBA_2014.html +++ b/docs/reference/test_data_from_UBA_2014.html @@ -191,26 +191,26 @@ M3 = mkinsub("SFO"), use_of_ff = "max")
    #> Successfully compiled differential equation model from auto-generated C code.
    f_soil <- mkinfit(m_soil, test_data_from_UBA_2014[[3]]$data, quiet = TRUE)
    #> Warning: Observations with value of zero were removed from the data
    plot_sep(f_soil, lpos = c("topright", "topright", "topright", "bottomright"))
    summary(f_soil)$bpar
    #> Estimate se_notrans t value Pr(>t) Lower -#> parent_0 76.55425585 0.859186419 89.1008682 1.113862e-26 74.755958727 -#> k_parent 0.12081956 0.004601919 26.2541704 1.077361e-16 0.111561576 -#> k_M1 0.84258631 0.806165101 1.0451783 1.545282e-01 0.113778787 -#> k_M2 0.04210878 0.017083048 2.4649453 1.170195e-02 0.018013823 -#> k_M3 0.01122919 0.007245869 1.5497365 6.885076e-02 0.002909418 -#> f_parent_to_M1 0.32240194 0.240785506 1.3389591 9.819219e-02 NA -#> f_parent_to_M2 0.16099854 0.033691990 4.7785405 6.531222e-05 NA -#> f_M1_to_M3 0.27921506 0.269425556 1.0363347 1.565282e-01 0.022977927 -#> f_M2_to_M3 0.55641328 0.595121733 0.9349571 1.807710e-01 0.008002321 +#> parent_0 76.55425584 0.859186419 89.1008681 1.113862e-26 74.755958720 +#> k_parent 0.12081956 0.004601919 26.2541703 1.077361e-16 0.111561576 +#> k_M1 0.84258629 0.806165149 1.0451783 1.545282e-01 0.113778910 +#> k_M2 0.04210878 0.017083049 2.4649452 1.170195e-02 0.018013823 +#> k_M3 0.01122919 0.007245870 1.5497364 6.885076e-02 0.002909418 +#> f_parent_to_M1 0.32240193 0.240785518 1.3389590 9.819221e-02 NA +#> f_parent_to_M2 0.16099854 0.033691991 4.7785404 6.531224e-05 NA +#> f_M1_to_M3 0.27921506 0.269425582 1.0363346 1.565282e-01 0.022977955 +#> f_M2_to_M3 0.55641331 0.595121774 0.9349571 1.807710e-01 0.008002320 #> sigma 1.14005399 0.149696423 7.6157731 1.727024e-07 0.826735778 #> Upper -#> parent_0 78.35255298 +#> parent_0 78.35255297 #> k_parent 0.13084582 -#> k_M1 6.23975442 -#> k_M2 0.09843270 -#> k_M3 0.04334016 +#> k_M1 6.23974738 +#> k_M2 0.09843271 +#> k_M3 0.04334017 #> f_parent_to_M1 NA #> f_parent_to_M2 NA -#> f_M1_to_M3 0.86450919 -#> f_M2_to_M3 0.99489910 +#> f_M1_to_M3 0.86450905 +#> f_M2_to_M3 0.99489911 #> sigma 1.45337221
    mkinerrmin(f_soil)
    #> err.min n.optim df #> All data 0.09649963 9 20 #> parent 0.04721283 2 6 diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index 7a9198de..9b84d6bf 100644 --- a/docs/reference/transform_odeparms.html +++ b/docs/reference/transform_odeparms.html @@ -77,7 +77,7 @@ the ilr transformation is used." /> mkin - 0.9.50.3 + 0.9.50.2
    @@ -114,9 +114,6 @@ the ilr transformation is used." />
  • Example evaluation of NAFTA SOP Attachment examples
  • -
  • - Some benchmark timings -
  • @@ -214,12 +211,19 @@ fitting procedure.

    Value

    -

    A vector of transformed or backtransformed parameters

    +

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

    Details

    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.

    +

    Functions

    + + +
      +
    • backtransform_odeparms: Backtransform the set of transformed parameters

    • +

    Examples

    @@ -241,7 +245,7 @@ This is no problem for the internal use in mkinfit< #> sigma 3.12550 0.35852 8.72 2.24e-10 2.39609 3.8549
    # \dontrun{ # Compare to the version without transforming rate parameters -fit.2 <- mkinfit(SFO_SFO, FOCUS_2006_D, transform_rates = FALSE, quiet = TRUE)
    #> Warning: Observations with value of zero were removed from the data
    #> Error in if (cost < cost.current) { assign("cost.current", cost, inherits = TRUE) if (!quiet) cat(ifelse(OLS, "Sum of squared residuals", "Negative log-likelihood"), " at call ", calls, ": ", cost.current, "\n", sep = "")}: missing value where TRUE/FALSE needed
    #> Timing stopped at: 0.002 0.001 0.002
    fit.2.s <- summary(fit.2)
    #> Error in summary(fit.2): object 'fit.2' not found
    print(fit.2.s$par, 3)
    #> Error in print(fit.2.s$par, 3): object 'fit.2.s' not found
    print(fit.2.s$bpar, 3)
    #> Error in print(fit.2.s$bpar, 3): object 'fit.2.s' not found
    # } +fit.2 <- mkinfit(SFO_SFO, FOCUS_2006_D, transform_rates = FALSE, quiet = TRUE)
    #> Warning: Observations with value of zero were removed from the data
    #> Error in if (cost < cost.current) { assign("cost.current", cost, inherits = TRUE) if (!quiet) cat(ifelse(OLS, "Sum of squared residuals", "Negative log-likelihood"), " at call ", calls, ": ", cost.current, "\n", sep = "")}: missing value where TRUE/FALSE needed
    #> Timing stopped at: 0.002 0 0.002
    fit.2.s <- summary(fit.2)
    #> Error in summary(fit.2): object 'fit.2' not found
    print(fit.2.s$par, 3)
    #> Error in print(fit.2.s$par, 3): object 'fit.2.s' not found
    print(fit.2.s$bpar, 3)
    #> Error in print(fit.2.s$bpar, 3): object 'fit.2.s' not found
    # } initials <- fit$start$value names(initials) <- rownames(fit$start) diff --git a/docs/reference/update.mkinfit.html b/docs/reference/update.mkinfit.html index f958fc14..83b8c466 100644 --- a/docs/reference/update.mkinfit.html +++ b/docs/reference/update.mkinfit.html @@ -177,7 +177,7 @@ remove arguments given in the original call

    # \dontrun{ fit <- mkinfit("SFO", subset(FOCUS_2006_D, value != 0), quiet = TRUE) parms(fit)
    #> parent_0 k_parent_sink sigma -#> 99.44423885 0.09793574 3.39632469
    fit_2 <- update(fit, error_model = "tc") +#> 99.44423886 0.09793574 3.39632469
    fit_2 <- update(fit, error_model = "tc") parms(fit_2)
    #> parent_0 k_parent_sink sigma_low rsd_high #> 1.008549e+02 1.005665e-01 3.752222e-03 6.763434e-02
    plot_err(fit_2)
    # }
    -- cgit v1.2.1