From 9ac853c7ceece333099021974025d07e75be2b33 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 12 May 2020 08:07:07 +0200 Subject: Documentation improvements, rebuild static docs --- docs/reference/mkinfit.html | 133 +++++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 64 deletions(-) (limited to 'docs/reference/mkinfit.html') diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html index 9974b66b..ceac59bf 100644 --- a/docs/reference/mkinfit.html +++ b/docs/reference/mkinfit.html @@ -78,7 +78,7 @@ likelihood function." /> mkin - 0.9.50 + 0.9.50.1 @@ -209,15 +209,15 @@ detection.

parms.ini

A named vector of initial values for the parameters, - including parameters to be optimised and potentially also fixed parameters - as indicated by fixed_parms. If set to "auto", initial values for - rate constants are set to default values. Using parameter names that are - not in the model gives an error.

+including parameters to be optimised and potentially also fixed parameters +as indicated by fixed_parms. If set to "auto", initial values for +rate constants are set to default values. Using parameter names that are +not in the model gives an error.

It is possible to only specify a subset of the parameters that the model - needs. You can use the parameter lists "bparms.ode" from a previously - fitted model, which contains the differential equation parameters from - this model. This works nicely if the models are nested. An example is - given below.

+needs. You can use the parameter lists "bparms.ode" from a previously +fitted model, which contains the differential equation parameters from +this model. This works nicely if the models are nested. An example is +given below.

state.ini @@ -326,42 +326,44 @@ is 1e-10, much lower than in lsoda.

error_model

If the error model is "const", a constant standard - deviation is assumed.

+deviation is assumed.

If the error model is "obs", each observed variable is assumed to have its - own variance.

+own variance.

If the error model is "tc" (two-component error model), a two component - error model similar to the one described by Rocke and Lorenzato (1995) is - used for setting up the likelihood function. Note that this model - deviates from the model by Rocke and Lorenzato, as their model implies - that the errors follow a lognormal distribution for large values, not a - normal distribution as assumed by this method.

+error model similar to the one described by Rocke and Lorenzato (1995) is +used for setting up the likelihood function. Note that this model +deviates from the model by Rocke and Lorenzato, as their model implies +that the errors follow a lognormal distribution for large values, not a +normal distribution as assumed by this method.

error_model_algorithm

If "auto", the selected algorithm depends on - 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 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

+

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.

+initial unweighted least squares optimisation step.

The algorithm "threestep" starts with unweighted least squares, then - optimizes only the error model using the degradation model parameters - found, and then minimizes the negative log-likelihood with free - degradation and error model parameters.

+optimizes only the error model using the degradation model parameters +found, and then minimizes the negative log-likelihood with free +degradation and error model parameters.

The algorithm "fourstep" starts with unweighted least squares, then - optimizes only the error model using the degradation model 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.

+optimizes only the error model using the degradation model 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" (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.

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

reweight.tol @@ -383,14 +385,10 @@ the error model parameters in IRLS fits.

-

Source

- -

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

Value

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

+obtained by summary.mkinfit.

Details

Per default, parameters in the kinetic models are internally transformed in @@ -399,33 +397,40 @@ estimators.

Note

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

+"transform_rates = TRUE" (the default) often leads to failures of the +numerical ODE solver. In this situation it may help to switch off the +internal rate transformation.

+

References

+ +

Rocke DM and Lorenzato S (1995) A two-component model +for measurement error in analytical chemistry. Technometrics 37(2), 176-184.

+

Ranke J and Meinecke S (2019) Error Models for the Kinetic Evaluation of Chemical +Degradation Data. Environments 6(12) 124 +doi:10.3390/environments6120124.

See also

Plotting methods plot.mkinfit and - mkinparplot.

+mkinparplot.

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

+AIC by virtue of the method logLik.mkinfit.

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

+mmkin.

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.50 +summary(fit)
#> mkin version used for fitting: 0.9.50.1 #> R version used for fitting: 4.0.0 -#> Date of fit: Mon May 11 05:14:26 2020 -#> Date of summary: Mon May 11 05:14:26 2020 +#> Date of fit: Tue May 12 08:36:07 2020 +#> Date of summary: Tue May 12 08:36:07 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.043 s +#> Fitted using 222 model solutions performed in 0.047 s #> #> Error model: Constant variance #> @@ -502,7 +507,7 @@ estimators.

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 -#> 0.407 0.002 0.409
parms(fit)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma +#> 0.408 0.008 0.416
parms(fit)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma #> 99.598483222 0.098697734 0.005260651 0.514475962 3.125503875
#> $ff #> parent_m1 parent_sink #> 0.514476 0.485524 @@ -592,7 +597,7 @@ estimators.

#> 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 verstrichen -#> 0.349 0.000 0.350
parms(fit.deSolve)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma +#> 0.350 0.001 0.351
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 #> parent_m1 parent_sink #> 0.514476 0.485524 @@ -622,12 +627,12 @@ estimators.

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
#> Warning: Initial parameter(s) k_parent_free_sink not used in the model
# } # \dontrun{ -# Weighted fits, including IRLS +# 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 + 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.1 #> R version used for fitting: 4.0.0 -#> Date of fit: Mon May 11 05:14:31 2020 -#> Date of summary: Mon May 11 05:14:31 2020 +#> Date of fit: Tue May 12 08:36:12 2020 +#> Date of summary: Tue May 12 08:36:12 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -635,7 +640,7 @@ estimators.

#> #> Model predictions using solution type analytical #> -#> Fitted using 421 model solutions performed in 0.124 s +#> Fitted using 421 model solutions performed in 0.146 s #> #> Error model: Constant variance #> @@ -746,10 +751,10 @@ estimators.

#> 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 +#> 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.1 #> R version used for fitting: 4.0.0 -#> Date of fit: Mon May 11 05:14:32 2020 -#> Date of summary: Mon May 11 05:14:32 2020 +#> Date of fit: Tue May 12 08:36:13 2020 +#> Date of summary: Tue May 12 08:36:13 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -757,7 +762,7 @@ estimators.

#> #> Model predictions using solution type analytical #> -#> Fitted using 978 model solutions performed in 0.336 s +#> Fitted using 978 model solutions performed in 0.337 s #> #> Error model: Variance unique to each observed variable #> @@ -883,10 +888,10 @@ estimators.

#> 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 +#> 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.1 #> R version used for fitting: 4.0.0 -#> Date of fit: Mon May 11 05:14:32 2020 -#> Date of summary: Mon May 11 05:14:32 2020 +#> Date of fit: Tue May 12 08:36:14 2020 +#> Date of summary: Tue May 12 08:36:14 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -894,7 +899,7 @@ estimators.

#> #> Model predictions using solution type analytical #> -#> Fitted using 1875 model solutions performed in 0.642 s +#> Fitted using 1875 model solutions performed in 0.647 s #> #> Error model: Two-component variance function #> -- cgit v1.2.1