From e05656d57668688b971c28e32b4cfd4d3eac4662 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 18 Sep 2019 13:03:50 +0200 Subject: Correct and rebuild docs - Reconcile docs and code for max_twa_parent - Correct links to docs in twa vignette - Static documentation rebuilt by pkgdown --- docs/reference/mkinfit.html | 106 +++++++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 46 deletions(-) (limited to 'docs/reference/mkinfit.html') diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html index 2ba4cc0c..b620f364 100644 --- a/docs/reference/mkinfit.html +++ b/docs/reference/mkinfit.html @@ -16,13 +16,15 @@ - + + - - + + + @@ -55,6 +57,7 @@ Per default, parameters in the kinetic models are internally transformed in + @@ -124,6 +127,7 @@ Per default, parameters in the kinetic models are internally transformed in +
@@ -137,7 +141,7 @@ Per default, parameters in the kinetic models are internally transformed in

This function maximises the likelihood of the observed data using - the Port algorithm nlminb, and the specified initial or fixed + the Port algorithm nlminb, and the specified initial or fixed parameters and starting values. In each step of the optimsation, the kinetic model is solved using the function mkinpredict. The parameters of the selected error model are fitted simultaneously with the degradation @@ -152,18 +156,18 @@ Per default, parameters in the kinetic models are internally transformed in parms.ini = "auto", state.ini = "auto", err.ini = "auto", - fixed_parms = NULL, fixed_initials = names(mkinmod$diffs)[-1], + fixed_parms = NULL, fixed_initials = names(mkinmod$diffs)[-1], from_max_mean = FALSE, - solution_type = c("auto", "analytical", "eigen", "deSolve"), + solution_type = c("auto", "analytical", "eigen", "deSolve"), method.ode = "lsoda", use_compiled = "auto", - control = list(eval.max = 300, iter.max = 200), + control = list(eval.max = 300, iter.max = 200), transform_rates = TRUE, transform_fractions = TRUE, 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 = c("const", "obs", "tc"), + error_model_algorithm = c("d_3", "direct", "twostep", "threestep", "fourstep", "IRLS", "OLS"), reweight.tol = 1e-8, reweight.max.iter = 10, trace_parms = FALSE, ...) @@ -267,7 +271,7 @@ Per default, parameters in the kinetic models are internally transformed in control -

A list of control arguments passed to nlminb.

+

A list of control arguments passed to nlminb.

transform_rates @@ -368,7 +372,7 @@ Per default, parameters in the kinetic models are internally transformed in

Should a trace of the parameter values be listed?

- … + ...

Further arguments that will be passed on to deSolve.

@@ -381,7 +385,7 @@ Per default, parameters in the kinetic models are internally transformed in

See also

Plotting methods plot.mkinfit and mkinparplot.

-

Comparisons of models fitted to the same data can be made using AIC +

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 mmkin.

@@ -402,17 +406,17 @@ Per default, parameters in the kinetic models are internally transformed in

Examples

