From ed68dee95554c43b150836106ff4036660989b47 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 15 May 2020 07:33:27 +0200 Subject: Use markdown links in mkinfit documentation --- docs/pkgdown.yml | 2 +- docs/reference/mkinfit.html | 94 +++++++++++++++++++++++---------------------- 2 files changed, 49 insertions(+), 47 deletions(-) (limited to 'docs') diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 3c25ad85..4756397e 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -10,7 +10,7 @@ articles: NAFTA_examples: web_only/NAFTA_examples.html benchmarks: web_only/benchmarks.html compiled_models: web_only/compiled_models.html -last_built: 2020-05-14T16:46Z +last_built: 2020-05-15T05:30Z urls: reference: https://pkgdown.jrwb.de/mkin/reference article: https://pkgdown.jrwb.de/mkin/articles diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html index 3438b8b1..0c1540d2 100644 --- a/docs/reference/mkinfit.html +++ b/docs/reference/mkinfit.html @@ -41,9 +41,11 @@ @@ -78,7 +80,7 @@ likelihood function." /> mkin - 0.9.50.2 + 0.9.50.3 @@ -151,9 +153,11 @@ likelihood function." />

This function maximises the likelihood of the observed data using the Port -algorithm nlminb, and the specified initial or fixed +algorithm stats::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. 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 parameters of the selected error model are fitted simultaneously with the degradation model parameters, as both of them are arguments of the likelihood function.

@@ -191,7 +195,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 @@ -227,7 +231,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 @@ -266,29 +270,28 @@ 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 +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. This argument is -passed on to the helper function mkinpredict.

+can be expressed using eigenvalues and eigenvectors.

method.ode -

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

The solution method passed via mkinpredict() +to deSolve::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 nlminb.

+

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

transform_rates @@ -308,7 +311,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 @@ -317,13 +320,14 @@ log-likelihood after each improvement?

atol -

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

+

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.

rtol -

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

+

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

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

...

Further arguments that will be passed on to -deSolve.

+deSolve::ode().

Value

-

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

+

A list with "mkinfit" in the class attribute.

Details

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

See also

-

Plotting methods plot.mkinfit and -mkinparplot.

+

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

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 @@ -420,17 +422,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.2 +summary(fit)
#> mkin version used for fitting: 0.9.50.3 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 19:10:13 2020 -#> Date of summary: Tue May 12 19:10:13 2020 +#> Date of fit: Fri May 15 07:30:32 2020 +#> Date of summary: Fri May 15 07:30:32 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.047 s +#> Fitted using 222 model solutions performed in 0.048 s #> #> Error model: Constant variance #> @@ -506,8 +508,8 @@ Degradation Data. Environments 6(12) 124 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, - solution_type = "eigen", quiet = TRUE)))
#> Warning: Observations with value of zero were removed from the data
#> User System verstrichen -#> 0.417 0.000 0.417
parms(fit)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma + solution_type = "eigen", quiet = TRUE)))
#> Warning: Observations with value of zero were removed from the data
#> user system elapsed +#> 0.413 0.005 0.419
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 @@ -596,8 +598,8 @@ Degradation Data. Environments 6(12) 124 #> 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 verstrichen -#> 0.351 0.000 0.352
parms(fit.deSolve)
#> parent_0 k_parent k_m1 f_parent_to_m1 sigma +#> Negative log-likelihood at call 178: 97.22429
#> Optimisation successfully terminated.
#> user system elapsed +#> 0.354 0.000 0.354
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 @@ -629,10 +631,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.2 + 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 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 19:10:18 2020 -#> Date of summary: Tue May 12 19:10:18 2020 +#> Date of fit: Fri May 15 07:30:37 2020 +#> Date of summary: Fri May 15 07:30:37 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -640,7 +642,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type analytical #> -#> Fitted using 421 model solutions performed in 0.146 s +#> Fitted using 421 model solutions performed in 0.147 s #> #> Error model: Constant variance #> @@ -751,10 +753,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.2 +#> 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 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 19:10:19 2020 -#> Date of summary: Tue May 12 19:10:19 2020 +#> Date of fit: Fri May 15 07:30:38 2020 +#> Date of summary: Fri May 15 07:30:38 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -888,10 +890,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.2 +#> 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 #> R version used for fitting: 4.0.0 -#> Date of fit: Tue May 12 19:10:19 2020 -#> Date of summary: Tue May 12 19:10:19 2020 +#> Date of fit: Fri May 15 07:30:39 2020 +#> Date of summary: Fri May 15 07:30:39 2020 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -899,7 +901,7 @@ Degradation Data. Environments 6(12) 124 #> #> Model predictions using solution type analytical #> -#> Fitted using 1875 model solutions performed in 0.645 s +#> Fitted using 1875 model solutions performed in 0.658 s #> #> Error model: Two-component variance function #> -- cgit v1.2.1