aboutsummaryrefslogtreecommitdiff
path: root/docs/dev/reference/nlme.mmkin.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/dev/reference/nlme.mmkin.html')
-rw-r--r--docs/dev/reference/nlme.mmkin.html101
1 files changed, 13 insertions, 88 deletions
diff --git a/docs/dev/reference/nlme.mmkin.html b/docs/dev/reference/nlme.mmkin.html
index 6e83b700..3c84abe2 100644
--- a/docs/dev/reference/nlme.mmkin.html
+++ b/docs/dev/reference/nlme.mmkin.html
@@ -286,7 +286,8 @@ with additional elements</p>
#&gt; StdDev: 2.488249 0.8447273 1.32965 0.3289311 2.321364
#&gt;
#&gt; Number of Observations: 90
-#&gt; Number of Groups: 5 </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>
+#&gt; Number of Groups: 5 </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'>#&gt; $distimes
#&gt; DT50 DT90 DT50back DT50_k1 DT50_k2
#&gt; parent 10.79857 100.7937 30.34193 4.193938 43.85443
@@ -313,82 +314,24 @@ with additional elements</p>
A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"min"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
<span class='va'>m_sfo_sfo_ff</span> <span class='op'>&lt;-</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='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
- <span class='va'>m_fomc_sfo</span> <span class='op'>&lt;-</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='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
- A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.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='va'>m_dfop_sfo</span> <span class='op'>&lt;-</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='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.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='va'>f_2</span> <span class='op'>&lt;-</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'>"SFO-SFO-ff"</span> <span class='op'>=</span> <span class='va'>m_sfo_sfo_ff</span>,
- <span class='st'>"FOMC-SFO"</span> <span class='op'>=</span> <span class='va'>m_fomc_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><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_2</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span><span class='op'>)</span> <span class='co'># Separate fits for datasets 3 and 4</span>
-</div><div class='img'><img src='nlme.mmkin-1.png' alt='' width='700' height='433' /></div><div class='input'>
+
<span class='va'>f_nlme_sfo_sfo</span> <span class='op'>&lt;-</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>
- <span class='co'># plot(f_nlme_sfo_sfo) # not feasible with pkgdown figures</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='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span> <span class='co'># Global mixed model: Fits for datasets 3 and 4</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</span>
<span class='va'>f_nlme_sfo_sfo_ff</span> <span class='op'>&lt;-</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-ff"</span>, <span class='op'>]</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_ff</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span> <span class='co'># chi2 different due to different df attribution</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_ff</span><span class='op'>)</span>
</div><div class='img'><img src='nlme.mmkin-3.png' alt='' width='700' height='433' /></div><div class='input'>
- <span class='co'># For more parameters, we need to increase pnlsMaxIter and the tolerance</span>
+ <span class='co'># For the following fit we need to increase pnlsMaxIter and the tolerance</span>
<span class='co'># to get convergence</span>
- <span class='va'>f_nlme_fomc_sfo</span> <span class='op'>&lt;-</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'>"FOMC-SFO"</span>, <span class='op'>]</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'>100</span>, tolerance <span class='op'>=</span> <span class='fl'>1e-4</span><span class='op'>)</span>, verbose <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
-</div><div class='output co'>#&gt;
-#&gt; **Iteration 1
-#&gt; LME step: Loglik: -394.1603, nlminb iterations: 3
-#&gt; reStruct parameters:
-#&gt; ds1 ds2 ds3 ds4 ds5
-#&gt; -0.2079793 0.8563830 1.7454105 1.0917354 1.2756825
-#&gt; Beginning PNLS step: .. completed fit_nlme() step.
-#&gt; PNLS step: RSS = 643.8803
-#&gt; fixed effects: 94.17379 -5.473193 -0.6970236 -0.2025091 2.103883
-#&gt; iterations: 100
-#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0001):
-#&gt; fixed reStruct
-#&gt; 0.7960134 0.1447728
-#&gt;
-#&gt; **Iteration 2
-#&gt; LME step: Loglik: -396.3824, nlminb iterations: 7
-#&gt; reStruct parameters:
-#&gt; ds1 ds2 ds3 ds4 ds5
-#&gt; -1.712404e-01 -2.432655e-05 1.842120e+00 1.073975e+00 1.322925e+00
-#&gt; Beginning PNLS step: .. completed fit_nlme() step.
-#&gt; PNLS step: RSS = 643.8035
-#&gt; fixed effects: 94.17385 -5.473487 -0.6970404 -0.2025137 2.103871
-#&gt; iterations: 100
-#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0001):
-#&gt; fixed reStruct
-#&gt; 5.382757e-05 1.236667e-03
-#&gt;
-#&gt; **Iteration 3
-#&gt; LME step: Loglik: -396.3825, nlminb iterations: 7
-#&gt; reStruct parameters:
-#&gt; ds1 ds2 ds3 ds4 ds5
-#&gt; -0.1712499044 -0.0001499831 1.8420971364 1.0739799123 1.3229167796
-#&gt; Beginning PNLS step: .. completed fit_nlme() step.
-#&gt; PNLS step: RSS = 643.7948
-#&gt; fixed effects: 94.17386 -5.473521 -0.6970422 -0.2025144 2.10387
-#&gt; iterations: 100
-#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0001):
-#&gt; fixed reStruct
-#&gt; 6.072817e-06 1.400857e-04
-#&gt;
-#&gt; **Iteration 4
-#&gt; LME step: Loglik: -396.3825, nlminb iterations: 7
-#&gt; reStruct parameters:
-#&gt; ds1 ds2 ds3 ds4 ds5
-#&gt; -0.1712529502 -0.0001641277 1.8420957542 1.0739797181 1.3229173076
-#&gt; Beginning PNLS step: .. completed fit_nlme() step.
-#&gt; PNLS step: RSS = 643.7936
-#&gt; fixed effects: 94.17386 -5.473526 -0.6970426 -0.2025146 2.103869
-#&gt; iterations: 100
-#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0001):
-#&gt; fixed reStruct
-#&gt; 1.027451e-06 2.275704e-05 </div><div class='input'> <span class='va'>f_nlme_dfop_sfo</span> <span class='op'>&lt;-</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='va'>f_nlme_dfop_sfo</span> <span class='op'>&lt;-</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>,
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'>5e-4</span><span class='op'>)</span>, verbose <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
</div><div class='output co'>#&gt;
#&gt; **Iteration 1
@@ -415,17 +358,10 @@ with additional elements</p>
#&gt; iterations: 120
#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0005):
#&gt; fixed reStruct
-#&gt; 4.789774e-07 2.200661e-05 </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_2</span><span class='op'>[</span><span class='st'>"FOMC-SFO"</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span><span class='op'>)</span>
-</div><div class='img'><img src='nlme.mmkin-4.png' alt='' width='700' height='433' /></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_fomc_sfo</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span>
-</div><div class='img'><img src='nlme.mmkin-5.png' alt='' width='700' height='433' /></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_2</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span><span class='op'>)</span>
-</div><div class='img'><img src='nlme.mmkin-6.png' alt='' width='700' height='433' /></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='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span>
-</div><div class='img'><img src='nlme.mmkin-7.png' alt='' width='700' height='433' /></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_fomc_sfo</span>, <span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span>
-</div><div class='output co'>#&gt; Model df AIC BIC logLik Test L.Ratio p-value
-#&gt; f_nlme_dfop_sfo 1 13 843.8547 884.6201 -408.9273
-#&gt; f_nlme_fomc_sfo 2 11 818.5149 853.0087 -398.2575 1 vs 2 21.33975 &lt;.0001
-#&gt; f_nlme_sfo_sfo 3 9 1085.1821 1113.4043 -533.5910 2 vs 3 270.66716 &lt;.0001</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> <span class='co'># if we ignore FOMC</span>
+#&gt; 4.789774e-07 2.200661e-05 </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-4.png' alt='' width='700' height='433' /></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'>#&gt; Model df AIC BIC logLik Test L.Ratio p-value
#&gt; f_nlme_dfop_sfo 1 13 843.8547 884.6201 -408.9273
#&gt; f_nlme_sfo_sfo 2 9 1085.1821 1113.4043 -533.5910 1 vs 2 249.3274 &lt;.0001</div><div class='input'>
@@ -449,19 +385,8 @@ with additional elements</p>
#&gt; A1 162.30536 539.1667 NA NA NA
#&gt; </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'>&gt;</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</span>
- <span class='co'>#f_2_tc &lt;- mmkin(list("SFO-SFO" = m_sfo_sfo,</span>
- <span class='co'># "SFO-SFO-ff" = m_sfo_sfo_ff,</span>
- <span class='co'># "FOMC-SFO" = m_fomc_sfo,</span>
- <span class='co'># "DFOP-SFO" = m_dfop_sfo),</span>
- <span class='co'># ds_2, quiet = TRUE,</span>
- <span class='co'># error_model = "tc")</span>
- <span class='co'>#f_nlme_sfo_sfo_tc &lt;- nlme(f_2_tc["SFO-SFO", ], control = list(maxIter = 100))</span>
- <span class='co'>#f_nlme_dfop_sfo_tc &lt;- nlme(f_2_tc["DFOP-SFO", ])</span>
- <span class='co'>#f_nlme_dfop_sfo_tc &lt;- update(f_nlme_dfop_sfo, weights = varConstProp(),</span>
- <span class='co'># control = list(sigma = 1, msMaxIter = 100, pnlsMaxIter = 15))</span>
- <span class='co'># Fitting metabolite kinetics with nlme.mmkin and the two-component</span>
- <span class='co'># error model currently does not work, at least not with these data.</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>
<span class='va'>f_tc</span> <span class='op'>&lt;-</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>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span>
<span class='va'>f_nlme_sfo_tc</span> <span class='op'>&lt;-</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_tc</span><span class='op'>[</span><span class='st'>"SFO"</span>, <span class='op'>]</span><span class='op'>)</span>

Contact - Imprint