diff options
Diffstat (limited to 'docs/reference/mkinfit.html')
-rw-r--r-- | docs/reference/mkinfit.html | 317 |
1 files changed, 137 insertions, 180 deletions
diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html index 865bdc28..5af8eaaf 100644 --- a/docs/reference/mkinfit.html +++ b/docs/reference/mkinfit.html @@ -1,5 +1,5 @@ <!DOCTYPE html> -<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Fit a kinetic model to data with one or more state variables — mkinfit • mkin</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Fit a kinetic model to data with one or more state variables — mkinfit"><meta property="og:description" content="This function maximises the likelihood of the observed data using the Port +<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Fit a kinetic model to data with one or more state variables — mkinfit • mkin</title><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Fit a kinetic model to data with one or more state variables — mkinfit"><meta name="description" content="This function maximises the likelihood of the observed data using the Port 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(), except @@ -7,116 +7,76 @@ 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."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> -<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> -<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> -<![endif]--></head><body data-spy="scroll" data-target="#toc"> - - - <div class="container template-reference-topic"> - <header><div class="navbar navbar-default navbar-fixed-top" role="navigation"> - <div class="container"> - <div class="navbar-header"> - <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> - <span class="sr-only">Toggle navigation</span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - <span class="navbar-brand"> - <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.2.6</span> - </span> - </div> - - <div id="navbar" class="navbar-collapse collapse"> - <ul class="nav navbar-nav"><li> - <a href="../reference/index.html">Reference</a> -</li> -<li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> - Articles - - <span class="caret"></span> - </a> - <ul class="dropdown-menu" role="menu"><li> - <a href="../articles/mkin.html">Introduction to mkin</a> - </li> - <li class="divider"> - <li class="dropdown-header">Example evaluations with (generalised) nonlinear least squares</li> - <li> - <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> - </li> - <li> - <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> - </li> - <li> - <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> - </li> - <li class="divider"> - <li class="dropdown-header">Example evaluations with hierarchical models (nonlinear mixed-effects models)</li> - <li> - <a href="../articles/prebuilt/2022_dmta_parent.html">Testing hierarchical parent degradation kinetics with residue data on dimethenamid and dimethenamid-P</a> - </li> - <li> - <a href="../articles/prebuilt/2022_dmta_pathway.html">Testing hierarchical pathway kinetics with residue data on dimethenamid and dimethenamid-P</a> - </li> - <li> - <a href="../articles/prebuilt/2023_mesotrione_parent.html">Testing covariate modelling in hierarchical parent degradation kinetics with residue data on mesotrione</a> - </li> - <li> - <a href="../articles/prebuilt/2022_cyan_pathway.html">Testing hierarchical pathway kinetics with residue data on cyantraniliprole</a> - </li> - <li> - <a href="../articles/web_only/dimethenamid_2018.html">Comparison of saemix and nlme evaluations of dimethenamid data from 2018</a> - </li> - <li> - <a href="../articles/web_only/multistart.html">Short demo of the multistart method</a> - </li> - <li class="divider"> - <li class="dropdown-header">Performance</li> - <li> - <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> - </li> - <li> - <a href="../articles/web_only/benchmarks.html">Benchmark timings for mkin</a> - </li> - <li> - <a href="../articles/web_only/saem_benchmarks.html">Benchmark timings for saem.mmkin</a> - </li> - <li class="divider"> - <li class="dropdown-header">Miscellaneous</li> - <li> - <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> - </li> - <li> - <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> - </li> +likelihood function."><meta property="og:description" content="This function maximises the likelihood of the observed data using the Port +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(), 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."></head><body> + <a href="#main" class="visually-hidden-focusable">Skip to contents</a> + + + <nav class="navbar navbar-expand-lg fixed-top bg-light" data-bs-theme="default" aria-label="Site navigation"><div class="container"> + + <a class="navbar-brand me-2" href="../index.html">mkin</a> + + <small class="nav-text text-default me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Released version">1.2.9</small> + + + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + + <div id="navbar" class="collapse navbar-collapse ms-3"> + <ul class="navbar-nav me-auto"><li class="active nav-item"><a class="nav-link" href="../reference/index.html">Reference</a></li> +<li class="nav-item dropdown"> + <button class="nav-link dropdown-toggle" type="button" id="dropdown-articles" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">Articles</button> + <ul class="dropdown-menu" aria-labelledby="dropdown-articles"><li><a class="dropdown-item" href="../articles/mkin.html">Introduction to mkin</a></li> + <li><hr class="dropdown-divider"></li> + <li><h6 class="dropdown-header" data-toc-skip>Example evaluations with (generalised) nonlinear least squares</h6></li> + <li><a class="dropdown-item" href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a></li> + <li><a class="dropdown-item" href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a></li> + <li><a class="dropdown-item" href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a></li> + <li><hr class="dropdown-divider"></li> + <li><h6 class="dropdown-header" data-toc-skip>Example evaluations with hierarchical models (nonlinear mixed-effects models)</h6></li> + <li><a class="dropdown-item" href="../articles/prebuilt/2022_dmta_parent.html">Testing hierarchical parent degradation kinetics with residue data on dimethenamid and dimethenamid-P</a></li> + <li><a class="dropdown-item" href="../articles/prebuilt/2022_dmta_pathway.html">Testing hierarchical pathway kinetics with residue data on dimethenamid and dimethenamid-P</a></li> + <li><a class="dropdown-item" href="../articles/prebuilt/2023_mesotrione_parent.html">Testing covariate modelling in hierarchical parent degradation kinetics with residue data on mesotrione</a></li> + <li><a class="dropdown-item" href="../articles/prebuilt/2022_cyan_pathway.html">Testing hierarchical pathway kinetics with residue data on cyantraniliprole</a></li> + <li><a class="dropdown-item" href="../articles/web_only/dimethenamid_2018.html">Comparison of saemix and nlme evaluations of dimethenamid data from 2018</a></li> + <li><a class="dropdown-item" href="../articles/web_only/multistart.html">Short demo of the multistart method</a></li> + <li><hr class="dropdown-divider"></li> + <li><h6 class="dropdown-header" data-toc-skip>Performance</h6></li> + <li><a class="dropdown-item" href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a></li> + <li><a class="dropdown-item" href="../articles/web_only/benchmarks.html">Benchmark timings for mkin</a></li> + <li><a class="dropdown-item" href="../articles/web_only/saem_benchmarks.html">Benchmark timings for saem.mmkin</a></li> + <li><hr class="dropdown-divider"></li> + <li><h6 class="dropdown-header" data-toc-skip>Miscellaneous</h6></li> + <li><a class="dropdown-item" href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a></li> + <li><a class="dropdown-item" href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a></li> </ul></li> -<li> - <a href="../news/index.html">News</a> -</li> - </ul><ul class="nav navbar-nav navbar-right"><li> - <a href="https://github.com/jranke/mkin/" class="external-link"> - <span class="fab fa-github fa-lg"></span> - - </a> -</li> - </ul></div><!--/.nav-collapse --> - </div><!--/.container --> -</div><!--/.navbar --> - - - - </header><div class="row"> - <div class="col-md-9 contents"> - <div class="page-header"> - <h1>Fit a kinetic model to data with one or more state variables</h1> - <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/HEAD/R/mkinfit.R" class="external-link"><code>R/mkinfit.R</code></a></small> - <div class="hidden name"><code>mkinfit.Rd</code></div> +<li class="nav-item"><a class="nav-link" href="../coverage/coverage.html">Test coverage</a></li> +<li class="nav-item"><a class="nav-link" href="../news/index.html">News</a></li> + </ul><ul class="navbar-nav"><li class="nav-item"><form class="form-inline" role="search"> + <input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json"></form></li> +<li class="nav-item"><a class="external-link nav-link" href="https://github.com/jranke/mkin/" aria-label="GitHub"><span class="fa fab fa-github fa-lg"></span></a></li> + </ul></div> + + + </div> +</nav><div class="container template-reference-topic"> +<div class="row"> + <main id="main" class="col-md-9"><div class="page-header"> + + <h1>Fit a kinetic model to data with one or more state variables</h1> + <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/HEAD/R/mkinfit.R" class="external-link"><code>R/mkinfit.R</code></a></small> + <div class="d-none name"><code>mkinfit.Rd</code></div> </div> - <div class="ref-description"> + <div class="ref-description section level2"> <p>This function maximises the likelihood of the observed data using the Port algorithm <code><a href="https://rdrr.io/r/stats/nlminb.html" class="external-link">stats::nlminb()</a></code>, and the specified initial or fixed parameters and starting values. In each step of the optimisation, the @@ -128,7 +88,8 @@ degradation model parameters, as both of them are arguments of the likelihood function.</p> </div> - <div id="ref-usage"> + <div class="section level2"> + <h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2> <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">mkinfit</span><span class="op">(</span></span> <span> <span class="va">mkinmod</span>,</span> <span> <span class="va">observed</span>,</span> @@ -158,9 +119,11 @@ likelihood function.</p> <span><span class="op">)</span></span></code></pre></div> </div> - <div id="arguments"> - <h2>Arguments</h2> - <dl><dt>mkinmod</dt> + <div class="section level2"> + <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2> + + +<dl><dt id="arg-mkinmod">mkinmod<a class="anchor" aria-label="anchor" href="#arg-mkinmod"></a></dt> <dd><p>A list of class <a href="mkinmod.html">mkinmod</a>, 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 @@ -168,8 +131,9 @@ parent only degradation model is generated for the variable with the highest value in <code>observed</code>.</p></dd> -<dt>observed</dt> -<dd><p>A dataframe with the observed data. The first column called +<dt id="arg-observed">observed<a class="anchor" aria-label="anchor" href="#arg-observed"></a></dt> +<dd><p>A dataframe or an object coercible to a dataframe +(e.g. a <code>tibble</code>) with the observed data. The first column called "name" must contain the name of the observed variable for each data point. The second column must contain the times of observation, named "time". The third column must be named "value" and contain the observed values. @@ -180,7 +144,7 @@ not observed in degradation data, because there is a lower limit of detection.</p></dd> -<dt>parms.ini</dt> +<dt id="arg-parms-ini">parms.ini<a class="anchor" aria-label="anchor" href="#arg-parms-ini"></a></dt> <dd><p>A named vector of initial values for the parameters, including parameters to be optimised and potentially also fixed parameters as indicated by <code>fixed_parms</code>. If set to "auto", initial values for @@ -193,7 +157,7 @@ this model. This works nicely if the models are nested. An example is given below.</p></dd> -<dt>state.ini</dt> +<dt id="arg-state-ini">state.ini<a class="anchor" aria-label="anchor" href="#arg-state-ini"></a></dt> <dd><p>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 @@ -204,27 +168,27 @@ others to 0. If this variable has no time zero observations, its initial value is set to 100.</p></dd> -<dt>err.ini</dt> +<dt id="arg-err-ini">err.ini<a class="anchor" aria-label="anchor" href="#arg-err-ini"></a></dt> <dd><p>A named vector of initial values for the error model parameters to be optimised. If set to "auto", initial values are set to default values. Otherwise, inital values for all error model parameters must be given.</p></dd> -<dt>fixed_parms</dt> +<dt id="arg-fixed-parms">fixed_parms<a class="anchor" aria-label="anchor" href="#arg-fixed-parms"></a></dt> <dd><p>The names of parameters that should not be optimised but rather kept at the values specified in <code>parms.ini</code>. Alternatively, a named numeric vector of parameters to be fixed, regardless of the values in parms.ini.</p></dd> -<dt>fixed_initials</dt> +<dt id="arg-fixed-initials">fixed_initials<a class="anchor" aria-label="anchor" href="#arg-fixed-initials"></a></dt> <dd><p>The names of model variables for which the initial state at time 0 should be excluded from the optimisation. Defaults to all state variables except for the first one.</p></dd> -<dt>from_max_mean</dt> +<dt id="arg-from-max-mean">from_max_mean<a class="anchor" aria-label="anchor" href="#arg-from-max-mean"></a></dt> <dd><p>If this is set to TRUE, and the model has only one observed variable, then data before the time of the maximum observed value (after averaging for each sampling time) are discarded, and this time is @@ -232,7 +196,7 @@ subtracted from all remaining time values, so the time of the maximum observed mean value is the new time zero.</p></dd> -<dt>solution_type</dt> +<dt id="arg-solution-type">solution_type<a class="anchor" aria-label="anchor" href="#arg-solution-type"></a></dt> <dd><p>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 @@ -244,23 +208,23 @@ compiler is present, and "eigen" if no compiler is present and the model can be expressed using eigenvalues and eigenvectors.</p></dd> -<dt>method.ode</dt> +<dt id="arg-method-ode">method.ode<a class="anchor" aria-label="anchor" href="#arg-method-ode"></a></dt> <dd><p>The solution method passed via <code><a href="mkinpredict.html">mkinpredict()</a></code> to <code><a href="https://rdrr.io/pkg/deSolve/man/ode.html" class="external-link">deSolve::ode()</a></code> in case the solution type is "deSolve". The default "lsoda" is performant, but sometimes fails to converge.</p></dd> -<dt>use_compiled</dt> +<dt id="arg-use-compiled">use_compiled<a class="anchor" aria-label="anchor" href="#arg-use-compiled"></a></dt> <dd><p>If set to <code>FALSE</code>, no compiled version of the <a href="mkinmod.html">mkinmod</a> model is used in the calls to <code><a href="mkinpredict.html">mkinpredict()</a></code> even if a compiled version is present.</p></dd> -<dt>control</dt> +<dt id="arg-control">control<a class="anchor" aria-label="anchor" href="#arg-control"></a></dt> <dd><p>A list of control arguments passed to <code><a href="https://rdrr.io/r/stats/nlminb.html" class="external-link">stats::nlminb()</a></code>.</p></dd> -<dt>transform_rates</dt> +<dt id="arg-transform-rates">transform_rates<a class="anchor" aria-label="anchor" href="#arg-transform-rates"></a></dt> <dd><p>Boolean specifying if kinetic rate constants should be transformed in the model specification used in the fitting for better compliance with the assumption of normal distribution of the estimator. If @@ -270,7 +234,7 @@ models and the break point tb of the HS model. If FALSE, zero is used as a lower bound for the rates in the optimisation.</p></dd> -<dt>transform_fractions</dt> +<dt id="arg-transform-fractions">transform_fractions<a class="anchor" aria-label="anchor" href="#arg-transform-fractions"></a></dt> <dd><p>Boolean specifying if formation fractions should be transformed in the model specification used in the fitting for better compliance with the assumption of normal distribution of the @@ -279,23 +243,23 @@ the g parameter of the DFOP model is also transformed. Transformations are described in <a href="transform_odeparms.html">transform_odeparms</a>.</p></dd> -<dt>quiet</dt> +<dt id="arg-quiet">quiet<a class="anchor" aria-label="anchor" href="#arg-quiet"></a></dt> <dd><p>Suppress printing out the current value of the negative log-likelihood after each improvement?</p></dd> -<dt>atol</dt> +<dt id="arg-atol">atol<a class="anchor" aria-label="anchor" href="#arg-atol"></a></dt> <dd><p>Absolute error tolerance, passed to <code><a href="https://rdrr.io/pkg/deSolve/man/ode.html" class="external-link">deSolve::ode()</a></code>. Default is 1e-8, which is lower than the default in the <code><a href="https://rdrr.io/pkg/deSolve/man/lsoda.html" class="external-link">deSolve::lsoda()</a></code> function which is used per default.</p></dd> -<dt>rtol</dt> +<dt id="arg-rtol">rtol<a class="anchor" aria-label="anchor" href="#arg-rtol"></a></dt> <dd><p>Absolute error tolerance, passed to <code><a href="https://rdrr.io/pkg/deSolve/man/ode.html" class="external-link">deSolve::ode()</a></code>. Default is 1e-10, much lower than in <code><a href="https://rdrr.io/pkg/deSolve/man/lsoda.html" class="external-link">deSolve::lsoda()</a></code>.</p></dd> -<dt>error_model</dt> +<dt id="arg-error-model">error_model<a class="anchor" aria-label="anchor" href="#arg-error-model"></a></dt> <dd><p>If the error model is "const", a constant standard deviation is assumed.</p> <p>If the error model is "obs", each observed variable is assumed to have its @@ -308,7 +272,7 @@ that the errors follow a lognormal distribution for large values, not a normal distribution as assumed by this method.</p></dd> -<dt>error_model_algorithm</dt> +<dt id="arg-error-model-algorithm">error_model_algorithm<a class="anchor" aria-label="anchor" href="#arg-error-model-algorithm"></a></dt> <dd><p>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 @@ -335,49 +299,47 @@ using those error model parameters, until the error model parameters converge.</p></dd> -<dt>reweight.tol</dt> +<dt id="arg-reweight-tol">reweight.tol<a class="anchor" aria-label="anchor" href="#arg-reweight-tol"></a></dt> <dd><p>Tolerance for the convergence criterion calculated from the error model parameters in IRLS fits.</p></dd> -<dt>reweight.max.iter</dt> +<dt id="arg-reweight-max-iter">reweight.max.iter<a class="anchor" aria-label="anchor" href="#arg-reweight-max-iter"></a></dt> <dd><p>Maximum number of iterations in IRLS fits.</p></dd> -<dt>trace_parms</dt> +<dt id="arg-trace-parms">trace_parms<a class="anchor" aria-label="anchor" href="#arg-trace-parms"></a></dt> <dd><p>Should a trace of the parameter values be listed?</p></dd> -<dt>test_residuals</dt> +<dt id="arg-test-residuals">test_residuals<a class="anchor" aria-label="anchor" href="#arg-test-residuals"></a></dt> <dd><p>Should the residuals be tested for normal distribution?</p></dd> -<dt>...</dt> +<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt> <dd><p>Further arguments that will be passed on to <code><a href="https://rdrr.io/pkg/deSolve/man/ode.html" class="external-link">deSolve::ode()</a></code>.</p></dd> </dl></div> - <div id="value"> - <h2>Value</h2> - - -<p>A list with "mkinfit" in the class attribute.</p> + <div class="section level2"> + <h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2> + <p>A list with "mkinfit" in the class attribute.</p> </div> - <div id="details"> - <h2>Details</h2> + <div class="section level2"> + <h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2> <p>Per default, parameters in the kinetic models are internally transformed in order to better satisfy the assumption of a normal distribution of their estimators.</p> </div> - <div id="note"> - <h2>Note</h2> + <div class="section level2"> + <h2 id="note">Note<a class="anchor" aria-label="anchor" href="#note"></a></h2> <p>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.</p> </div> - <div id="references"> - <h2>References</h2> + <div class="section level2"> + <h2 id="references">References<a class="anchor" aria-label="anchor" href="#references"></a></h2> <p>Rocke DM and Lorenzato S (1995) A two-component model for measurement error in analytical chemistry. <em>Technometrics</em> 37(2), 176-184.</p> <p>Ranke J and Meinecke S (2019) Error Models for the Kinetic Evaluation of Chemical @@ -385,36 +347,36 @@ Degradation Data. <em>Environments</em> 6(12) 124 <a href="https://doi.org/10.3390/environments6120124" class="external-link">doi:10.3390/environments6120124</a> .</p> </div> - <div id="see-also"> - <h2>See also</h2> + <div class="section level2"> + <h2 id="see-also">See also<a class="anchor" aria-label="anchor" href="#see-also"></a></h2> <div class="dont-index"><p><a href="summary.mkinfit.html">summary.mkinfit</a>, <a href="plot.mkinfit.html">plot.mkinfit</a>, <a href="parms.html">parms</a> and <a href="https://rdrr.io/pkg/lmtest/man/lrtest.html" class="external-link">lrtest</a>.</p> <p>Comparisons of models fitted to the same data can be made using <code><a href="https://rdrr.io/r/stats/AIC.html" class="external-link">AIC</a></code> by virtue of the method <code><a href="logLik.mkinfit.html">logLik.mkinfit</a></code>.</p> <p>Fitting of several models to several datasets in a single call to <code><a href="mmkin.html">mmkin</a></code>.</p></div> </div> - <div id="author"> - <h2>Author</h2> + <div class="section level2"> + <h2 id="author">Author<a class="anchor" aria-label="anchor" href="#author"></a></h2> <p>Johannes Ranke</p> </div> - <div id="ref-examples"> - <h2>Examples</h2> + <div class="section level2"> + <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span></span></span> <span class="r-in"><span><span class="co"># Use shorthand notation for parent only degradation</span></span></span> <span class="r-in"><span><span class="va">fit</span> <span class="op"><-</span> <span class="fu">mkinfit</span><span class="op">(</span><span class="st">"FOMC"</span>, <span class="va">FOCUS_2006_C</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span> <span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit</span><span class="op">)</span></span></span> -<span class="r-out co"><span class="r-pr">#></span> mkin version used for fitting: 1.2.6 </span> -<span class="r-out co"><span class="r-pr">#></span> R version used for fitting: 4.3.1 </span> -<span class="r-out co"><span class="r-pr">#></span> Date of fit: Mon Oct 30 09:30:09 2023 </span> -<span class="r-out co"><span class="r-pr">#></span> Date of summary: Mon Oct 30 09:30:09 2023 </span> +<span class="r-out co"><span class="r-pr">#></span> mkin version used for fitting: 1.2.9 </span> +<span class="r-out co"><span class="r-pr">#></span> R version used for fitting: 4.4.2 </span> +<span class="r-out co"><span class="r-pr">#></span> Date of fit: Thu Feb 13 14:56:49 2025 </span> +<span class="r-out co"><span class="r-pr">#></span> Date of summary: Thu Feb 13 14:56:49 2025 </span> <span class="r-out co"><span class="r-pr">#></span> </span> <span class="r-out co"><span class="r-pr">#></span> Equations:</span> <span class="r-out co"><span class="r-pr">#></span> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent</span> <span class="r-out co"><span class="r-pr">#></span> </span> <span class="r-out co"><span class="r-pr">#></span> Model predictions using solution type analytical </span> <span class="r-out co"><span class="r-pr">#></span> </span> -<span class="r-out co"><span class="r-pr">#></span> Fitted using 222 model solutions performed in 0.031 s</span> +<span class="r-out co"><span class="r-pr">#></span> Fitted using 222 model solutions performed in 0.014 s</span> <span class="r-out co"><span class="r-pr">#></span> </span> <span class="r-out co"><span class="r-pr">#></span> Error model: Constant variance </span> <span class="r-out co"><span class="r-pr">#></span> </span> @@ -555,9 +517,9 @@ Degradation Data. <em>Environments</em> 6(12) 124 <span class="r-in"><span> solution_type <span class="op">=</span> <span class="st">"analytical"</span><span class="op">)</span><span class="op">)</span></span></span> <span class="r-in"><span><span class="op">}</span></span></span> <span class="r-out co"><span class="r-pr">#></span> test relative elapsed</span> -<span class="r-out co"><span class="r-pr">#></span> 3 analytical 1.000 0.465</span> -<span class="r-out co"><span class="r-pr">#></span> 2 eigen 2.260 1.051</span> -<span class="r-out co"><span class="r-pr">#></span> 1 deSolve_compiled 2.282 1.061</span> +<span class="r-out co"><span class="r-pr">#></span> 3 analytical 1.000 0.227</span> +<span class="r-out co"><span class="r-pr">#></span> 2 eigen 1.930 0.438</span> +<span class="r-out co"><span class="r-pr">#></span> 1 deSolve_compiled 1.991 0.452</span> <span class="r-in"><span><span class="co"># }</span></span></span> <span class="r-in"><span></span></span> <span class="r-in"><span><span class="co"># Use stepwise fitting, using optimised parameters from parent only fit, FOMC-SFO</span></span></span> @@ -582,12 +544,11 @@ Degradation Data. <em>Environments</em> 6(12) 124 <span class="r-in"><span><span class="co"># and beta indicate overparameterisation</span></span></span> <span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="va">fit.FOMC_SFO.tc</span>, data <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></span></span> <span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>NaNs produced</span> -<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>NaNs produced</span> -<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>diag(.) had 0 or NA entries; non-finite result is doubtful</span> -<span class="r-out co"><span class="r-pr">#></span> mkin version used for fitting: 1.2.6 </span> -<span class="r-out co"><span class="r-pr">#></span> R version used for fitting: 4.3.1 </span> -<span class="r-out co"><span class="r-pr">#></span> Date of fit: Mon Oct 30 09:30:19 2023 </span> -<span class="r-out co"><span class="r-pr">#></span> Date of summary: Mon Oct 30 09:30:19 2023 </span> +<span class="r-wrn co"><span class="r-pr">#></span> <span class="warning">Warning: </span>diag(V) had non-positive or NA entries; the non-finite result may be dubious</span> +<span class="r-out co"><span class="r-pr">#></span> mkin version used for fitting: 1.2.9 </span> +<span class="r-out co"><span class="r-pr">#></span> R version used for fitting: 4.4.2 </span> +<span class="r-out co"><span class="r-pr">#></span> Date of fit: Thu Feb 13 14:56:53 2025 </span> +<span class="r-out co"><span class="r-pr">#></span> Date of summary: Thu Feb 13 14:56:53 2025 </span> <span class="r-out co"><span class="r-pr">#></span> </span> <span class="r-out co"><span class="r-pr">#></span> Equations:</span> <span class="r-out co"><span class="r-pr">#></span> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent</span> @@ -596,7 +557,7 @@ Degradation Data. <em>Environments</em> 6(12) 124 <span class="r-out co"><span class="r-pr">#></span> </span> <span class="r-out co"><span class="r-pr">#></span> Model predictions using solution type deSolve </span> <span class="r-out co"><span class="r-pr">#></span> </span> -<span class="r-out co"><span class="r-pr">#></span> Fitted using 4062 model solutions performed in 1.981 s</span> +<span class="r-out co"><span class="r-pr">#></span> Fitted using 4062 model solutions performed in 0.751 s</span> <span class="r-out co"><span class="r-pr">#></span> </span> <span class="r-out co"><span class="r-pr">#></span> Error model: Two-component variance function </span> <span class="r-out co"><span class="r-pr">#></span> </span> @@ -696,27 +657,23 @@ Degradation Data. <em>Environments</em> 6(12) 124 <span class="r-in"><span><span class="co"># }</span></span></span> </code></pre></div> </div> - </div> - <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> - <nav id="toc" data-toggle="toc" class="sticky-top"><h2 data-toc-skip>Contents</h2> - </nav></div> -</div> + </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2> + </nav></aside></div> - <footer><div class="copyright"> - <p></p><p>Developed by Johannes Ranke.</p> + <footer><div class="pkgdown-footer-left"> + <p>Developed by Johannes Ranke.</p> </div> -<div class="pkgdown"> - <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p> +<div class="pkgdown-footer-right"> + <p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.1.1.</p> </div> - </footer></div> + </footer></div> + - - </body></html> |