diff options
Diffstat (limited to 'docs/dev/reference')
-rw-r--r-- | docs/dev/reference/Rplot001.png | bin | 14180 -> 19395 bytes | |||
-rw-r--r-- | docs/dev/reference/Rplot002.png | bin | 13753 -> 16843 bytes | |||
-rw-r--r-- | docs/dev/reference/Rplot005.png | bin | 56740 -> 57095 bytes | |||
-rw-r--r-- | docs/dev/reference/index.html | 6 | ||||
-rw-r--r-- | docs/dev/reference/mixed-1.png | bin | 0 -> 206373 bytes | |||
-rw-r--r-- | docs/dev/reference/mixed.html | 279 | ||||
-rw-r--r-- | docs/dev/reference/mkinmod.html | 8 | ||||
-rw-r--r-- | docs/dev/reference/nlme.mmkin-1.png | bin | 122068 -> 119655 bytes | |||
-rw-r--r-- | docs/dev/reference/nlme.mmkin-2.png | bin | 160690 -> 159253 bytes | |||
-rw-r--r-- | docs/dev/reference/nlme.mmkin.html | 106 | ||||
-rw-r--r-- | docs/dev/reference/plot.mixed.mmkin-2.png | bin | 163684 -> 164488 bytes | |||
-rw-r--r-- | docs/dev/reference/plot.mixed.mmkin-3.png | bin | 162677 -> 163488 bytes | |||
-rw-r--r-- | docs/dev/reference/plot.mixed.mmkin.html | 8 | ||||
-rw-r--r-- | docs/dev/reference/saem-5.png | bin | 163636 -> 164443 bytes | |||
-rw-r--r-- | docs/dev/reference/saem.html | 127 |
15 files changed, 399 insertions, 135 deletions
diff --git a/docs/dev/reference/Rplot001.png b/docs/dev/reference/Rplot001.png Binary files differindex ae5db971..bca41e2c 100644 --- a/docs/dev/reference/Rplot001.png +++ b/docs/dev/reference/Rplot001.png diff --git a/docs/dev/reference/Rplot002.png b/docs/dev/reference/Rplot002.png Binary files differindex 51e51cf4..9b97a634 100644 --- a/docs/dev/reference/Rplot002.png +++ b/docs/dev/reference/Rplot002.png diff --git a/docs/dev/reference/Rplot005.png b/docs/dev/reference/Rplot005.png Binary files differindex 91c7777b..5e675828 100644 --- a/docs/dev/reference/Rplot005.png +++ b/docs/dev/reference/Rplot005.png diff --git a/docs/dev/reference/index.html b/docs/dev/reference/index.html index cb37f9a6..5c964cf9 100644 --- a/docs/dev/reference/index.html +++ b/docs/dev/reference/index.html @@ -358,6 +358,12 @@ of an mmkin object</p></td> <p><code><a href="get_deg_func.html">get_deg_func()</a></code> </p> </td> <td><p>Retrieve a degradation function from the mmkin namespace</p></td> + </tr><tr> + + <td> + <p><code><a href="mixed.html">mixed()</a></code> <code><a href="mixed.html">print(<i><mixed.mmkin></i>)</a></code> </p> + </td> + <td><p>Create a mixed effects model from an mmkin row object</p></td> </tr> </tbody><tbody> <tr> diff --git a/docs/dev/reference/mixed-1.png b/docs/dev/reference/mixed-1.png Binary files differnew file mode 100644 index 00000000..3400c4aa --- /dev/null +++ b/docs/dev/reference/mixed-1.png diff --git a/docs/dev/reference/mixed.html b/docs/dev/reference/mixed.html new file mode 100644 index 00000000..18a67af8 --- /dev/null +++ b/docs/dev/reference/mixed.html @@ -0,0 +1,279 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <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>Create a mixed effects model from an mmkin row object — mixed • 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="Create a mixed effects model from an mmkin row object — mixed" /> +<meta property="og:description" content="Create a mixed effects model from an mmkin row object" /> + + +<meta name="robots" content="noindex"> + +<!-- 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-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.9.50.4</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" 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> + <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> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </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> + <li> + <a href="../articles/web_only/benchmarks.html">Some benchmark timings</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/"> + <span class="fab fa 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>Create a mixed effects model from an mmkin row object</h1> + <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/mixed.mmkin.R'><code>R/mixed.mmkin.R</code></a></small> + <div class="hidden name"><code>mixed.Rd</code></div> + </div> + + <div class="ref-description"> + <p>Create a mixed effects model from an mmkin row object</p> + </div> + + <pre class="usage"><span class='fu'>mixed</span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span> + +<span class='co'># S3 method for mmkin</span> +<span class='fu'>mixed</span><span class='op'>(</span><span class='va'>object</span>, method <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"none"</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span> + +<span class='co'># S3 method for mixed.mmkin</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, digits <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Extremes.html'>max</a></span><span class='op'>(</span><span class='fl'>3</span>, <span class='fu'><a href='https://rdrr.io/r/base/options.html'>getOption</a></span><span class='op'>(</span><span class='st'>"digits"</span><span class='op'>)</span> <span class='op'>-</span> <span class='fl'>3</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span></pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>object</th> + <td><p>An <a href='mmkin.html'>mmkin</a> row object</p></td> + </tr> + <tr> + <th>...</th> + <td><p>Currently not used</p></td> + </tr> + <tr> + <th>method</th> + <td><p>The method to be used</p></td> + </tr> + <tr> + <th>x</th> + <td><p>A mixed.mmkin object to print</p></td> + </tr> + <tr> + <th>digits</th> + <td><p>Number of digits to use for printing.</p></td> + </tr> + </table> + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='va'>sampling_times</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>3</span>, <span class='fl'>7</span>, <span class='fl'>14</span>, <span class='fl'>28</span>, <span class='fl'>60</span>, <span class='fl'>90</span>, <span class='fl'>120</span><span class='op'>)</span> +<span class='va'>n_biphasic</span> <span class='op'><-</span> <span class='fl'>8</span> +<span class='va'>err_1</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>const <span class='op'>=</span> <span class='fl'>1</span>, prop <span class='op'>=</span> <span class='fl'>0.07</span><span class='op'>)</span> + +<span class='va'>DFOP_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span> + parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, + m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, + quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + +<span class='fu'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span><span class='op'>(</span><span class='fl'>123456</span><span class='op'>)</span> +<span class='va'>log_sd</span> <span class='op'><-</span> <span class='fl'>0.3</span> +<span class='va'>syn_biphasic_parms</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/matrix.html'>as.matrix</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></span><span class='op'>(</span> + k1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/stats/Lognormal.html'>rlnorm</a></span><span class='op'>(</span><span class='va'>n_biphasic</span>, <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span><span class='op'>(</span><span class='fl'>0.05</span><span class='op'>)</span>, <span class='va'>log_sd</span><span class='op'>)</span>, + k2 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/stats/Lognormal.html'>rlnorm</a></span><span class='op'>(</span><span class='va'>n_biphasic</span>, <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span><span class='op'>(</span><span class='fl'>0.01</span><span class='op'>)</span>, <span class='va'>log_sd</span><span class='op'>)</span>, + g <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/stats/Logistic.html'>plogis</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span><span class='op'>(</span><span class='va'>n_biphasic</span>, <span class='fl'>0</span>, <span class='va'>log_sd</span><span class='op'>)</span><span class='op'>)</span>, + f_parent_to_m1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/stats/Logistic.html'>plogis</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span><span class='op'>(</span><span class='va'>n_biphasic</span>, <span class='fl'>0</span>, <span class='va'>log_sd</span><span class='op'>)</span><span class='op'>)</span>, + k_m1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/stats/Lognormal.html'>rlnorm</a></span><span class='op'>(</span><span class='va'>n_biphasic</span>, <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span><span class='op'>(</span><span class='fl'>0.002</span><span class='op'>)</span>, <span class='va'>log_sd</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span> + +<span class='va'>ds_biphasic_mean</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='fl'>1</span><span class='op'>:</span><span class='va'>n_biphasic</span>, + <span class='kw'>function</span><span class='op'>(</span><span class='va'>i</span><span class='op'>)</span> <span class='op'>{</span> + <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span><span class='op'>(</span><span class='va'>DFOP_SFO</span>, <span class='va'>syn_biphasic_parms</span><span class='op'>[</span><span class='va'>i</span>, <span class='op'>]</span>, + <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fl'>100</span>, m1 <span class='op'>=</span> <span class='fl'>0</span><span class='op'>)</span>, <span class='va'>sampling_times</span><span class='op'>)</span> + <span class='op'>}</span> +<span class='op'>)</span> + +<span class='fu'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span><span class='op'>(</span><span class='fl'>123456L</span><span class='op'>)</span> +<span class='va'>ds_biphasic</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>ds_biphasic_mean</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>ds</span><span class='op'>)</span> <span class='op'>{</span> + <span class='fu'><a href='add_err.html'>add_err</a></span><span class='op'>(</span><span class='va'>ds</span>, + sdfunc <span class='op'>=</span> <span class='kw'>function</span><span class='op'>(</span><span class='va'>value</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>sqrt</a></span><span class='op'>(</span><span class='va'>err_1</span><span class='op'>$</span><span class='va'>const</span><span class='op'>^</span><span class='fl'>2</span> <span class='op'>+</span> <span class='va'>value</span><span class='op'>^</span><span class='fl'>2</span> <span class='op'>*</span> <span class='va'>err_1</span><span class='op'>$</span><span class='va'>prop</span><span class='op'>^</span><span class='fl'>2</span><span class='op'>)</span>, + n <span class='op'>=</span> <span class='fl'>1</span>, secondary <span class='op'>=</span> <span class='st'>"m1"</span><span class='op'>)</span><span class='op'>[[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>]</span> +<span class='op'>}</span><span class='op'>)</span> + +<span class='co'># \dontrun{</span> +<span class='va'>f_mmkin</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>DFOP_SFO</span><span class='op'>)</span>, <span class='va'>ds_biphasic</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> + +<span class='va'>f_mixed</span> <span class='op'><-</span> <span class='fu'>mixed</span><span class='op'>(</span><span class='va'>f_mmkin</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_mixed</span><span class='op'>)</span> +</div><div class='output co'>#> Kinetic model fitted by nonlinear regression to each dataset +#> Structural model: +#> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * +#> time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time))) +#> * parent +#> d_m1/dt = + f_parent_to_m1 * ((k1 * g * exp(-k1 * time) + k2 * (1 - g) +#> * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) * +#> exp(-k2 * time))) * parent - k_m1 * m1 +#> +#> Data: +#> 271 observations of 2 variable(s) grouped in 8 datasets +#> +#> <mmkin> object +#> Status of individual fits: +#> +#> dataset +#> model 1 2 3 4 5 6 7 8 +#> DFOP-SFO OK OK OK OK OK C OK OK +#> +#> OK: No warnings +#> C: Optimisation did not converge: +#> iteration limit reached without convergence (10) +#> +#> Mean fitted parameters: +#> parent_0 log_k_m1 f_parent_qlogis log_k1 log_k2 +#> 100.606304 -8.759216 -0.002001 -3.350539 -3.989549 +#> g_qlogis +#> -0.090353 </div><div class='input'><span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_mixed</span><span class='op'>)</span> +</div><div class='img'><img src='mixed-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># }</span> +</div></pre> + </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> + + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> +</div> + + </footer> + </div> + + + + + </body> +</html> + + diff --git a/docs/dev/reference/mkinmod.html b/docs/dev/reference/mkinmod.html index 9e37e664..9a7dac6f 100644 --- a/docs/dev/reference/mkinmod.html +++ b/docs/dev/reference/mkinmod.html @@ -201,8 +201,8 @@ In print.mkinmod, this argument is currently not used.</p></td> <td><p>Specification of the use of formation fractions in the model equations and, if applicable, the coefficient matrix. If "max", formation fractions are always used (default). If "min", a minimum use of -formation fractions is made, i.e. each pathway to a metabolite has its -own rate constant.</p></td> +formation fractions is made, i.e. each first-order pathway to a metabolite +has its own rate constant.</p></td> </tr> <tr> <th>name</th> @@ -348,7 +348,7 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media</p> parent <span class='op'>=</span> <span class='fu'>mkinsub</span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span>, full_name <span class='op'>=</span> <span class='st'>"Test compound"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'>mkinsub</span><span class='op'>(</span><span class='st'>"SFO"</span>, full_name <span class='op'>=</span> <span class='st'>"Metabolite M1"</span><span class='op'>)</span>, name <span class='op'>=</span> <span class='st'>"SFO_SFO"</span>, dll_dir <span class='op'>=</span> <span class='va'>DLL_dir</span>, unload <span class='op'>=</span> <span class='cn'>TRUE</span>, overwrite <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Copied DLL from /tmp/RtmpX9Xf3y/file6d622f3b7e08.so to /home/jranke/.local/share/mkin/SFO_SFO.so</span></div><div class='input'><span class='co'># Now we can save the model and restore it in a new session</span> +</div><div class='output co'>#> <span class='message'>Copied DLL from /tmp/Rtmpy4eiQb/file554e573761a7.so to /home/jranke/.local/share/mkin/SFO_SFO.so</span></div><div class='input'><span class='co'># Now we can save the model and restore it in a new session</span> <span class='fu'><a href='https://rdrr.io/r/base/readRDS.html'>saveRDS</a></span><span class='op'>(</span><span class='va'>SFO_SFO.2</span>, file <span class='op'>=</span> <span class='st'>"~/SFO_SFO.rds"</span><span class='op'>)</span> <span class='co'># Terminate the R session here if you would like to check, and then do</span> <span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://pkgdown.jrwb.de/mkin/'>mkin</a></span><span class='op'>)</span> @@ -397,7 +397,7 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media</p> #> }) #> return(predicted) #> } -#> <environment: 0x55555c5b8d68></div><div class='input'> +#> <environment: 0x55555cac8d00></div><div class='input'> <span class='co'># If we have several parallel metabolites</span> <span class='co'># (compare tests/testthat/test_synthetic_data_for_UBA_2014.R)</span> <span class='va'>m_synth_DFOP_par</span> <span class='op'><-</span> <span class='fu'>mkinmod</span><span class='op'>(</span> diff --git a/docs/dev/reference/nlme.mmkin-1.png b/docs/dev/reference/nlme.mmkin-1.png Binary files differindex d760e8f9..25bebeca 100644 --- a/docs/dev/reference/nlme.mmkin-1.png +++ b/docs/dev/reference/nlme.mmkin-1.png diff --git a/docs/dev/reference/nlme.mmkin-2.png b/docs/dev/reference/nlme.mmkin-2.png Binary files differindex c7085b81..c314c149 100644 --- a/docs/dev/reference/nlme.mmkin-2.png +++ b/docs/dev/reference/nlme.mmkin-2.png diff --git a/docs/dev/reference/nlme.mmkin.html b/docs/dev/reference/nlme.mmkin.html index 6d9f2007..a4d7070a 100644 --- a/docs/dev/reference/nlme.mmkin.html +++ b/docs/dev/reference/nlme.mmkin.html @@ -154,11 +154,12 @@ have been obtained by fitting the same model to a list of datasets.</p> <pre class="usage"><span class='co'># S3 method for mmkin</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span> <span class='va'>model</span>, - data <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/sys.parent.html'>sys.frame</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/sys.parent.html'>sys.parent</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span>, - <span class='va'>fixed</span>, - random <span class='op'>=</span> <span class='va'>fixed</span>, + data <span class='op'>=</span> <span class='st'>"auto"</span>, + fixed <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>as.list</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='fu'><a href='nlme_function.html'>mean_degparms</a></span><span class='op'>(</span><span class='va'>model</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>el</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/eval.html'>eval</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/parse.html'>parse</a></span><span class='op'>(</span>text <span class='op'>=</span> + <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='va'>el</span>, <span class='fl'>1</span>, sep <span class='op'>=</span> <span class='st'>"~"</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span>, + random <span class='op'>=</span> <span class='fu'>pdDiag</span><span class='op'>(</span><span class='va'>fixed</span><span class='op'>)</span>, <span class='va'>groups</span>, - <span class='va'>start</span>, + start <span class='op'>=</span> <span class='fu'><a href='nlme_function.html'>mean_degparms</a></span><span class='op'>(</span><span class='va'>model</span>, random <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>, correlation <span class='op'>=</span> <span class='cn'>NULL</span>, weights <span class='op'>=</span> <span class='cn'>NULL</span>, <span class='va'>subset</span>, @@ -276,14 +277,14 @@ methods that will automatically work on 'nlme.mmkin' objects, such as <span class='va'>f</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, cores <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span> <span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://svn.r-project.org/R-packages/trunk/nlme/'>nlme</a></span><span class='op'>)</span> <span class='va'>f_nlme_sfo</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>[</span><span class='st'>"SFO"</span>, <span class='op'>]</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Iteration 1, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='input'> + <span class='co'># \dontrun{</span> <span class='va'>f_nlme_dfop</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>[</span><span class='st'>"DFOP"</span>, <span class='op'>]</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo</span>, <span class='va'>f_nlme_dfop</span><span class='op'>)</span> </div><div class='output co'>#> Model df AIC BIC logLik Test L.Ratio p-value -#> f_nlme_sfo 1 6 622.0677 637.0666 -305.0338 -#> f_nlme_dfop 2 15 487.0134 524.5105 -228.5067 1 vs 2 153.0543 <.0001</div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop</span><span class='op'>)</span> +#> f_nlme_sfo 1 5 625.0539 637.5529 -307.5269 +#> f_nlme_dfop 2 9 495.1270 517.6253 -238.5635 1 vs 2 137.9268 <.0001</div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop</span><span class='op'>)</span> </div><div class='output co'>#> Kinetic nonlinear mixed-effects model fit by maximum likelihood #> #> Structural model: @@ -294,28 +295,24 @@ methods that will automatically work on 'nlme.mmkin' objects, such as #> Data: #> 90 observations of 1 variable(s) grouped in 5 datasets #> -#> Log-likelihood: -228.5067 +#> Log-likelihood: -238.6 #> #> Fixed effects: #> list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1) #> parent_0 log_k1 log_k2 g_qlogis -#> 94.18273 -1.82135 -4.16872 0.08949 +#> 94.1702 -1.8002 -4.1474 0.0324 #> #> Random effects: #> Formula: list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1) #> Level: ds -#> Structure: General positive-definite, Log-Cholesky parametrization -#> StdDev Corr -#> parent_0 2.4656397 prnt_0 log_k1 log_k2 -#> log_k1 0.7950788 0.240 -#> log_k2 1.2605419 0.150 0.984 -#> g_qlogis 0.5013272 -0.075 0.843 0.834 -#> Residual 2.3308100 +#> Structure: Diagonal +#> parent_0 log_k1 log_k2 g_qlogis Residual +#> StdDev: 2.488 0.8447 1.33 0.4652 2.321 #> </div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop</span><span class='op'>)</span> </div><div class='img'><img src='nlme.mmkin-1.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop</span><span class='op'>)</span> </div><div class='output co'>#> $distimes #> DT50 DT90 DT50back DT50_k1 DT50_k2 -#> parent 10.57119 101.0652 30.42366 4.283776 44.80015 +#> parent 10.79857 100.7937 30.34192 4.193937 43.85442 #> </div><div class='input'> <span class='va'>ds_2</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>experimental_data_for_UBA_2019</span><span class='op'>[</span><span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>]</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>[</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"name"</span>, <span class='st'>"time"</span>, <span class='st'>"value"</span><span class='op'>)</span><span class='op'>]</span><span class='op'>)</span> @@ -332,7 +329,7 @@ methods that will automatically work on 'nlme.mmkin' objects, such as <span class='va'>ds_2</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='va'>f_nlme_sfo_sfo</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Iteration 1, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 2, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span> + <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span> </div><div class='img'><img src='nlme.mmkin-2.png' alt='' width='700' height='433' /></div><div class='input'> <span class='co'># With formation fractions this does not coverge with defaults</span> <span class='co'># f_nlme_sfo_sfo_ff <- nlme(f_2["SFO-SFO-ff", ])</span> @@ -343,32 +340,22 @@ methods that will automatically work on 'nlme.mmkin' objects, such as <span class='co'># parameters (with pdDiag, increasing the tolerance and pnlsMaxIter was</span> <span class='co'># necessary)</span> <span class='va'>f_nlme_dfop_sfo</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Iteration 1, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 2, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 3, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 4, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='input'> +</div><div class='output co'>#> <span class='error'>Error in nlme.formula(model = value ~ (mkin::get_deg_func())(name, time, parent_0, log_k_A1, f_parent_qlogis, log_k1, log_k2, g_qlogis), data = structure(list(ds = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L ), .Label = c("1", "2", "3", "4", "5"), class = c("ordered", "factor")), name = c("parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1"), time = c(0, 0, 3, 3, 6, 6, 10, 10, 20, 20, 34, 34, 55, 55, 90, 90, 112, 112, 132, 132, 3, 3, 6, 6, 10, 10, 20, 20, 34, 34, 55, 55, 90, 90, 112, 112, 132, 132, 0, 0, 3, 3, 7, 7, 14, 14, 30, 30, 60, 60, 90, 90, 120, 120, 180, 180, 3, 3, 7, 7, 14, 14, 30, 30, 60, 60, 90, 90, 120, 120, 180, 180, 0, 0, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 0, 0, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 91, 91, 120, 120, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 91, 91, 120, 120, 0, 0, 8, 8, 14, 14, 21, 21, 41, 41, 63, 63, 91, 91, 120, 120, 8, 8, 14, 14, 21, 21, 41, 41, 63, 63, 91, 91, 120, 120), value = c(97.2, 96.4, 71.1, 69.2, 58.1, 56.6, 44.4, 43.4, 33.3, 29.2, 17.6, 18, 10.5, 9.3, 4.5, 4.7, 3, 3.4, 2.3, 2.7, 4.3, 4.6, 7, 7.2, 8.2, 8, 11, 13.7, 11.5, 12.7, 14.9, 14.5, 12.1, 12.3, 9.9, 10.2, 8.8, 7.8, 93.6, 92.3, 87, 82.2, 74, 73.9, 64.2, 69.5, 54, 54.6, 41.1, 38.4, 32.5, 35.5, 28.1, 29, 26.5, 27.6, 3.9, 3.1, 6.9, 6.6, 10.4, 8.3, 14.4, 13.7, 22.1, 22.3, 27.5, 25.4, 28, 26.6, 25.8, 25.3, 91.9, 90.8, 64.9, 66.2, 43.5, 44.1, 18.3, 18.1, 10.2, 10.8, 4.9, 3.3, 1.6, 1.5, 1.1, 0.9, 9.6, 7.7, 15, 15.1, 21.2, 21.1, 19.7, 18.9, 17.5, 15.9, 9.5, 9.8, 6.2, 6.1, 99.8, 98.3, 77.1, 77.2, 59, 58.1, 27.4, 29.2, 19.1, 29.6, 10.1, 18.2, 4.5, 9.1, 2.3, 2.9, 2, 1.8, 2, 2.2, 4.2, 3.9, 7.4, 7.9, 14.5, 13.7, 14.2, 12.2, 13.7, 13.2, 13.6, 15.4, 10.4, 11.6, 10, 9.5, 9.1, 9, 96.1, 94.3, 73.9, 73.9, 69.4, 73.1, 65.6, 65.3, 55.9, 54.4, 47, 49.3, 44.7, 46.7, 42.1, 41.3, 3.3, 3.4, 3.9, 2.9, 6.4, 7.2, 9.1, 8.5, 11.7, 12, 13.3, 13.2, 14.3, 12.1)), row.names = c(NA, -170L), class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), formula = value ~ time | ds, FUN = function (x) max(x, na.rm = TRUE), order.groups = FALSE), start = list( fixed = c(parent_0 = 93.8101519326534, log_k_A1 = -9.76474551635931, f_parent_qlogis = -0.971114801595408, log_k1 = -1.87993711571859, log_k2 = -4.27081421366622, g_qlogis = 0.135644115277507 ), random = list(ds = structure(c(2.56569977430371, -3.49441920289139, -3.32614443321494, 4.35347873814922, -0.0986148763466161, 4.65850590018027, 1.8618544764481, 6.12693257601545, 4.91792724701579, -17.5652201996596, -0.466203822618637, 0.746660653597927, 0.282193987271096, -0.42053488943072, -0.142115928819667, 0.369240076779088, -1.38985563501659, 1.02592753494098, 0.73090914081534, -0.736221117518819, 0.768170629350299, -1.89347658079869, 1.72168783460352, 0.844607177798114, -1.44098906095325, -0.377731855445672, 0.168180098477565, 0.469683412912104, 0.500717664434525, -0.760849320378522), .Dim = 5:6, .Dimnames = list(c("1", "2", "3", "4", "5"), c("parent_0", "log_k_A1", "f_parent_qlogis", "log_k1", "log_k2", "g_qlogis"))))), fixed = list(parent_0 ~ 1, log_k_A1 ~ 1, f_parent_qlogis ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1), random = structure(numeric(0), class = c("pdDiag", "pdMat"), formula = structure(list(parent_0 ~ 1, log_k_A1 ~ 1, f_parent_qlogis ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1), class = "listForm"), Dimnames = list(NULL, NULL))): maximum number of iterations (maxIter = 50) reached without convergence</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 49.95 16.5 44.08</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span><span class='op'>)</span> -</div><div class='img'><img src='nlme.mmkin-3.png' alt='' width='700' height='433' /></div><div class='input'> +</div><div class='output co'>#> <span class='error'>Error in plot(f_nlme_dfop_sfo): object 'f_nlme_dfop_sfo' not found</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span> -</div><div class='output co'>#> Model df AIC BIC logLik Test L.Ratio p-value -#> f_nlme_dfop_sfo 1 28 811.7199 899.5222 -377.8599 -#> f_nlme_sfo_sfo 2 15 1075.1934 1122.2304 -522.5967 1 vs 2 289.4736 <.0001</div><div class='input'> +</div><div class='output co'>#> <span class='error'>Error in anova(f_nlme_dfop_sfo, f_nlme_sfo_sfo): object 'f_nlme_dfop_sfo' not found</span></div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span> </div><div class='output co'>#> $ff #> parent_sink parent_A1 A1_sink -#> 0.6512742 0.3487258 1.0000000 +#> 0.5912432 0.4087568 1.0000000 #> #> $distimes -#> DT50 DT90 -#> parent 18.03144 59.89916 -#> A1 102.72949 341.25997 +#> DT50 DT90 +#> parent 19.13518 63.5657 +#> A1 66.02155 219.3189 #> </div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span><span class='op'>)</span> -</div><div class='output co'>#> $ff -#> parent_A1 parent_sink -#> 0.2762167 0.7237833 -#> -#> $distimes -#> DT50 DT90 DT50back DT50_k1 DT50_k2 -#> parent 11.15024 133.9652 40.32755 4.688015 62.16017 -#> A1 235.83191 783.4167 NA NA NA -#> </div><div class='input'> +</div><div class='output co'>#> <span class='error'>Error in endpoints(f_nlme_dfop_sfo): object 'f_nlme_dfop_sfo' not found</span></div><div class='input'> <span class='kw'>if</span> <span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='fu'>findFunction</span><span class='op'>(</span><span class='st'>"varConstProp"</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>></span> <span class='fl'>0</span><span class='op'>)</span> <span class='op'>{</span> <span class='co'># tc error model for nlme available</span> <span class='co'># Attempts to fit metabolite kinetics with the tc error model are possible,</span> <span class='co'># but need tweeking of control values and sometimes do not converge</span> @@ -379,7 +366,7 @@ methods that will automatically work on 'nlme.mmkin' objects, such as <span class='fu'><a href='https://rdrr.io/r/stats/AIC.html'>AIC</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo</span>, <span class='va'>f_nlme_sfo_tc</span>, <span class='va'>f_nlme_dfop</span>, <span class='va'>f_nlme_dfop_tc</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_tc</span><span class='op'>)</span> <span class='op'>}</span> -</div><div class='output co'>#> <span class='warning'>Warning: Iteration 1, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 14, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 1, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 2, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 4, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 5, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 6, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 7, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 8, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 9, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 10, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 11, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 12, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 14, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 15, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 16, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 17, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 18, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> Kinetic nonlinear mixed-effects model fit by maximum likelihood +</div><div class='output co'>#> Kinetic nonlinear mixed-effects model fit by maximum likelihood #> #> Structural model: #> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * @@ -389,35 +376,31 @@ methods that will automatically work on 'nlme.mmkin' objects, such as #> Data: #> 90 observations of 1 variable(s) grouped in 5 datasets #> -#> Log-likelihood: -228.3575 +#> Log-likelihood: -238.4 #> #> Fixed effects: #> list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1) #> parent_0 log_k1 log_k2 g_qlogis -#> 93.6695 -1.9187 -4.4253 0.2215 +#> 94.04775 -1.82340 -4.16715 0.05685 #> #> Random effects: #> Formula: list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1) #> Level: ds -#> Structure: General positive-definite, Log-Cholesky parametrization -#> StdDev Corr -#> parent_0 2.8574651 prnt_0 log_k1 log_k2 -#> log_k1 0.9689083 0.506 -#> log_k2 1.5798002 0.446 0.997 -#> g_qlogis 0.5761569 -0.457 0.247 0.263 -#> Residual 1.0000000 +#> Structure: Diagonal +#> parent_0 log_k1 log_k2 g_qlogis Residual +#> StdDev: 2.474 0.85 1.337 0.4659 1 #> #> Variance function: #> Structure: Constant plus proportion of variance covariate #> Formula: ~fitted(.) #> Parameter estimates: -#> const prop -#> 2.0376990 0.0221686 </div><div class='input'> +#> const prop +#> 2.23224114 0.01262341 </div><div class='input'> <span class='va'>f_2_obs</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"SFO-SFO"</span> <span class='op'>=</span> <span class='va'>m_sfo_sfo</span>, <span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>m_dfop_sfo</span><span class='op'>)</span>, <span class='va'>ds_2</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"obs"</span><span class='op'>)</span> <span class='va'>f_nlme_sfo_sfo_obs</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2_obs</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Iteration 1, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo_obs</span><span class='op'>)</span> + <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo_obs</span><span class='op'>)</span> </div><div class='output co'>#> Kinetic nonlinear mixed-effects model fit by maximum likelihood #> #> Structural model: @@ -427,44 +410,37 @@ methods that will automatically work on 'nlme.mmkin' objects, such as #> Data: #> 170 observations of 2 variable(s) grouped in 5 datasets #> -#> Log-likelihood: -462.2203 +#> Log-likelihood: -473 #> #> Fixed effects: #> list(parent_0 ~ 1, log_k_parent_sink ~ 1, log_k_parent_A1 ~ 1, log_k_A1_sink ~ 1) #> parent_0 log_k_parent_sink log_k_parent_A1 log_k_A1_sink -#> 88.682 -3.664 -4.164 -4.665 +#> 87.976 -3.670 -4.164 -4.645 #> #> Random effects: #> Formula: list(parent_0 ~ 1, log_k_parent_sink ~ 1, log_k_parent_A1 ~ 1, log_k_A1_sink ~ 1) #> Level: ds -#> Structure: General positive-definite, Log-Cholesky parametrization -#> StdDev Corr -#> parent_0 4.9153305 prnt_0 lg_k__ l___A1 -#> log_k_parent_sink 1.8158570 0.956 -#> log_k_parent_A1 1.0514548 0.821 0.907 -#> log_k_A1_sink 0.4924122 0.035 0.315 0.533 -#> Residual 6.3987599 +#> Structure: Diagonal +#> parent_0 log_k_parent_sink log_k_parent_A1 log_k_A1_sink Residual +#> StdDev: 3.992 1.777 1.055 0.4821 6.483 #> #> Variance function: #> Structure: Different standard deviations per stratum #> Formula: ~1 | name #> Parameter estimates: #> parent A1 -#> 1.0000000 0.2040647 </div><div class='input'> <span class='va'>f_nlme_dfop_sfo_obs</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2_obs</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Iteration 1, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 2, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 3, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 4, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='input'> +#> 1.0000000 0.2050003 </div><div class='input'> <span class='va'>f_nlme_dfop_sfo_obs</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2_obs</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='error'>Error in nlme.formula(model = value ~ (mkin::get_deg_func())(name, time, parent_0, log_k_A1, f_parent_qlogis, log_k1, log_k2, g_qlogis), data = structure(list(ds = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L ), .Label = c("1", "2", "3", "4", "5"), class = c("ordered", "factor")), name = c("parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "parent", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1"), time = c(0, 0, 3, 3, 6, 6, 10, 10, 20, 20, 34, 34, 55, 55, 90, 90, 112, 112, 132, 132, 3, 3, 6, 6, 10, 10, 20, 20, 34, 34, 55, 55, 90, 90, 112, 112, 132, 132, 0, 0, 3, 3, 7, 7, 14, 14, 30, 30, 60, 60, 90, 90, 120, 120, 180, 180, 3, 3, 7, 7, 14, 14, 30, 30, 60, 60, 90, 90, 120, 120, 180, 180, 0, 0, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 0, 0, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 91, 91, 120, 120, 1, 1, 3, 3, 8, 8, 14, 14, 27, 27, 48, 48, 70, 70, 91, 91, 120, 120, 0, 0, 8, 8, 14, 14, 21, 21, 41, 41, 63, 63, 91, 91, 120, 120, 8, 8, 14, 14, 21, 21, 41, 41, 63, 63, 91, 91, 120, 120), value = c(97.2, 96.4, 71.1, 69.2, 58.1, 56.6, 44.4, 43.4, 33.3, 29.2, 17.6, 18, 10.5, 9.3, 4.5, 4.7, 3, 3.4, 2.3, 2.7, 4.3, 4.6, 7, 7.2, 8.2, 8, 11, 13.7, 11.5, 12.7, 14.9, 14.5, 12.1, 12.3, 9.9, 10.2, 8.8, 7.8, 93.6, 92.3, 87, 82.2, 74, 73.9, 64.2, 69.5, 54, 54.6, 41.1, 38.4, 32.5, 35.5, 28.1, 29, 26.5, 27.6, 3.9, 3.1, 6.9, 6.6, 10.4, 8.3, 14.4, 13.7, 22.1, 22.3, 27.5, 25.4, 28, 26.6, 25.8, 25.3, 91.9, 90.8, 64.9, 66.2, 43.5, 44.1, 18.3, 18.1, 10.2, 10.8, 4.9, 3.3, 1.6, 1.5, 1.1, 0.9, 9.6, 7.7, 15, 15.1, 21.2, 21.1, 19.7, 18.9, 17.5, 15.9, 9.5, 9.8, 6.2, 6.1, 99.8, 98.3, 77.1, 77.2, 59, 58.1, 27.4, 29.2, 19.1, 29.6, 10.1, 18.2, 4.5, 9.1, 2.3, 2.9, 2, 1.8, 2, 2.2, 4.2, 3.9, 7.4, 7.9, 14.5, 13.7, 14.2, 12.2, 13.7, 13.2, 13.6, 15.4, 10.4, 11.6, 10, 9.5, 9.1, 9, 96.1, 94.3, 73.9, 73.9, 69.4, 73.1, 65.6, 65.3, 55.9, 54.4, 47, 49.3, 44.7, 46.7, 42.1, 41.3, 3.3, 3.4, 3.9, 2.9, 6.4, 7.2, 9.1, 8.5, 11.7, 12, 13.3, 13.2, 14.3, 12.1)), row.names = c(NA, -170L), class = c("nfnGroupedData", "nfGroupedData", "groupedData", "data.frame"), formula = value ~ time | ds, FUN = function (x) max(x, na.rm = TRUE), order.groups = FALSE), start = list( fixed = c(parent_0 = 93.4272167134207, log_k_A1 = -9.71590717106959, f_parent_qlogis = -0.953712099744438, log_k1 = -1.95256957646888, log_k2 = -4.42919226610318, g_qlogis = 0.193023137298073 ), random = list(ds = structure(c(2.85557330683041, -3.87630303729395, -2.78062140212751, 4.82042042600536, -1.01906929341432, 4.613992019697, 2.05871276943309, 6.0766404049189, 4.86471337131288, -17.6140585653619, -0.480721175257541, 0.773079218835614, 0.260464433006093, -0.440615012802434, -0.112207463781733, 0.445812953745225, -1.49588630006094, 1.13602040717272, 0.801850880762046, -0.887797941619048, 0.936480292463262, -2.43093808171905, 1.91256225793793, 0.984827519864443, -1.40293198854659, -0.455176326336681, 0.376355651864385, 0.343919720700401, 0.46329187713133, -0.728390923359434 ), .Dim = 5:6, .Dimnames = list(c("1", "2", "3", "4", "5"), c("parent_0", "log_k_A1", "f_parent_qlogis", "log_k1", "log_k2", "g_qlogis"))))), fixed = list(parent_0 ~ 1, log_k_A1 ~ 1, f_parent_qlogis ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1), random = structure(numeric(0), class = c("pdDiag", "pdMat"), formula = structure(list(parent_0 ~ 1, log_k_A1 ~ 1, f_parent_qlogis ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_qlogis ~ 1), class = "listForm"), Dimnames = list(NULL, NULL)), weights = structure(numeric(0), formula = ~1 | name, class = c("varIdent", "varFunc"))): maximum number of iterations (maxIter = 50) reached without convergence</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 59.38 16.5 53.5</span></div><div class='input'> <span class='va'>f_2_tc</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"SFO-SFO"</span> <span class='op'>=</span> <span class='va'>m_sfo_sfo</span>, <span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>m_dfop_sfo</span><span class='op'>)</span>, <span class='va'>ds_2</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span> <span class='co'># f_nlme_sfo_sfo_tc <- nlme(f_2_tc["SFO-SFO", ]) # stops with error message</span> <span class='va'>f_nlme_dfop_sfo_tc</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2_tc</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Iteration 1, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 2, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 3, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 4, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 6, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 7, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 8, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 9, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 11, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 12, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 15, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 25, LME step: nlminb() did not converge (code = 1). PORT message: false convergence (8)</span></div><div class='input'> <span class='co'># We get warnings about false convergence in the LME step in several iterations</span> +</div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='warning'>Warning: longer object length is not a multiple of shorter object length</span></div><div class='output co'>#> <span class='error'>Error in X[, fmap[[nm]]] <- gradnm: number of items to replace is not a multiple of replacement length</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 6.363 2.688 5.469</span></div><div class='input'> <span class='co'># We get warnings about false convergence in the LME step in several iterations</span> <span class='co'># but as the last such warning occurs in iteration 25 and we have 28 iterations</span> <span class='co'># we can ignore these</span> <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='va'>f_nlme_dfop_sfo_obs</span>, <span class='va'>f_nlme_dfop_sfo_tc</span><span class='op'>)</span> -</div><div class='output co'>#> Model df AIC BIC logLik Test L.Ratio p-value -#> f_nlme_dfop_sfo 1 28 811.7199 899.5222 -377.8599 -#> f_nlme_dfop_sfo_obs 2 29 784.1304 875.0685 -363.0652 1 vs 2 29.5895 <.0001 -#> f_nlme_dfop_sfo_tc 3 29 791.9981 882.9362 -366.9990 </div><div class='input'> +</div><div class='output co'>#> <span class='error'>Error in anova(f_nlme_dfop_sfo, f_nlme_dfop_sfo_obs, f_nlme_dfop_sfo_tc): object 'f_nlme_dfop_sfo' not found</span></div><div class='input'> <span class='co'># }</span> </div></pre> </div> diff --git a/docs/dev/reference/plot.mixed.mmkin-2.png b/docs/dev/reference/plot.mixed.mmkin-2.png Binary files differindex 0821dcca..c0d67204 100644 --- a/docs/dev/reference/plot.mixed.mmkin-2.png +++ b/docs/dev/reference/plot.mixed.mmkin-2.png diff --git a/docs/dev/reference/plot.mixed.mmkin-3.png b/docs/dev/reference/plot.mixed.mmkin-3.png Binary files differindex d58b9c69..3055c0c9 100644 --- a/docs/dev/reference/plot.mixed.mmkin-3.png +++ b/docs/dev/reference/plot.mixed.mmkin-3.png diff --git a/docs/dev/reference/plot.mixed.mmkin.html b/docs/dev/reference/plot.mixed.mmkin.html index 492e289c..90ba9184 100644 --- a/docs/dev/reference/plot.mixed.mmkin.html +++ b/docs/dev/reference/plot.mixed.mmkin.html @@ -174,7 +174,7 @@ <colgroup><col class="name" /><col class="desc" /></colgroup> <tr> <th>x</th> - <td><p>An object of class <a href='saem.html'>saem.mmkin</a> or <a href='nlme.mmkin.html'>nlme.mmkin</a></p></td> + <td><p>An object of class <a href='mixed.html'>mixed.mmkin</a>, <a href='saem.html'>saem.mmkin</a> or <a href='nlme.mmkin.html'>nlme.mmkin</a></p></td> </tr> <tr> <th>i</th> @@ -273,14 +273,14 @@ corresponding model prediction lines for the different datasets.</p></td> <span class='co'># For this fit we need to increase pnlsMaxiter, and we increase the</span> <span class='co'># tolerance in order to speed up the fit for this example evaluation</span> <span class='va'>f_nlme</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span>, control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>pnlsMaxIter <span class='op'>=</span> <span class='fl'>120</span>, tolerance <span class='op'>=</span> <span class='fl'>1e-3</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='warning'>Warning: Iteration 1, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='output co'>#> <span class='warning'>Warning: Iteration 2, LME step: nlminb() did not converge (code = 1). Do increase 'msMaxIter'!</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme</span><span class='op'>)</span> +<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme</span><span class='op'>)</span> </div><div class='img'><img src='plot.mixed.mmkin-2.png' alt='' width='700' height='433' /></div><div class='input'> <span class='va'>f_saem</span> <span class='op'><-</span> <span class='fu'><a href='saem.html'>saem</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>)</span> </div><div class='output co'>#> Running main SAEM algorithm -#> [1] "Mon Nov 30 15:52:45 2020" +#> [1] "Fri Dec 11 15:37:36 2020" #> .... #> Minimisation finished -#> [1] "Mon Nov 30 15:52:54 2020"</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_saem</span><span class='op'>)</span> +#> [1] "Fri Dec 11 15:37:45 2020"</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_saem</span><span class='op'>)</span> </div><div class='img'><img src='plot.mixed.mmkin-3.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># }</span> </div></pre> </div> diff --git a/docs/dev/reference/saem-5.png b/docs/dev/reference/saem-5.png Binary files differindex a12f8383..6e6e0f91 100644 --- a/docs/dev/reference/saem-5.png +++ b/docs/dev/reference/saem-5.png diff --git a/docs/dev/reference/saem.html b/docs/dev/reference/saem.html index e4ebf5d9..73699e19 100644 --- a/docs/dev/reference/saem.html +++ b/docs/dev/reference/saem.html @@ -151,11 +151,13 @@ effects models created from <a href='mmkin.html'>mmkin</a> row objects using the Expectation Maximisation algorithm (SAEM).</p> </div> - <pre class="usage"><span class='fu'>saem</span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>control</span>, <span class='va'>...</span><span class='op'>)</span> + <pre class="usage"><span class='fu'>saem</span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span> <span class='co'># S3 method for mmkin</span> <span class='fu'>saem</span><span class='op'>(</span> <span class='va'>object</span>, + transformations <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"mkin"</span>, <span class='st'>"saemix"</span><span class='op'>)</span>, + solution_type <span class='op'>=</span> <span class='st'>"auto"</span>, control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>displayProgress <span class='op'>=</span> <span class='cn'>FALSE</span>, print <span class='op'>=</span> <span class='cn'>FALSE</span>, save <span class='op'>=</span> <span class='cn'>FALSE</span>, save.graphs <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span>, cores <span class='op'>=</span> <span class='fl'>1</span>, @@ -168,7 +170,14 @@ Expectation Maximisation algorithm (SAEM).</p> <span class='co'># S3 method for saem.mmkin</span> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, digits <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Extremes.html'>max</a></span><span class='op'>(</span><span class='fl'>3</span>, <span class='fu'><a href='https://rdrr.io/r/base/options.html'>getOption</a></span><span class='op'>(</span><span class='st'>"digits"</span><span class='op'>)</span> <span class='op'>-</span> <span class='fl'>3</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span> -<span class='fu'>saemix_model</span><span class='op'>(</span><span class='va'>object</span>, cores <span class='op'>=</span> <span class='fl'>1</span>, verbose <span class='op'>=</span> <span class='cn'>FALSE</span>, <span class='va'>...</span><span class='op'>)</span> +<span class='fu'>saemix_model</span><span class='op'>(</span> + <span class='va'>object</span>, + solution_type <span class='op'>=</span> <span class='st'>"auto"</span>, + transformations <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"mkin"</span>, <span class='st'>"saemix"</span><span class='op'>)</span>, + cores <span class='op'>=</span> <span class='fl'>1</span>, + verbose <span class='op'>=</span> <span class='cn'>FALSE</span>, + <span class='va'>...</span> +<span class='op'>)</span> <span class='fu'>saemix_data</span><span class='op'>(</span><span class='va'>object</span>, verbose <span class='op'>=</span> <span class='cn'>FALSE</span>, <span class='va'>...</span><span class='op'>)</span></pre> @@ -181,19 +190,25 @@ Expectation Maximisation algorithm (SAEM).</p> <a href='mkinmod.html'>mkinmod</a> model to different datasets</p></td> </tr> <tr> - <th>control</th> - <td><p>Passed to <a href='https://rdrr.io/pkg/saemix/man/saemix.html'>saemix::saemix</a></p></td> - </tr> - <tr> <th>...</th> <td><p>Further parameters passed to <a href='https://rdrr.io/pkg/saemix/man/saemixModel.html'>saemix::saemixModel</a>.</p></td> </tr> <tr> - <th>cores</th> - <td><p>The number of cores to be used for multicore processing using -<code><a href='https://rdrr.io/r/parallel/mclapply.html'>parallel::mclapply()</a></code>. Using more than 1 core is experimental and may -lead to excessive forking, apparently depending on the BLAS version -used.</p></td> + <th>transformations</th> + <td><p>Per default, all parameter transformations are done +in mkin. If this argument is set to 'saemix', parameter transformations +are done in 'saemix' for the supported cases. Currently this is only +supported in cases where the initial concentration of the parent is not fixed, +SFO or DFOP is used for the parent and there is either no metabolite or one.</p></td> + </tr> + <tr> + <th>solution_type</th> + <td><p>Possibility to specify the solution type in case the +automatic choice is not desired</p></td> + </tr> + <tr> + <th>control</th> + <td><p>Passed to <a href='https://rdrr.io/pkg/saemix/man/saemix.html'>saemix::saemix</a></p></td> </tr> <tr> <th>verbose</th> @@ -243,31 +258,31 @@ using <a href='mmkin.html'>mmkin</a>.</p> <span class='va'>ds</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>experimental_data_for_UBA_2019</span><span class='op'>[</span><span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>]</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>[</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"name"</span>, <span class='st'>"time"</span>, <span class='st'>"value"</span><span class='op'>)</span><span class='op'>]</span><span class='op'>)</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>ds</span><span class='op'>)</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Dataset"</span>, <span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>)</span> -<span class='va'>f_mmkin_parent_p0_fixed</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='va'>ds</span>, cores <span class='op'>=</span> <span class='fl'>1</span>, +<span class='va'>f_mmkin_parent_p0_fixed</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='va'>ds</span>, state.ini <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fl'>100</span><span class='op'>)</span>, fixed_initials <span class='op'>=</span> <span class='st'>"parent"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='va'>f_saem_p0_fixed</span> <span class='op'><-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin_parent_p0_fixed</span><span class='op'>)</span> </div><div class='output co'>#> Running main SAEM algorithm -#> [1] "Mon Nov 30 15:53:02 2020" +#> [1] "Fri Dec 11 15:37:47 2020" #> .... #> Minimisation finished -#> [1] "Mon Nov 30 15:53:04 2020"</div><div class='input'> +#> [1] "Fri Dec 11 15:37:49 2020"</div><div class='input'> <span class='va'>f_mmkin_parent</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='va'>f_saem_sfo</span> <span class='op'><-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin_parent</span><span class='op'>[</span><span class='st'>"SFO"</span>, <span class='op'>]</span><span class='op'>)</span> </div><div class='output co'>#> Running main SAEM algorithm -#> [1] "Mon Nov 30 15:53:05 2020" +#> [1] "Fri Dec 11 15:37:51 2020" #> .... #> Minimisation finished -#> [1] "Mon Nov 30 15:53:07 2020"</div><div class='input'><span class='va'>f_saem_fomc</span> <span class='op'><-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin_parent</span><span class='op'>[</span><span class='st'>"FOMC"</span>, <span class='op'>]</span><span class='op'>)</span> +#> [1] "Fri Dec 11 15:37:52 2020"</div><div class='input'><span class='va'>f_saem_fomc</span> <span class='op'><-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin_parent</span><span class='op'>[</span><span class='st'>"FOMC"</span>, <span class='op'>]</span><span class='op'>)</span> </div><div class='output co'>#> Running main SAEM algorithm -#> [1] "Mon Nov 30 15:53:07 2020" +#> [1] "Fri Dec 11 15:37:52 2020" #> .... #> Minimisation finished -#> [1] "Mon Nov 30 15:53:09 2020"</div><div class='input'><span class='va'>f_saem_dfop</span> <span class='op'><-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin_parent</span><span class='op'>[</span><span class='st'>"DFOP"</span>, <span class='op'>]</span><span class='op'>)</span> +#> [1] "Fri Dec 11 15:37:55 2020"</div><div class='input'><span class='va'>f_saem_dfop</span> <span class='op'><-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin_parent</span><span class='op'>[</span><span class='st'>"DFOP"</span>, <span class='op'>]</span><span class='op'>)</span> </div><div class='output co'>#> Running main SAEM algorithm -#> [1] "Mon Nov 30 15:53:10 2020" +#> [1] "Fri Dec 11 15:37:55 2020" #> .... #> Minimisation finished -#> [1] "Mon Nov 30 15:53:13 2020"</div><div class='input'> +#> [1] "Fri Dec 11 15:37:58 2020"</div><div class='input'> <span class='co'># The returned saem.mmkin object contains an SaemixObject, therefore we can use</span> <span class='co'># functions from saemix</span> <span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'>saemix</span><span class='op'>)</span> @@ -313,10 +328,10 @@ using <a href='mmkin.html'>mmkin</a>.</p> <span class='va'>f_mmkin_parent_tc</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>f_mmkin_parent</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span> <span class='va'>f_saem_fomc_tc</span> <span class='op'><-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin_parent_tc</span><span class='op'>[</span><span class='st'>"FOMC"</span>, <span class='op'>]</span><span class='op'>)</span> </div><div class='output co'>#> Running main SAEM algorithm -#> [1] "Mon Nov 30 15:53:15 2020" +#> [1] "Fri Dec 11 15:38:01 2020" #> .... #> Minimisation finished -#> [1] "Mon Nov 30 15:53:20 2020"</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/saemix/man/compare.saemix.html'>compare.saemix</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='va'>f_saem_fomc</span><span class='op'>$</span><span class='va'>so</span>, <span class='va'>f_saem_fomc_tc</span><span class='op'>$</span><span class='va'>so</span><span class='op'>)</span><span class='op'>)</span> +#> [1] "Fri Dec 11 15:38:06 2020"</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/saemix/man/compare.saemix.html'>compare.saemix</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='va'>f_saem_fomc</span><span class='op'>$</span><span class='va'>so</span>, <span class='va'>f_saem_fomc_tc</span><span class='op'>$</span><span class='va'>so</span><span class='op'>)</span><span class='op'>)</span> </div><div class='output co'>#> Likelihoods computed by importance sampling </div><div class='output co'>#> AIC BIC #> 1 467.7096 464.9757 #> 2 469.5208 466.3963</div><div class='input'> @@ -331,20 +346,21 @@ using <a href='mmkin.html'>mmkin</a>.</p> <span class='va'>f_mmkin</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span> <span class='st'>"SFO-SFO"</span> <span class='op'>=</span> <span class='va'>sfo_sfo</span>, <span class='st'>"FOMC-SFO"</span> <span class='op'>=</span> <span class='va'>fomc_sfo</span>, <span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>dfop_sfo</span><span class='op'>)</span>, <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> -<span class='co'># These take about five seconds each on this system, as we use</span> -<span class='co'># analytical solutions written for saemix. When using the analytical</span> -<span class='co'># solutions written for mkin this took around four minutes</span> +<span class='co'># saem fits of SFO-SFO and DFOP-SFO to these data take about five seconds</span> +<span class='co'># each on this system, as we use analytical solutions written for saemix.</span> +<span class='co'># When using the analytical solutions written for mkin this took around</span> +<span class='co'># four minutes</span> <span class='va'>f_saem_sfo_sfo</span> <span class='op'><-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> </div><div class='output co'>#> Running main SAEM algorithm -#> [1] "Mon Nov 30 15:53:23 2020" +#> [1] "Fri Dec 11 15:38:09 2020" #> .... #> Minimisation finished -#> [1] "Mon Nov 30 15:53:28 2020"</div><div class='input'><span class='va'>f_saem_dfop_sfo</span> <span class='op'><-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> +#> [1] "Fri Dec 11 15:38:14 2020"</div><div class='input'><span class='va'>f_saem_dfop_sfo</span> <span class='op'><-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span><span class='op'>)</span> </div><div class='output co'>#> Running main SAEM algorithm -#> [1] "Mon Nov 30 15:53:29 2020" +#> [1] "Fri Dec 11 15:38:15 2020" #> .... #> Minimisation finished -#> [1] "Mon Nov 30 15:53:38 2020"</div><div class='input'><span class='co'># We can use print, plot and summary methods to check the results</span> +#> [1] "Fri Dec 11 15:38:24 2020"</div><div class='input'><span class='co'># We can use print, plot and summary methods to check the results</span> <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_saem_dfop_sfo</span><span class='op'>)</span> </div><div class='output co'>#> Kinetic nonlinear mixed-effects model fit by SAEM #> Structural model: @@ -387,8 +403,8 @@ using <a href='mmkin.html'>mmkin</a>.</p> </div><div class='output co'>#> saemix version used for fitting: 3.1.9000 #> mkin version used for pre-fitting: 0.9.50.4 #> R version used for fitting: 4.0.3 -#> Date of fit: Mon Nov 30 15:53:38 2020 -#> Date of summary: Mon Nov 30 15:53:39 2020 +#> Date of fit: Fri Dec 11 15:38:25 2020 +#> Date of summary: Fri Dec 11 15:38:25 2020 #> #> Equations: #> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * @@ -403,15 +419,15 @@ using <a href='mmkin.html'>mmkin</a>.</p> #> #> Model predictions using solution type analytical #> -#> Fitted in 9.963 s using 300, 100 iterations +#> Fitted in 10.096 s using 300, 100 iterations #> #> Variance model: Constant variance #> #> Mean of starting values for individual parameters: #> parent_0 log_k_A1 f_parent_qlogis log_k1 log_k2 -#> 93.8101519 -9.7647455 -0.9711148 -1.8799371 -4.2708142 +#> 93.8102 -9.7647 -0.9711 -1.8799 -4.2708 #> g_qlogis -#> 0.1356441 +#> 0.1356 #> #> Fixed degradation parameter values: #> None @@ -422,7 +438,7 @@ using <a href='mmkin.html'>mmkin</a>.</p> #> AIC BIC logLik #> 841.6 836.5 -407.8 #> -#> Optimised, transformed parameters with symmetric confidence intervals: +#> Optimised parameters: #> est. lower upper #> parent_0 93.76647 91.153 96.3798 #> log_k_A1 -6.13235 -8.458 -3.8068 @@ -452,7 +468,7 @@ using <a href='mmkin.html'>mmkin</a>.</p> #> est. lower upper #> a.1 1.883 1.666 2.1 #> -#> Backtransformed parameters with asymmetric confidence intervals: +#> Backtransformed parameters: #> est. lower upper #> parent_0 93.766473 9.115e+01 96.37983 #> k_A1 0.002171 2.122e-04 0.02222 @@ -643,32 +659,19 @@ using <a href='mmkin.html'>mmkin</a>.</p> #> Dataset 10 A1 91 13.2 11.93773 -1.26227 1.883 -0.670224 #> Dataset 10 A1 120 14.3 12.77666 -1.52334 1.883 -0.808847 #> Dataset 10 A1 120 12.1 12.77666 0.67666 1.883 0.359282</div><div class='input'> -<span class='co'># Using a single core, the following takes about 6 minutes as we do not have an</span> -<span class='co'># analytical solution. Using 10 cores it is slower instead of faster</span> -<span class='va'>f_saem_fomc</span> <span class='op'><-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin</span><span class='op'>[</span><span class='st'>"FOMC-SFO"</span>, <span class='op'>]</span>, cores <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span> -</div><div class='output co'>#> Running main SAEM algorithm -#> [1] "Mon Nov 30 15:53:39 2020" -#> DLSODA- At current T (=R1), MXSTEP (=I1) steps -#> taken on this call before reaching TOUT -#> In above message, I1 = 5000 -#> -#> In above message, R1 = 0.00156238 -#> -#> DLSODA- At T (=R1) and step size H (=R2), the -#> corrector convergence failed repeatedly -#> or with ABS(H) = HMIN -#> In above message, R1 = 0, R2 = 1.1373e-10 -#> -#> DLSODA- At current T (=R1), MXSTEP (=I1) steps -#> taken on this call before reaching TOUT -#> In above message, I1 = 5000 -#> -#> In above message, R1 = 2.24752e-06 -#> -#> .... -#> Minimisation finished -#> [1] "Mon Nov 30 16:00:45 2020"</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/saemix/man/plot-SaemixObject-method.html'>plot</a></span><span class='op'>(</span><span class='va'>f_saem_fomc</span><span class='op'>)</span> -</div><div class='img'><img src='saem-6.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># }</span> +<span class='co'># The following takes about 6 minutes</span> +<span class='co'>#f_saem_dfop_sfo_deSolve <- saem(f_mmkin["DFOP-SFO", ], solution_type = "deSolve",</span> +<span class='co'># control = list(nbiter.saemix = c(200, 80), nbdisplay = 10))</span> + +<span class='co'>#saemix::compare.saemix(list(</span> +<span class='co'># f_saem_dfop_sfo$so,</span> +<span class='co'># f_saem_dfop_sfo_deSolve$so))</span> + +<span class='co'># If the model supports it, we can also use eigenvalue based solutions, which</span> +<span class='co'># take a similar amount of time</span> +<span class='co'>#f_saem_sfo_sfo_eigen <- saem(f_mmkin["SFO-SFO", ], solution_type = "eigen",</span> +<span class='co'># control = list(nbiter.saemix = c(200, 80), nbdisplay = 10))</span> +<span class='co'># }</span> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> |