From e0bef15657df1d6cade99cc3f6d8b07fa35792fe Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 8 Jul 2019 18:12:21 +0200 Subject: Adaptations for gmkin Address winbuilder check problems, update check log, update of static docs --- docs/reference/AIC.mmkin.html | 5 ++-- docs/reference/Extract.mmkin.html | 8 +++---- docs/reference/mkinfit.html | 46 ++++++++++++++++++------------------- docs/reference/mkinmod.html | 2 +- docs/reference/mkinpredict.html | 4 ++-- docs/reference/mmkin.html | 4 ++-- docs/reference/summary.mkinfit.html | 6 ++--- 7 files changed, 37 insertions(+), 38 deletions(-) (limited to 'docs/reference') diff --git a/docs/reference/AIC.mmkin.html b/docs/reference/AIC.mmkin.html index 4e686c98..881af6b3 100644 --- a/docs/reference/AIC.mmkin.html +++ b/docs/reference/AIC.mmkin.html @@ -161,7 +161,8 @@

Examples

-
f <- mmkin(c("SFO", "FOMC", "DFOP"), +
# skip, as it takes > 10 s on winbuilder + f <- mmkin(c("SFO", "FOMC", "DFOP"), list("FOCUS A" = FOCUS_2006_A, "FOCUS C" = FOCUS_2006_C), cores = 1, quiet = TRUE)
#> Warning: Optimisation did not converge: #> false convergence (8)
AIC(f[1, "FOCUS A"]) # We get a single number for a single fit
#> [1] 55.28197
@@ -178,7 +179,7 @@ AIC(f[, "FOCUS C"])
#> df AIC #> SFO 3 59.29336 #> FOMC 4 44.68652 -#> DFOP 5 29.02372
+#> DFOP 5 29.02372
#> dataset #> model B C -#> FOMC List,37 List,37 +#> FOMC List,39 List,39 #> attr(,"class") #> [1] "mmkin"
fits[, "B"]
#> dataset #> model B -#> SFO List,37 -#> FOMC List,37 +#> SFO List,39 +#> FOMC List,39 #> attr(,"class") #> [1] "mmkin"
fits["SFO", "B"]
#> dataset #> model B -#> SFO List,37 +#> SFO List,39 #> attr(,"class") #> [1] "mmkin"
head( diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html index e9ad9343..2ba4cc0c 100644 --- a/docs/reference/mkinfit.html +++ b/docs/reference/mkinfit.html @@ -163,7 +163,8 @@ Per default, parameters in the kinetic models are internally transformed in quiet = FALSE, atol = 1e-8, rtol = 1e-10, n.outtimes = 100, error_model = c("const", "obs", "tc"), - error_model_algorithm = c("d_3", "direct", "twostep", "threestep", "fourstep", "IRLS"), + error_model_algorithm = c("d_3", "direct", "twostep", "threestep", "fourstep", "IRLS", + "OLS"), reweight.tol = 1e-8, reweight.max.iter = 10, trace_parms = FALSE, ...) @@ -345,10 +346,13 @@ Per default, parameters in the kinetic models are internally transformed in parameters found, then optimizes the degradation model again with fixed error model parameters, and finally minimizes the negative log-likelihood with free degradation and error model parameters.

-

The algorithm "IRLS" starts with unweighted least squares, - and then iterates optimization of the error model parameters and subsequent +

The algorithm "IRLS" (Iteratively Reweighted Least Squares) starts with + unweighted least squares, and then iterates optimization of the error model + parameters and subsequent optimization of the degradation model using those error model parameters, - until the error model parameters converge.

+ until the error model parameters converge.

+

The algorithm "OLS" (Ordinary Least Squares) is automatically selected when + the error model is "const" and results in an unweighted least squares fit.

reweight.tol @@ -400,15 +404,15 @@ Per default, parameters in the kinetic models are internally transformed in fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE) summary(fit)
#> mkin version used for fitting: 0.9.49.6 #> R version used for fitting: 3.6.0 -#> Date of fit: Fri Jul 5 15:50:49 2019 -#> Date of summary: Fri Jul 5 15:50:49 2019 +#> Date of fit: Tue Jul 9 08:58:09 2019 +#> Date of summary: Tue Jul 9 08:58:09 2019 #> #> 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.455 s +#> Fitted using 222 model solutions performed in 0.475 s #> #> Error model: Constant variance #> @@ -482,10 +486,7 @@ Per default, parameters in the kinetic models are internally transformed in 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 verstrichen -#> 1.502 0.000 1.503
coef(fit)
#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink -#> 99.598483 -3.038220 -2.980300 -5.247500 -#> sigma -#> 3.125504
endpoints(fit)
#> $ff +#> 1.581 0.000 1.582
coef(fit)
#> NULL
endpoints(fit)
#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 #> @@ -557,10 +558,7 @@ Per default, parameters in the kinetic models are internally transformed in #> Sum of squared residuals at call 126: 371.2134 #> Sum of squared residuals at call 135: 371.2134 #> Negative log-likelihood at call 145: 97.22429
#> Optimisation successfully terminated.
#> User System verstrichen -#> 1.089 0.000 1.089
coef(fit.deSolve)
#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink -#> 99.598483 -3.038220 -2.980300 -5.247500 -#> sigma -#> 3.125504
endpoints(fit.deSolve)
#> $ff +#> 1.109 0.000 1.109
coef(fit.deSolve)
#> NULL
endpoints(fit.deSolve)
#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 #> @@ -592,8 +590,8 @@ Per default, parameters in the kinetic models are internally transformed in 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.49.6 #> R version used for fitting: 3.6.0 -#> Date of fit: Fri Jul 5 15:51:05 2019 -#> Date of summary: Fri Jul 5 15:51:05 2019 +#> Date of fit: Tue Jul 9 08:58:26 2019 +#> Date of summary: Tue Jul 9 08:58:26 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -601,7 +599,7 @@ Per default, parameters in the kinetic models are internally transformed in #> #> Model predictions using solution type deSolve #> -#> Fitted using 421 model solutions performed in 1.08 s +#> Fitted using 421 model solutions performed in 1.136 s #> #> Error model: Constant variance #> @@ -711,8 +709,8 @@ Per default, parameters in the kinetic models are internally transformed in #> 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.49.6 #> R version used for fitting: 3.6.0 -#> Date of fit: Fri Jul 5 15:51:08 2019 -#> Date of summary: Fri Jul 5 15:51:08 2019 +#> Date of fit: Tue Jul 9 08:58:29 2019 +#> Date of summary: Tue Jul 9 08:58:29 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -720,7 +718,7 @@ Per default, parameters in the kinetic models are internally transformed in #> #> Model predictions using solution type deSolve #> -#> Fitted using 979 model solutions performed in 2.623 s +#> Fitted using 979 model solutions performed in 2.836 s #> #> Error model: Variance unique to each observed variable #> @@ -843,8 +841,8 @@ Per default, parameters in the kinetic models are internally transformed in #> 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.49.6 #> R version used for fitting: 3.6.0 -#> Date of fit: Fri Jul 5 15:51:17 2019 -#> Date of summary: Fri Jul 5 15:51:17 2019 +#> Date of fit: Tue Jul 9 08:58:39 2019 +#> Date of summary: Tue Jul 9 08:58:39 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -852,7 +850,7 @@ Per default, parameters in the kinetic models are internally transformed in #> #> Model predictions using solution type deSolve #> -#> Fitted using 2289 model solutions performed in 9.215 s +#> Fitted using 2289 model solutions performed in 9.908 s #> #> Error model: Two-component variance function #> diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html index 12832ef5..16f80fe0 100644 --- a/docs/reference/mkinmod.html +++ b/docs/reference/mkinmod.html @@ -234,7 +234,7 @@ For the definition of model types and their parameters, the equations given SFO_SFO <- mkinmod( parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), verbose = TRUE)
#> Compilation argument: -#> /usr/lib/R/bin/R CMD SHLIB file2cf21d96d281.c 2> file2cf21d96d281.c.err.txt +#> /usr/lib/R/bin/R CMD SHLIB file37c428e02a2c.c 2> file37c428e02a2c.c.err.txt #> Program source: #> 1: #include <R.h> #> 2: diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html index 53739b55..fc3e8512 100644 --- a/docs/reference/mkinpredict.html +++ b/docs/reference/mkinpredict.html @@ -333,12 +333,12 @@ 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 verstrichen -#> 0.002 0.000 0.001
system.time( +#> 0.001 0.000 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 verstrichen -#> 0.022 0.000 0.022
+#> 0.022 0.000 0.021
# Predict from a fitted model f <- mkinfit(SFO_SFO, FOCUS_2006_C)
#> Ordinary least squares optimisation
#> Sum of squared residuals at call 1: 552.5739 #> Sum of squared residuals at call 3: 552.5739 diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html index abd42f92..49860cbe 100644 --- a/docs/reference/mmkin.html +++ b/docs/reference/mmkin.html @@ -194,8 +194,8 @@ time_1 <- system.time(fits.4 <- mmkin(models, datasets, cores = 1, quiet = TRUE)) time_default
#> User System verstrichen -#> 0.044 0.040 4.908
time_1
#> User System verstrichen -#> 19.106 0.000 19.171
+#> 0.045 0.038 5.672
time_1
#> User System verstrichen +#> 20.914 0.000 20.928
endpoints(fits.0[["SFO_lin", 2]])
#> $ff #> parent_M1 parent_sink M1_M2 M1_sink #> 0.7340481 0.2659519 0.7505684 0.2494316 diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html index 2fa2dbe7..1eec5820 100644 --- a/docs/reference/summary.mkinfit.html +++ b/docs/reference/summary.mkinfit.html @@ -211,15 +211,15 @@

Examples

summary(mkinfit(mkinmod(parent = mkinsub("SFO")), FOCUS_2006_A, quiet = TRUE))
#> mkin version used for fitting: 0.9.49.6 #> R version used for fitting: 3.6.0 -#> Date of fit: Fri Jul 5 15:52:35 2019 -#> Date of summary: Fri Jul 5 15:52:35 2019 +#> Date of fit: Tue Jul 9 09:00:02 2019 +#> Date of summary: Tue Jul 9 09:00:02 2019 #> #> Equations: #> d_parent/dt = - k_parent_sink * parent #> #> Model predictions using solution type analytical #> -#> Fitted using 131 model solutions performed in 0.266 s +#> Fitted using 131 model solutions performed in 0.278 s #> #> Error model: Constant variance #> -- cgit v1.2.1