From 4f62f39b8979cb3a5c52d65d425e530dc0770665 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Sun, 16 Feb 2025 17:27:18 +0100 Subject: Fix solution type "deSolve" for a special case The special case occurs if not observed data for time zero are available. Fixes #16. Write NEWS and update docs. A lot of html was regenerated, because I had checked out the main branch in between, which made pkgdown believe that I have changed the help files. --- docs/dev/reference/confint.mkinfit.html | 4 ++-- docs/dev/reference/create_deg_func.html | 8 ++++---- docs/dev/reference/dimethenamid_2018.html | 6 +++--- docs/dev/reference/mkinfit.html | 16 ++++++++-------- docs/dev/reference/mkinmod.html | 4 ++-- docs/dev/reference/mkinpredict.html | 4 ++-- docs/dev/reference/mmkin.html | 4 ++-- docs/dev/reference/saem.html | 8 ++++---- docs/dev/reference/summary.mkinfit.html | 6 +++--- docs/dev/reference/summary.mmkin.html | 2 +- docs/dev/reference/summary.nlme.mmkin.html | 6 +++--- docs/dev/reference/summary.saem.mmkin.html | 6 +++--- 12 files changed, 37 insertions(+), 37 deletions(-) (limited to 'docs/dev/reference') diff --git a/docs/dev/reference/confint.mkinfit.html b/docs/dev/reference/confint.mkinfit.html index a0051a85..aca693cc 100644 --- a/docs/dev/reference/confint.mkinfit.html +++ b/docs/dev/reference/confint.mkinfit.html @@ -217,7 +217,7 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, 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 -#> 1.182 0.004 1.186 +#> 1.247 0.000 1.246 # 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 if we use at least 4 cores @@ -225,7 +225,7 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, c("k_parent_sink", "k_parent_m1", "k_m1_sink", "sigma"), cores = n_cores)) #> Profiling the likelihood #> user system elapsed -#> 0.429 0.171 0.324 +#> 0.444 0.131 0.303 ci_profile #> 2.5% 97.5% #> parent_0 96.456003640 1.027703e+02 diff --git a/docs/dev/reference/create_deg_func.html b/docs/dev/reference/create_deg_func.html index 4c66c02b..75d21481 100644 --- a/docs/dev/reference/create_deg_func.html +++ b/docs/dev/reference/create_deg_func.html @@ -104,8 +104,8 @@ replications = 2) #> Loading required package: rbenchmark #> test replications elapsed relative user.self sys.self user.child -#> 1 analytical 2 0.249 1.000 0.249 0 0 -#> 2 deSolve 2 0.307 1.233 0.306 0 0 +#> 1 analytical 2 0.243 1.000 0.244 0 0 +#> 2 deSolve 2 0.302 1.243 0.301 0 0 #> sys.child #> 1 0 #> 2 0 @@ -118,8 +118,8 @@ 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.391 1.000 0.391 0 0 -#> 2 deSolve 2 0.543 1.389 0.542 0 0 +#> 1 analytical 2 0.393 1.000 0.392 0 0 +#> 2 deSolve 2 0.534 1.359 0.535 0 0 #> sys.child #> 1 0 #> 2 0 diff --git a/docs/dev/reference/dimethenamid_2018.html b/docs/dev/reference/dimethenamid_2018.html index 4bd35bc6..209405a9 100644 --- a/docs/dev/reference/dimethenamid_2018.html +++ b/docs/dev/reference/dimethenamid_2018.html @@ -185,8 +185,8 @@ specific pieces of information in the comments.

#> saemix version used for fitting: 3.3 #> mkin version used for pre-fitting: 1.2.10 #> R version used for fitting: 4.4.2 -#> Date of fit: Fri Feb 14 07:29:22 2025 -#> Date of summary: Fri Feb 14 07:29:22 2025 +#> Date of fit: Sun Feb 16 16:58:17 2025 +#> Date of summary: Sun Feb 16 16:58:17 2025 #> #> Equations: #> d_DMTA/dt = - k_DMTA * DMTA @@ -199,7 +199,7 @@ specific pieces of information in the comments.

