aboutsummaryrefslogtreecommitdiff
path: root/docs/transform_odeparms.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/transform_odeparms.html')
-rw-r--r--docs/transform_odeparms.html281
1 files changed, 281 insertions, 0 deletions
diff --git a/docs/transform_odeparms.html b/docs/transform_odeparms.html
new file mode 100644
index 00000000..6f48b1fa
--- /dev/null
+++ b/docs/transform_odeparms.html
@@ -0,0 +1,281 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+<title>transform_odeparms. mkin 0.9.44.9000</title>
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<meta name="author" content="
+ Johannes Ranke
+">
+
+<link href="css/bootstrap.css" rel="stylesheet">
+<link href="css/bootstrap-responsive.css" rel="stylesheet">
+<link href="css/highlight.css" rel="stylesheet">
+<link href="css/staticdocs.css" rel="stylesheet">
+
+<!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+<![endif]-->
+
+<script type="text/x-mathjax-config">
+ MathJax.Hub.Config({
+ tex2jax: {
+ inlineMath: [ ['$','$'], ["\\(","\\)"] ],
+ processEscapes: true
+ }
+ });
+</script>
+<script type="text/javascript"
+ src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
+</script>
+ </head>
+
+ <body>
+ <div class="navbar">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="brand" href="index.html">mkin 0.9.44.9000</a>
+ <div class="nav">
+ <ul class="nav">
+ <li><a href="index.html">Home</a></li>
+ <li><a href="reference.html">Reference</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+</div>
+
+
+ <div class="container">
+ <header>
+
+ </header>
+
+ <h1>
+ Functions to transform and backtransform kinetic parameters for fitting
+</h1>
+
+<div class="row">
+ <div class="span8">
+ <h2>Usage</h2>
+ <pre><span class="functioncall"><a href='transform_odeparms.html'>transform_odeparms</a></span><span class="keyword">(</span><span class="symbol">parms</span><span class="keyword">,</span> <span class="symbol">mkinmod</span><span class="keyword">,</span>
+ <span class="argument">transform_rates</span>&nbsp;<span class="argument">=</span>&nbsp;<span class="number">TRUE</span><span class="keyword">,</span> <span class="argument">transform_fractions</span>&nbsp;<span class="argument">=</span>&nbsp;<span class="number">TRUE</span><span class="keyword">)</span>
+<span class="functioncall"><a href='transform_odeparms.html'>backtransform_odeparms</a></span><span class="keyword">(</span><span class="symbol">transparms</span><span class="keyword">,</span> <span class="symbol">mkinmod</span><span class="keyword">,</span>
+ <span class="argument">transform_rates</span>&nbsp;<span class="argument">=</span>&nbsp;<span class="number">TRUE</span><span class="keyword">,</span> <span class="argument">transform_fractions</span>&nbsp;<span class="argument">=</span>&nbsp;<span class="number">TRUE</span><span class="keyword">)</span></pre>
+
+ <h2>Arguments</h2>
+ <dl>
+ <dt>parms</dt>
+ <dd>
+ Parameters of kinetic models as used in the differential equations.
+ </dd>
+ <dt>transparms</dt>
+ <dd>
+ Transformed parameters of kinetic models as used in the fitting procedure.
+ </dd>
+ <dt>mkinmod</dt>
+ <dd>
+ The kinetic model of class <code><a href='mkinmod.html'>mkinmod</a></code>, containing the names of
+ the model variables that are needed for grouping the formation fractions
+ before <code><a href='ilr.html'>ilr</a></code> transformation, the parameter names and
+ the information if the pathway to sink is included in the model.
+ </dd>
+ <dt>transform_rates</dt>
+ <dd>
+ Boolean specifying if kinetic rate constants should be transformed in the
+ model specification used in the fitting for better compliance with the
+ assumption of normal distribution of the estimator. If TRUE, also
+ alpha and beta parameters of the FOMC model are log-transformed, as well
+ as k1 and k2 rate constants for the DFOP and HS models and the break point tb
+ of the HS model.
+ </dd>
+ <dt>transform_fractions</dt>
+ <dd>
+ Boolean specifying if formation fractions constants should be transformed in the
+ model specification used in the fitting for better compliance with the
+ assumption of normal distribution of the estimator. The default (TRUE) is
+ to do transformations. The g parameter of the DFOP and HS models are also
+ transformed, as they can also be seen as compositional data. The
+ transformation used for these transformations is the <code><a href='ilr.html'>ilr</a></code>
+ transformation.
+ </dd>
+ </dl>
+
+ <div class="Description">
+ <h2>Description</h2>
+
+ <p>The transformations are intended to map parameters that should only take
+ on restricted values to the full scale of real numbers. For kinetic rate
+ constants and other paramters that can only take on positive values, a
+ simple log transformation is used. For compositional parameters, such as
+ the formations fractions that should always sum up to 1 and can not be
+ negative, the <code><a href='ilr.html'>ilr</a></code> transformation is used.</p>
+
+ <p>The transformation of sets of formation fractions is fragile, as it supposes
+ the same ordering of the components in forward and backward transformation.
+ This is no problem for the internal use in <code><a href='mkinfit.html'>mkinfit</a></code>.</p>
+
+ </div>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p><dl>
+ A vector of transformed or backtransformed parameters with the same names
+ as the original parameters.
+</dl></p>
+
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class="symbol">SFO_SFO</span> <span class="assignement">&lt;-</span> <span class="functioncall"><a href='mkinmod.html'>mkinmod</a></span><span class="keyword">(</span>
+ <span class="argument">parent</span> <span class="argument">=</span> <span class="functioncall"><a href='http://www.rdocumentation.org/packages/base/topics/list'>list</a></span><span class="keyword">(</span><span class="argument">type</span> <span class="argument">=</span> <span class="string">"SFO"</span><span class="keyword">,</span> <span class="argument">to</span> <span class="argument">=</span> <span class="string">"m1"</span><span class="keyword">,</span> <span class="argument">sink</span> <span class="argument">=</span> <span class="number">TRUE</span><span class="keyword">)</span><span class="keyword">,</span>
+ <span class="argument">m1</span> <span class="argument">=</span> <span class="functioncall"><a href='http://www.rdocumentation.org/packages/base/topics/list'>list</a></span><span class="keyword">(</span><span class="argument">type</span> <span class="argument">=</span> <span class="string">"SFO"</span><span class="keyword">)</span><span class="keyword">)</span></div>
+<strong class='message'>Successfully compiled differential equation model from auto-generated C code.</strong>
+<div class='input'><span class="comment"># Fit the model to the FOCUS example dataset D using defaults</span>
+<span class="symbol">fit</span> <span class="assignement">&lt;-</span> <span class="functioncall"><a href='mkinfit.html'>mkinfit</a></span><span class="keyword">(</span><span class="symbol">SFO_SFO</span><span class="keyword">,</span> <span class="symbol">FOCUS_2006_D</span><span class="keyword">,</span> <span class="argument">quiet</span> <span class="argument">=</span> <span class="number">TRUE</span><span class="keyword">)</span>
+<span class="functioncall"><a href='http://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span><span class="keyword">(</span><span class="symbol">fit</span><span class="keyword">,</span> <span class="argument">data</span><span class="argument">=</span><span class="number">FALSE</span><span class="keyword">)</span> <span class="comment"># See transformed and backtransformed parameters</span></div>
+<div class='output'>mkin version: 0.9.44.9000
+R version: 3.3.1
+Date of fit: Sat Sep 10 05:53:13 2016
+Date of summary: Sat Sep 10 05:53:13 2016
+
+Equations:
+d_parent = - k_parent_sink * parent - k_parent_m1 * parent
+d_m1 = + k_parent_m1 * parent - k_m1_sink * m1
+
+Model predictions using solution type deSolve
+
+Fitted with method Port using 153 model solutions performed in 0.634 s
+
+Weighting: none
+
+Starting values for parameters to be optimised:
+ value type
+parent_0 100.7500 state
+k_parent_sink 0.1000 deparm
+k_parent_m1 0.1001 deparm
+k_m1_sink 0.1002 deparm
+
+Starting values for the transformed parameters actually optimised:
+ value lower upper
+parent_0 100.750000 -Inf Inf
+log_k_parent_sink -2.302585 -Inf Inf
+log_k_parent_m1 -2.301586 -Inf Inf
+log_k_m1_sink -2.300587 -Inf Inf
+
+Fixed parameter values:
+ value type
+m1_0 0 state
+
+Optimised, transformed parameters with symmetric confidence intervals:
+ Estimate Std. Error Lower Upper
+parent_0 99.600 1.61400 96.330 102.900
+log_k_parent_sink -3.038 0.07826 -3.197 -2.879
+log_k_parent_m1 -2.980 0.04124 -3.064 -2.897
+log_k_m1_sink -5.248 0.13610 -5.523 -4.972
+
+Parameter correlation:
+ parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink
+parent_0 1.00000 0.6075 -0.06625 -0.1701
+log_k_parent_sink 0.60752 1.0000 -0.08740 -0.6253
+log_k_parent_m1 -0.06625 -0.0874 1.00000 0.4716
+log_k_m1_sink -0.17006 -0.6253 0.47163 1.0000
+
+Residual standard error: 3.211 on 36 degrees of freedom
+
+Backtransformed parameters:
+Confidence intervals for internally transformed parameters are asymmetric.
+t-test (unrealistically) based on the assumption of normal distribution
+for estimators of untransformed parameters.
+ Estimate t value Pr(&gt;t) Lower Upper
+parent_0 99.600000 61.720 2.024e-38 96.330000 1.029e+02
+k_parent_sink 0.047920 12.780 3.050e-15 0.040890 5.616e-02
+k_parent_m1 0.050780 24.250 3.407e-24 0.046700 5.521e-02
+k_m1_sink 0.005261 7.349 5.758e-09 0.003992 6.933e-03
+
+Chi2 error levels in percent:
+ err.min n.optim df
+All data 6.398 4 15
+parent 6.827 3 6
+m1 4.490 1 9
+
+Resulting formation fractions:
+ ff
+parent_sink 0.4855
+parent_m1 0.5145
+m1_sink 1.0000
+
+Estimated disappearance times:
+ DT50 DT90
+parent 7.023 23.33
+m1 131.761 437.70
+</div>
+<div class='input'>
+<span class="comment">## Not run: ------------------------------------</span>
+<span class="comment"># fit.2 &lt;- mkinfit(SFO_SFO, FOCUS_2006_D, transform_rates = FALSE)</span>
+<span class="comment"># summary(fit.2, data=FALSE) </span>
+<span class="comment">## ---------------------------------------------</span>
+
+<span class="symbol">initials</span> <span class="assignement">&lt;-</span> <span class="symbol">fit</span><span class="keyword">$</span><span class="symbol">start</span><span class="keyword">$</span><span class="symbol">value</span>
+<span class="functioncall"><a href='http://www.rdocumentation.org/packages/base/topics/names'>names</a></span><span class="keyword">(</span><span class="symbol">initials</span><span class="keyword">)</span> <span class="assignement">&lt;-</span> <span class="functioncall"><a href='http://www.rdocumentation.org/packages/base/topics/colnames'>rownames</a></span><span class="keyword">(</span><span class="symbol">fit</span><span class="keyword">$</span><span class="symbol">start</span><span class="keyword">)</span>
+<span class="symbol">transformed</span> <span class="assignement">&lt;-</span> <span class="symbol">fit</span><span class="keyword">$</span><span class="symbol">start_transformed</span><span class="keyword">$</span><span class="symbol">value</span>
+<span class="functioncall"><a href='http://www.rdocumentation.org/packages/base/topics/names'>names</a></span><span class="keyword">(</span><span class="symbol">transformed</span><span class="keyword">)</span> <span class="assignement">&lt;-</span> <span class="functioncall"><a href='http://www.rdocumentation.org/packages/base/topics/colnames'>rownames</a></span><span class="keyword">(</span><span class="symbol">fit</span><span class="keyword">$</span><span class="symbol">start_transformed</span><span class="keyword">)</span>
+<span class="functioncall"><a href='transform_odeparms.html'>transform_odeparms</a></span><span class="keyword">(</span><span class="symbol">initials</span><span class="keyword">,</span> <span class="symbol">SFO_SFO</span><span class="keyword">)</span></div>
+<div class='output'> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink
+ 100.750000 -2.302585 -2.301586 -2.300587
+</div>
+<div class='input'><span class="functioncall"><a href='transform_odeparms.html'>backtransform_odeparms</a></span><span class="keyword">(</span><span class="symbol">transformed</span><span class="keyword">,</span> <span class="symbol">SFO_SFO</span><span class="keyword">)</span></div>
+<div class='output'> parent_0 k_parent_sink k_parent_m1 k_m1_sink
+ 100.7500 0.1000 0.1001 0.1002
+</div>
+<div class='input'>
+<span class="comment">## Not run: ------------------------------------</span>
+<span class="comment"># # The case of formation fractions</span>
+<span class="comment"># SFO_SFO.ff &lt;- mkinmod(</span>
+<span class="comment"># parent = list(type = "SFO", to = "m1", sink = TRUE),</span>
+<span class="comment"># m1 = list(type = "SFO"),</span>
+<span class="comment"># use_of_ff = "max")</span>
+<span class="comment"># </span>
+<span class="comment"># fit.ff &lt;- mkinfit(SFO_SFO.ff, FOCUS_2006_D)</span>
+<span class="comment"># summary(fit.ff, data = FALSE)</span>
+<span class="comment"># initials &lt;- c("f_parent_to_m1" = 0.5)</span>
+<span class="comment"># transformed &lt;- transform_odeparms(initials, SFO_SFO.ff)</span>
+<span class="comment"># backtransform_odeparms(transformed, SFO_SFO.ff)</span>
+<span class="comment"># </span>
+<span class="comment"># # And without sink</span>
+<span class="comment"># SFO_SFO.ff.2 &lt;- mkinmod(</span>
+<span class="comment"># parent = list(type = "SFO", to = "m1", sink = FALSE),</span>
+<span class="comment"># m1 = list(type = "SFO"),</span>
+<span class="comment"># use_of_ff = "max")</span>
+<span class="comment"># </span>
+<span class="comment"># </span>
+<span class="comment"># fit.ff.2 &lt;- mkinfit(SFO_SFO.ff.2, FOCUS_2006_D)</span>
+<span class="comment"># summary(fit.ff.2, data = FALSE)</span>
+<span class="comment">## ---------------------------------------------</span></div></pre>
+ </div>
+ <div class="span4 sidebar">
+ <!-- <ul>
+ <li>transform_odeparms</li><li>backtransform_odeparms</li>
+ </ul>
+ <ul>
+ <li> manip </li>
+ </ul> -->
+
+
+
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+
+ </div>
+</div>
+
+ <footer>
+ <p class="pull-right"><a href="#">Back to top</a></p>
+<p>Built by <a href="https://github.com/hadley/staticdocs">staticdocs</a>. Styled with <a href="https://getbootstrap.com/2.0.4/">bootstrap</a>.</p>
+ </footer>
+ </div>
+ </body>
+</html> \ No newline at end of file

Contact - Imprint