diff options
Diffstat (limited to 'docs/dev/reference/nlme.mmkin.html')
-rw-r--r-- | docs/dev/reference/nlme.mmkin.html | 96 |
1 files changed, 63 insertions, 33 deletions
diff --git a/docs/dev/reference/nlme.mmkin.html b/docs/dev/reference/nlme.mmkin.html index 90aec9be..3fa4d97b 100644 --- a/docs/dev/reference/nlme.mmkin.html +++ b/docs/dev/reference/nlme.mmkin.html @@ -152,7 +152,7 @@ have been obtained by fitting the same model to a list of datasets.</p> </div> <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='fu'>nlme</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>, @@ -255,6 +255,11 @@ parameters taken from the mmkin object are used</p></td> <p>Upon success, a fitted nlme.mmkin object, which is an nlme object with additional elements</p> + <h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2> + + <p>As the object inherits from <a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme::nlme</a>, there is a wealth of +methods that will automatically work on 'nlme.mmkin' objects, such as +<code><a href='https://rdrr.io/pkg/nlme/man/intervals.html'>nlme::intervals()</a></code>, <code><a href='https://rdrr.io/pkg/nlme/man/anova.lme.html'>nlme::anova.lme()</a></code> and <code><a href='https://rdrr.io/pkg/nlme/man/coef.lme.html'>nlme::coef.lme()</a></code>.</p> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <div class='dont-index'><p><code><a href='nlme_function.html'>nlme_function</a></code></p></div> @@ -270,11 +275,20 @@ with additional elements</p> </div><div class='output co'>#> df AIC #> f_nlme_sfo 5 625.0539 #> f_nlme_dfop 9 495.1270</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'>#> Nonlinear mixed-effects model fit by maximum likelihood -#> Model: value ~ (mkin::get_deg_func())(name, time, parent_0, log_k1, log_k2, g_ilr) -#> Data: "Not shown" -#> Log-likelihood: -238.5635 -#> Fixed: list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_ilr ~ 1) +</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 * +#> time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time))) +#> * parent +#> +#> Data: +#> 90 observations of 1 variable(s) grouped in 5 datasets +#> +#> Log-likelihood: -238.5635 +#> +#> Fixed effects: +#> list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_ilr ~ 1) #> parent_0 log_k1 log_k2 g_ilr #> 94.17015133 -1.80015306 -4.14738870 0.02290935 #> @@ -284,9 +298,7 @@ with additional elements</p> #> Structure: Diagonal #> parent_0 log_k1 log_k2 g_ilr Residual #> StdDev: 2.488249 0.8447273 1.32965 0.3289311 2.321364 -#> -#> Number of Observations: 90 -#> 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='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 @@ -295,11 +307,18 @@ with additional elements</p> <span class='co'># \dontrun{</span> <span class='va'>f_nlme_2</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>, start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent_0 <span class='op'>=</span> <span class='fl'>100</span>, log_k_parent <span class='op'>=</span> <span class='fl'>0.1</span><span class='op'>)</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_nlme_2</span>, random <span class='op'>=</span> <span class='va'>parent_0</span> <span class='op'>~</span> <span class='fl'>1</span><span class='op'>)</span> -</div><div class='output co'>#> Nonlinear mixed-effects model fit by maximum likelihood -#> Model: value ~ (mkin::get_deg_func())(name, time, parent_0, log_k_parent) -#> Data: "Not shown" -#> Log-likelihood: -404.3729 -#> Fixed: list(parent_0 ~ 1, log_k_parent ~ 1) +</div><div class='output co'>#> Kinetic nonlinear mixed-effects model fit by maximum likelihood +#> +#> Structural model: +#> d_parent/dt = - k_parent * parent +#> +#> Data: +#> observations of 0 variable(s) grouped in 0 datasets +#> +#> Log-likelihood: -404.3729 +#> +#> Fixed effects: +#> list(parent_0 ~ 1, log_k_parent ~ 1) #> parent_0 log_k_parent #> 75.933480 -3.555983 #> @@ -307,9 +326,7 @@ with additional elements</p> #> Formula: parent_0 ~ 1 | ds #> parent_0 Residual #> StdDev: 0.002416792 21.63027 -#> -#> Number of Observations: 90 -#> Number of Groups: 5 </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>, +#> </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> <span class='va'>m_sfo_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='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'>"min"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> @@ -395,11 +412,20 @@ with additional elements</p> <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'>#> Nonlinear mixed-effects model fit by maximum likelihood -#> Model: value ~ (mkin::get_deg_func())(name, time, parent_0, log_k1, log_k2, g_ilr) -#> Data: "Not shown" -#> Log-likelihood: -238.4298 -#> Fixed: list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_ilr ~ 1) +</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 * +#> time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time))) +#> * parent +#> +#> Data: +#> 90 observations of 1 variable(s) grouped in 5 datasets +#> +#> Log-likelihood: -238.4298 +#> +#> Fixed effects: +#> list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_ilr ~ 1) #> parent_0 log_k1 log_k2 g_ilr #> 94.04774463 -1.82339924 -4.16715509 0.04020161 #> @@ -415,19 +441,25 @@ with additional elements</p> #> Formula: ~fitted(.) #> Parameter estimates: #> const prop -#> 2.23222625 0.01262414 -#> Number of Observations: 90 -#> Number of Groups: 5 </div><div class='input'> +#> 2.23222625 0.01262414 </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> <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'>#> Nonlinear mixed-effects model fit by maximum likelihood -#> Model: value ~ (mkin::get_deg_func())(name, time, parent_0, log_k_parent_sink, log_k_parent_A1, log_k_A1_sink) -#> Data: "Not shown" -#> Log-likelihood: -472.976 -#> Fixed: list(parent_0 ~ 1, log_k_parent_sink ~ 1, log_k_parent_A1 ~ 1, log_k_A1_sink ~ 1) +</div><div class='output co'>#> Kinetic nonlinear mixed-effects model fit by maximum likelihood +#> +#> Structural model: +#> d_parent/dt = - k_parent_sink * parent - k_parent_A1 * parent +#> d_A1/dt = + k_parent_A1 * parent - k_A1_sink * A1 +#> +#> Data: +#> 170 observations of 2 variable(s) grouped in 5 datasets +#> +#> Log-likelihood: -472.976 +#> +#> 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 #> 87.975536 -3.669816 -4.164127 -4.645073 #> @@ -443,9 +475,7 @@ with additional elements</p> #> Formula: ~1 | name #> Parameter estimates: #> parent A1 -#> 1.0000000 0.2050003 -#> Number of Observations: 170 -#> Number of Groups: 5 </div><div class='input'> <span class='co'># The same with DFOP-SFO does not converge, apparently the variances of</span> +#> 1.0000000 0.2050003 </div><div class='input'> <span class='co'># The same with DFOP-SFO does not converge, apparently the variances of</span> <span class='co'># parent and A1 are too similar in this case, so that the model is</span> <span class='co'># overparameterised</span> <span class='co'>#f_nlme_dfop_sfo_obs <- nlme(f_2_obs["DFOP-SFO", ], control = list(maxIter = 100))</span> |