#> #> Model predictions using solution type deSolve #> -#> Fitted in 295.57 s +#> Fitted in 294.206 s #> Using 300, 100 iterations and 9 chains #> #> Variance model: Two-component variance function diff --git a/docs/dev/reference/mkinfit.html b/docs/dev/reference/mkinfit.html index 1c84b9b2..aa9c3d8f 100644 --- a/docs/dev/reference/mkinfit.html +++ b/docs/dev/reference/mkinfit.html @@ -368,8 +368,8 @@ Degradation Data. Environments 6(12) 124 summary(fit) #> mkin version used for fitting: 1.2.10 #> R version used for fitting: 4.4.2 -#> Date of fit: Fri Feb 14 07:30:02 2025 -#> Date of summary: Fri Feb 14 07:30:02 2025 +#> Date of fit: Sun Feb 16 16:58:54 2025 +#> Date of summary: Sun Feb 16 16:58:54 2025 #> #> Equations: #> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent @@ -517,9 +517,9 @@ Degradation Data. Environments 6(12) 124 solution_type = "analytical")) } #> test relative elapsed -#> 3 analytical 1.000 0.242 -#> 2 eigen 1.913 0.463 -#> 1 deSolve_compiled 1.917 0.464 +#> 3 analytical 1.000 0.240 +#> 2 eigen 1.908 0.458 +#> 1 deSolve_compiled 1.933 0.464 # } # Use stepwise fitting, using optimised parameters from parent only fit, FOMC-SFO @@ -547,8 +547,8 @@ Degradation Data. Environments 6(12) 124 #> Warning: diag(V) had non-positive or NA entries; the non-finite result may be dubious #> mkin version used for fitting: 1.2.10 #> R version used for fitting: 4.4.2 -#> Date of fit: Fri Feb 14 07:30:07 2025 -#> Date of summary: Fri Feb 14 07:30:07 2025 +#> Date of fit: Sun Feb 16 16:58:58 2025 +#> Date of summary: Sun Feb 16 16:58:58 2025 #> #> Equations: #> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent @@ -557,7 +557,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type deSolve #> -#> Fitted using 4062 model solutions performed in 0.77 s +#> Fitted using 4062 model solutions performed in 0.776 s #> #> Error model: Two-component variance function #> diff --git a/docs/dev/reference/mkinmod.html b/docs/dev/reference/mkinmod.html index d26086eb..9824bf3a 100644 --- a/docs/dev/reference/mkinmod.html +++ b/docs/dev/reference/mkinmod.html @@ -290,7 +290,7 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media

m1 = mkinsub("SFO", full_name = "Metabolite M1"), name = "SFO_SFO", dll_dir = DLL_dir, unload = TRUE, overwrite = TRUE) #> Temporary DLL for differentials generated and loaded -#> Copied DLL from /tmp/RtmpSeNGYy/file226312370605e2.so to /home/jranke/.local/share/mkin/SFO_SFO.so +#> Copied DLL from /tmp/RtmpHpDSpx/file2445be5e83d15b.so to /home/jranke/.local/share/mkin/SFO_SFO.so # Now we can save the model and restore it in a new session saveRDS(SFO_SFO.2, file = "~/SFO_SFO.rds") # Terminate the R session here if you would like to check, and then do @@ -343,7 +343,7 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media

#> }) #> return(predicted) #> } -#> <environment: 0x5555577ec6d0> +#> <environment: 0x55555f1f7f68> # If we have several parallel metabolites # (compare tests/testthat/test_synthetic_data_for_UBA_2014.R) diff --git a/docs/dev/reference/mkinpredict.html b/docs/dev/reference/mkinpredict.html index e11dacdf..4b6c54e3 100644 --- a/docs/dev/reference/mkinpredict.html +++ b/docs/dev/reference/mkinpredict.html @@ -353,10 +353,10 @@ as these always return mapped output.

solution_type = "analytical", use_compiled = FALSE)[201,]) } #> test relative elapsed -#> 2 deSolve_compiled 1.0 0.002 #> 4 analytical 1.0 0.002 +#> 2 deSolve_compiled 1.5 0.003 #> 1 eigen 4.0 0.008 -#> 3 deSolve 30.5 0.061 +#> 3 deSolve 31.0 0.062 # \dontrun{ # Predict from a fitted model diff --git a/docs/dev/reference/mmkin.html b/docs/dev/reference/mmkin.html index c2bbd3c4..275ac5d9 100644 --- a/docs/dev/reference/mmkin.html +++ b/docs/dev/reference/mmkin.html @@ -158,10 +158,10 @@ plotting.

time_default #> user system elapsed -#> 1.522 0.957 0.720 +#> 1.617 0.819 0.699 time_1 #> user system elapsed -#> 1.991 0.024 2.015 +#> 1.908 0.036 1.944 endpoints(fits.0[["SFO_lin", 2]]) #> $ff diff --git a/docs/dev/reference/saem.html b/docs/dev/reference/saem.html index 25eb03c7..d2ea6e1a 100644 --- a/docs/dev/reference/saem.html +++ b/docs/dev/reference/saem.html @@ -397,8 +397,8 @@ using mmkin.

