diff options
Diffstat (limited to 'docs/reference/transform_odeparms.html')
-rw-r--r-- | docs/reference/transform_odeparms.html | 272 |
1 files changed, 39 insertions, 233 deletions
diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index bbf15a41..630a5103 100644 --- a/docs/reference/transform_odeparms.html +++ b/docs/reference/transform_odeparms.html @@ -18,12 +18,27 @@ <!-- Font Awesome icons --> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js" integrity="sha384-cV+rhyOuRHc9Ub/91rihWcGmMmCXDeksTtCihMupQHSsi8GIIRDG0ThDc3HGQFJ3" crossorigin="anonymous"></script> <!-- pkgdown --> <link href="../pkgdown.css" rel="stylesheet"> <script src="../jquery.sticky-kit.min.js"></script> <script src="../pkgdown.js"></script> + + +<meta property="og:title" content="Functions to transform and backtransform kinetic parameters for fitting — transform_odeparms" /> +<meta property="og:description" content="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 ilr transformation is used. +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 mkinfit." /> +<meta name="twitter:card" content="summary" /> <!-- mathjax --> <script src='https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> @@ -70,6 +85,9 @@ <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> </li> <li> + <a href="../articles/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> <a href="../articles/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> </li> <li> @@ -83,12 +101,7 @@ </ul> <ul class="nav navbar-nav navbar-right"> - <li> - <a href="http://github.com/jranke/mkin"> - <span class="fa fa-github fa-lg"></span> - - </a> -</li> + </ul> </div><!--/.nav-collapse --> </div><!--/.container --> @@ -170,10 +183,10 @@ <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"m1"</span>, <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>), <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>))</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='co'># Fit the model to the FOCUS example dataset D using defaults</span> <span class='no'>fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'>summary</span>(<span class='no'>fit</span>, <span class='kw'>data</span><span class='kw'>=</span><span class='fl'>FALSE</span>) <span class='co'># See transformed and backtransformed parameters</span></div><div class='output co'>#> mkin version: 0.9.46 -#> R version: 3.4.1 -#> Date of fit: Sat Jul 29 15:15:35 2017 -#> Date of summary: Sat Jul 29 15:15:35 2017 +<span class='fu'>summary</span>(<span class='no'>fit</span>, <span class='kw'>data</span><span class='kw'>=</span><span class='fl'>FALSE</span>) <span class='co'># See transformed and backtransformed parameters</span></div><div class='output co'>#> mkin version used for fitting: 0.9.47.1 +#> R version used for fitting: 3.4.3 +#> Date of fit: Thu Mar 1 14:26:28 2018 +#> Date of summary: Thu Mar 1 14:26:28 2018 #> #> Equations: #> d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent @@ -181,7 +194,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 153 model solutions performed in 0.608 s +#> Fitted with method Port using 153 model solutions performed in 0.571 s #> #> Weighting: none #> @@ -245,84 +258,10 @@ #> DT50 DT90 #> parent 7.023 23.33 #> m1 131.761 437.70</div><div class='input'> - +</div><span class='co'># NOT RUN {</span> <span class='no'>fit.2</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>transform_rates</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'>summary</span>(<span class='no'>fit.2</span>, <span class='kw'>data</span><span class='kw'>=</span><span class='fl'>FALSE</span>)</div><div class='output co'>#> mkin version: 0.9.46 -#> R version: 3.4.1 -#> Date of fit: Sat Jul 29 15:15:36 2017 -#> Date of summary: Sat Jul 29 15:15:36 2017 -#> -#> Equations: -#> d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent -#> d_m1/dt = + k_parent_m1 * parent - k_m1_sink * m1 -#> -#> Model predictions using solution type deSolve -#> -#> Fitted with method Port using 352 model solutions performed in 1.401 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.7500 -Inf Inf -#> k_parent_sink 0.1000 0 Inf -#> k_parent_m1 0.1001 0 Inf -#> k_m1_sink 0.1002 0 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.600000 1.6140000 96.330000 1.029e+02 -#> k_parent_sink 0.047920 0.0037500 0.040310 5.553e-02 -#> k_parent_m1 0.050780 0.0020940 0.046530 5.502e-02 -#> k_m1_sink 0.005261 0.0007159 0.003809 6.713e-03 -#> -#> Parameter correlation: -#> parent_0 k_parent_sink k_parent_m1 k_m1_sink -#> parent_0 1.00000 0.6075 -0.06625 -0.1701 -#> k_parent_sink 0.60752 1.0000 -0.08740 -0.6253 -#> k_parent_m1 -0.06625 -0.0874 1.00000 0.4716 -#> k_m1_sink -0.17006 -0.6253 0.47164 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(>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.040310 5.553e-02 -#> k_parent_m1 0.050780 24.250 3.407e-24 0.046530 5.502e-02 -#> k_m1_sink 0.005261 7.349 5.758e-09 0.003809 6.713e-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='fu'>summary</span>(<span class='no'>fit.2</span>, <span class='kw'>data</span><span class='kw'>=</span><span class='fl'>FALSE</span>) +<span class='co'># }</span><div class='input'> <span class='no'>initials</span> <span class='kw'><-</span> <span class='no'>fit</span>$<span class='no'>start</span>$<span class='no'>value</span> <span class='fu'>names</span>(<span class='no'>initials</span>) <span class='kw'><-</span> <span class='fu'>rownames</span>(<span class='no'>fit</span>$<span class='no'>start</span>) <span class='no'>transformed</span> <span class='kw'><-</span> <span class='no'>fit</span>$<span class='no'>start_transformed</span>$<span class='no'>value</span> @@ -330,162 +269,29 @@ <span class='fu'>transform_odeparms</span>(<span class='no'>initials</span>, <span class='no'>SFO_SFO</span>)</div><div class='output co'>#> 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='fu'>backtransform_odeparms</span>(<span class='no'>transformed</span>, <span class='no'>SFO_SFO</span>)</div><div class='output co'>#> parent_0 k_parent_sink k_parent_m1 k_m1_sink #> 100.7500 0.1000 0.1001 0.1002 </div><div class='input'> - +</div><span class='co'># NOT RUN {</span> <span class='co'># The case of formation fractions</span> <span class='no'>SFO_SFO.ff</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>( <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"m1"</span>, <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>), <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), - <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> + <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>) + <span class='no'>fit.ff</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'>summary</span>(<span class='no'>fit.ff</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</div><div class='output co'>#> mkin version: 0.9.46 -#> R version: 3.4.1 -#> Date of fit: Sat Jul 29 15:15:37 2017 -#> Date of summary: Sat Jul 29 15:15:37 2017 -#> -#> Equations: -#> d_parent/dt = - k_parent * parent -#> d_m1/dt = + f_parent_to_m1 * k_parent * parent - k_m1 * m1 -#> -#> Model predictions using solution type deSolve -#> -#> Fitted with method Port using 185 model solutions performed in 0.772 s -#> -#> Weighting: none -#> -#> Starting values for parameters to be optimised: -#> value type -#> parent_0 100.7500 state -#> k_parent 0.1000 deparm -#> k_m1 0.1001 deparm -#> f_parent_to_m1 0.5000 deparm -#> -#> Starting values for the transformed parameters actually optimised: -#> value lower upper -#> parent_0 100.750000 -Inf Inf -#> log_k_parent -2.302585 -Inf Inf -#> log_k_m1 -2.301586 -Inf Inf -#> f_parent_ilr_1 0.000000 -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.60000 1.61400 96.3300 102.9000 -#> log_k_parent -2.31600 0.04187 -2.4010 -2.2310 -#> log_k_m1 -5.24800 0.13610 -5.5230 -4.9720 -#> f_parent_ilr_1 0.04096 0.06477 -0.0904 0.1723 -#> -#> Parameter correlation: -#> parent_0 log_k_parent log_k_m1 f_parent_ilr_1 -#> parent_0 1.0000 0.5178 -0.1701 -0.5489 -#> log_k_parent 0.5178 1.0000 -0.3285 -0.5451 -#> log_k_m1 -0.1701 -0.3285 1.0000 0.7466 -#> f_parent_ilr_1 -0.5489 -0.5451 0.7466 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(>t) Lower Upper -#> parent_0 99.600000 61.720 2.024e-38 96.330000 1.029e+02 -#> k_parent 0.098700 23.880 5.701e-24 0.090660 1.074e-01 -#> k_m1 0.005261 7.349 5.758e-09 0.003992 6.933e-03 -#> f_parent_to_m1 0.514500 22.490 4.374e-23 0.468100 5.606e-01 -#> -#> Chi2 error levels in percent: -#> err.min n.optim df -#> All data 6.398 4 15 -#> parent 6.459 2 7 -#> m1 4.690 2 8 -#> -#> Resulting formation fractions: -#> ff -#> parent_m1 0.5145 -#> parent_sink 0.4855 -#> -#> Estimated disappearance times: -#> DT50 DT90 -#> parent 7.023 23.33 -#> m1 131.761 437.70</div><div class='input'><span class='no'>initials</span> <span class='kw'><-</span> <span class='fu'>c</span>(<span class='st'>"f_parent_to_m1"</span> <span class='kw'>=</span> <span class='fl'>0.5</span>) +<span class='fu'>summary</span>(<span class='no'>fit.ff</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>) +<span class='no'>initials</span> <span class='kw'><-</span> <span class='fu'>c</span>(<span class='st'>"f_parent_to_m1"</span> <span class='kw'>=</span> <span class='fl'>0.5</span>) <span class='no'>transformed</span> <span class='kw'><-</span> <span class='fu'>transform_odeparms</span>(<span class='no'>initials</span>, <span class='no'>SFO_SFO.ff</span>) -<span class='fu'>backtransform_odeparms</span>(<span class='no'>transformed</span>, <span class='no'>SFO_SFO.ff</span>)</div><div class='output co'>#> f_parent_to_m1 -#> 0.5 </div><div class='input'> +<span class='fu'>backtransform_odeparms</span>(<span class='no'>transformed</span>, <span class='no'>SFO_SFO.ff</span>) + <span class='co'># And without sink</span> <span class='no'>SFO_SFO.ff.2</span> <span class='kw'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>( <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"m1"</span>, <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>), <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), - <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> + <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>) + <span class='no'>fit.ff.2</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO.ff.2</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) -<span class='fu'>summary</span>(<span class='no'>fit.ff.2</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</div><div class='output co'>#> mkin version: 0.9.46 -#> R version: 3.4.1 -#> Date of fit: Sat Jul 29 15:15:38 2017 -#> Date of summary: Sat Jul 29 15:15:38 2017 -#> -#> Equations: -#> d_parent/dt = - k_parent * parent -#> d_m1/dt = + k_parent * parent - k_m1 * m1 -#> -#> Model predictions using solution type deSolve -#> -#> Fitted with method Port using 104 model solutions performed in 0.416 s -#> -#> Weighting: none -#> -#> Starting values for parameters to be optimised: -#> value type -#> parent_0 100.7500 state -#> k_parent 0.1000 deparm -#> k_m1 0.1001 deparm -#> -#> Starting values for the transformed parameters actually optimised: -#> value lower upper -#> parent_0 100.750000 -Inf Inf -#> log_k_parent -2.302585 -Inf Inf -#> log_k_m1 -2.301586 -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 84.790 2.96500 78.78 90.800 -#> log_k_parent -2.756 0.08088 -2.92 -2.593 -#> log_k_m1 -4.214 0.11150 -4.44 -3.988 -#> -#> Parameter correlation: -#> parent_0 log_k_parent log_k_m1 -#> parent_0 1.0000 0.11059 0.46156 -#> log_k_parent 0.1106 1.00000 0.06274 -#> log_k_m1 0.4616 0.06274 1.00000 -#> -#> Residual standard error: 8.333 on 37 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(>t) Lower Upper -#> parent_0 84.79000 28.600 3.938e-27 78.78000 90.80000 -#> k_parent 0.06352 12.360 5.237e-15 0.05392 0.07483 -#> k_m1 0.01478 8.966 4.114e-11 0.01179 0.01853 -#> -#> Chi2 error levels in percent: -#> err.min n.optim df -#> All data 19.66 3 16 -#> parent 17.56 2 7 -#> m1 18.71 1 9 -#> -#> Estimated disappearance times: -#> DT50 DT90 -#> parent 10.91 36.25 -#> m1 46.89 155.75</div><div class='input'> -</div></pre> +<span class='fu'>summary</span>(<span class='no'>fit.ff.2</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>) +<span class='co'># }</span></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> <h2>Contents</h2> @@ -510,7 +316,7 @@ </div> <div class="pkgdown"> - <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p> + <p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p> </div> </footer> |