# Use shorthand notation for parent only degradation 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: Tue Jul 9 08:58:09 2019 -#> Date of summary: Tue Jul 9 08:58:09 2019 +summary(fit)
#> mkin version used for fitting: 0.9.49.6 +#> R version used for fitting: 3.6.1 +#> Date of fit: Wed Sep 18 12:55:32 2019 +#> Date of summary: Wed Sep 18 12:55:32 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.475 s +#> Fitted using 222 model solutions performed in 0.459 s #> #> Error model: Constant variance #> @@ -484,9 +488,9 @@ Per default, parameters in the kinetic models are internally transformed in SFO_SFO <- mkinmod( parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"))
#> Successfully compiled differential equation model from auto-generated C code.
# Fit the model to the FOCUS example dataset D using defaults -print(system.time(fit <- mkinfit(SFO_SFO, FOCUS_2006_D, +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.581 0.000 1.582
coef(fit)
#> NULL
#> $ff +#> 1.480 0.000 1.482
coef(fit)
#> NULL
#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 #> @@ -497,8 +501,9 @@ Per default, parameters in the kinetic models are internally transformed in #> DT50 DT90 #> parent 7.022929 23.32967 #> m1 131.760712 437.69961 -#>
# deSolve is slower when no C compiler (gcc) was available during model generation -print(system.time(fit.deSolve <- mkinfit(SFO_SFO, FOCUS_2006_D, +#>
# \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, solution_type = "deSolve")))
#> Warning: Observations with value of zero were removed from the data
#> Ordinary least squares optimisation
#> Sum of squared residuals at call 1: 18915.53 #> Sum of squared residuals at call 2: 18915.53 #> Sum of squared residuals at call 6: 11424.02 @@ -558,7 +563,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.109 0.000 1.109
coef(fit.deSolve)
#> NULL
endpoints(fit.deSolve)
#> $ff +#> 1.045 0.000 1.046
coef(fit.deSolve)
#> NULL
endpoints(fit.deSolve)
#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 #> @@ -569,9 +574,11 @@ Per default, parameters in the kinetic models are internally transformed in #> DT50 DT90 #> parent 7.022929 23.32967 #> m1 131.760712 437.69961 -#>
-# Use stepwise fitting, using optimised parameters from parent only fit, FOMC -
FOMC_SFO <- mkinmod( +#>
# } + +# Use stepwise fitting, using optimised parameters from parent only fit, FOMC +# \dontrun{ +FOMC_SFO <- mkinmod( parent = mkinsub("FOMC", "m1"), m1 = mkinsub("SFO"))
#> Successfully compiled differential equation model from auto-generated C code.
# Fit the model to the FOCUS example dataset D using defaults fit.FOMC_SFO <- mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
# Use starting parameters from parent only FOMC fit @@ -580,18 +587,20 @@ Per default, parameters in the kinetic models are internally transformed in parms.ini = fit.FOMC$bparms.ode)
#> Warning: Observations with value of zero were removed from the data
# Use stepwise fitting, using optimised parameters from parent only fit, SFORB SFORB_SFO <- mkinmod( - parent = list(type = "SFORB", to = "m1", sink = TRUE), - m1 = list(type = "SFO"))
#> Successfully compiled differential equation model from auto-generated C code.
# Fit the model to the FOCUS example dataset D using defaults + parent = list(type = "SFORB", to = "m1", sink = TRUE), + m1 = list(type = "SFO"))
#> Successfully compiled differential equation model from auto-generated C code.
# Fit the model to the FOCUS example dataset D using defaults fit.SFORB_SFO <- mkinfit(SFORB_SFO, FOCUS_2006_D, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
fit.SFORB_SFO.deSolve <- mkinfit(SFORB_SFO, FOCUS_2006_D, solution_type = "deSolve", quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
# Use starting parameters from parent only SFORB fit (not really needed in this case) fit.SFORB = mkinfit("SFORB", FOCUS_2006_D, quiet = TRUE) -fit.SFORB_SFO <- mkinfit(SFORB_SFO, FOCUS_2006_D, parms.ini = fit.SFORB$bparms.ode, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
-
# Weighted fits, including IRLS +fit.SFORB_SFO <- mkinfit(SFORB_SFO, FOCUS_2006_D, parms.ini = fit.SFORB$bparms.ode, quiet = TRUE)
#> Warning: Observations with value of zero were removed from the data
# } + +# \dontrun{ +# Weighted fits, including IRLS 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: Tue Jul 9 08:58:26 2019 -#> Date of summary: Tue Jul 9 08:58:26 2019 + 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.1 +#> Date of fit: Wed Sep 18 12:55:47 2019 +#> Date of summary: Wed Sep 18 12:55:47 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -599,7 +608,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.136 s +#> Fitted using 421 model solutions performed in 1.077 s #> #> Error model: Constant variance #> @@ -707,10 +716,10 @@ Per default, parameters in the kinetic models are internally transformed in #> 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.49.6 -#> R version used for fitting: 3.6.0 -#> Date of fit: Tue Jul 9 08:58:29 2019 -#> Date of summary: Tue Jul 9 08:58:29 2019 +#> 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.1 +#> Date of fit: Wed Sep 18 12:55:50 2019 +#> Date of summary: Wed Sep 18 12:55:50 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -718,7 +727,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.836 s +#> Fitted using 979 model solutions performed in 2.624 s #> #> Error model: Variance unique to each observed variable #> @@ -839,10 +848,10 @@ Per default, parameters in the kinetic models are internally transformed in #> 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.49.6 -#> R version used for fitting: 3.6.0 -#> Date of fit: Tue Jul 9 08:58:39 2019 -#> Date of summary: Tue Jul 9 08:58:39 2019 +#> 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.1 +#> Date of fit: Wed Sep 18 12:55:59 2019 +#> Date of summary: Wed Sep 18 12:55:59 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -850,7 +859,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.908 s +#> Fitted using 2289 model solutions performed in 9.376 s #> #> Error model: Two-component variance function #> @@ -964,7 +973,8 @@ Per default, parameters in the kinetic models are internally transformed in #> 100 m1 31.04 32.20082 -1.160823 #> 100 m1 33.13 32.20082 0.929177 #> 120 m1 25.15 29.04130 -3.891304 -#> 120 m1 33.31 29.04130 4.268696
+#> 120 m1 33.31 29.04130 4.268696
# } +
+ + + -- cgit v1.2.1