#> saemix version used for fitting: 3.3 #> mkin version used for pre-fitting: 1.2.10 #> R version used for fitting: 4.4.2 -#> Date of fit: Fri Feb 14 07:32:13 2025 -#> Date of summary: Fri Feb 14 07:32:13 2025 +#> Date of fit: Sun Feb 16 17:01:05 2025 +#> Date of summary: Sun Feb 16 17:01:05 2025 #> #> Equations: #> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * @@ -413,7 +413,7 @@ using mmkin.

#> #> Model predictions using solution type analytical #> -#> Fitted in 3.605 s +#> Fitted in 3.489 s #> Using 300, 100 iterations and 10 chains #> #> Variance model: Constant variance @@ -695,7 +695,7 @@ using mmkin.

#> #> In above message, R1 = 91 #> -#> Error in deSolve::lsoda(y = odeini, times = outtimes, func = lsoda_func, : +#> Error in deSolve::lsoda(y = odeini, times = outtimes_deSolve, func = lsoda_func, : #> illegal input detected before taking any integration steps - see written message #anova( diff --git a/docs/dev/reference/summary.mkinfit.html b/docs/dev/reference/summary.mkinfit.html index 63a08d05..a9d124b9 100644 --- a/docs/dev/reference/summary.mkinfit.html +++ b/docs/dev/reference/summary.mkinfit.html @@ -193,15 +193,15 @@ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp, summary(mkinfit("SFO", FOCUS_2006_A, quiet = TRUE)) #> mkin version used for fitting: 1.2.10 #> R version used for fitting: 4.4.2 -#> Date of fit: Fri Feb 14 07:34:16 2025 -#> Date of summary: Fri Feb 14 07:34:16 2025 +#> Date of fit: Sun Feb 16 17:03:11 2025 +#> Date of summary: Sun Feb 16 17:03:11 2025 #> #> Equations: #> d_parent/dt = - k_parent * parent #> #> Model predictions using solution type analytical #> -#> Fitted using 131 model solutions performed in 0.009 s +#> Fitted using 131 model solutions performed in 0.01 s #> #> Error model: Constant variance #> diff --git a/docs/dev/reference/summary.mmkin.html b/docs/dev/reference/summary.mmkin.html index dad19e59..27b8c8a5 100644 --- a/docs/dev/reference/summary.mmkin.html +++ b/docs/dev/reference/summary.mmkin.html @@ -113,7 +113,7 @@ and gives an overview of ill-defined parameters calculated by #> false convergence (8) summary(fits) #> Error model: Constant variance -#> Fitted in 0.512 s +#> Fitted in 0.471 s #> #> Status: #> dataset diff --git a/docs/dev/reference/summary.nlme.mmkin.html b/docs/dev/reference/summary.nlme.mmkin.html index dd4c4771..a1206833 100644 --- a/docs/dev/reference/summary.nlme.mmkin.html +++ b/docs/dev/reference/summary.nlme.mmkin.html @@ -214,8 +214,8 @@ José Pinheiro and Douglas Bates for the components inherited from nlme

#> nlme version used for fitting: 3.1.166 #> mkin version used for pre-fitting: 1.2.10 #> R version used for fitting: 4.4.2 -#> Date of fit: Fri Feb 14 07:34:18 2025 -#> Date of summary: Fri Feb 14 07:34:18 2025 +#> Date of fit: Sun Feb 16 17:03:13 2025 +#> Date of summary: Sun Feb 16 17:03:13 2025 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -225,7 +225,7 @@ José Pinheiro and Douglas Bates for the components inherited from nlme

#> #> Model predictions using solution type analytical #> -#> Fitted in 0.187 s using 4 iterations +#> Fitted in 0.189 s using 4 iterations #> #> Variance model: Two-component variance function #> diff --git a/docs/dev/reference/summary.saem.mmkin.html b/docs/dev/reference/summary.saem.mmkin.html index e6138f37..271dddfa 100644 --- a/docs/dev/reference/summary.saem.mmkin.html +++ b/docs/dev/reference/summary.saem.mmkin.html @@ -290,8 +290,8 @@ saemix authors for the parts inherited from saemix.

#> saemix version used for fitting: 3.3 #> mkin version used for pre-fitting: 1.2.10 #> R version used for fitting: 4.4.2 -#> Date of fit: Fri Feb 14 07:34:33 2025 -#> Date of summary: Fri Feb 14 07:34:33 2025 +#> Date of fit: Sun Feb 16 17:03:28 2025 +#> Date of summary: Sun Feb 16 17:03:28 2025 #> #> Equations: #> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * @@ -306,7 +306,7 @@ saemix authors for the parts inherited from saemix.

#> #> Model predictions using solution type analytical #> -#> Fitted in 8.903 s +#> Fitted in 8.612 s #> Using 300, 100 iterations and 10 chains #> #> Variance model: Two-component variance function -- cgit v1.2.1