aboutsummaryrefslogblamecommitdiff
path: root/docs/reference/transform_odeparms.html
blob: 08fbf368629a1bcf92f9e93b04e90f2d4ba77643 (plain) (tree)
1
2
3
4
5
6
7
8
9







                                                                      
                                                                                                                      


                                                                                                                                                                               
                  
 
                                                                                                                                                                                                                







                                                                                                                                                                                                                      
                                                   











                                                                                                      
                                                    
              
                                                                            











                                                                                                         
                                                 

     



                                               

           
      
                                              





                                            



                                
 


               


                                 
                                                                                    
          
 
    
                                                                               



                                                                          
                                                                                   


                                                                                   
                                                                                                 






                                                                                                                                                                                                                                
                                                                                                










                                                                              
                                                                                                       
                                                                            

                                                                                          




                                                                             

                                                                            






                                                                                    

                                                                             
                                                                    
                                                                                                



                   
                                                                                   
 
                                                                                
                                 
    
 
                                                                                            
                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                         
                             

                                                

                

                                                                   


                                                    
                                                                            





























































                                                                                
                                                    





















































































































































































































                                                                                                                                                                                                                                                                                                                                                                   





                                                                                                                                                                                                                        

                                                                                                                                                                                                                                                                                                                      























































































































































































































































































                                                                                                                                                                                                                                                                                                                                                       
        









                                                         







                   
                             
                                     





                                                                                




               
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html>
  <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>Functions to transform and backtransform kinetic parameters for fitting — transform_odeparms • mkin</title>

<!-- jquery -->
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script>
<!-- Bootstrap -->

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<!-- 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">


<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../jquery.sticky-kit.min.js"></script>
<script src="../pkgdown.js"></script>

<!-- mathjax -->
<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></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>
    <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">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="../index.html">mkin</a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li>
  <a href="../reference/index.html">Reference</a>
</li>
<li>
  <a href="../articles/index.html">Articles</a>
</li>
<li>
  <a href="../news/index.html">News</a>
</li>
      </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 -->
</div><!--/.navbar -->

      
      </header>

      <div class="row">
  <div class="col-md-9 contents">
    <div class="page-header">
    <h1>Functions to transform and backtransform kinetic parameters for fitting</h1>
    </div>

    
    <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>
    

    <pre><span class='fu'>transform_odeparms</span>(<span class='no'>parms</span>, <span class='no'>mkinmod</span>,
                   <span class='kw'>transform_rates</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>transform_fractions</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='fu'>backtransform_odeparms</span>(<span class='no'>transparms</span>, <span class='no'>mkinmod</span>,
                       <span class='kw'>transform_rates</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>transform_fractions</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</pre>
    
    <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Arguments</h2>
    <dl class="dl-horizontal">
      <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>
    
    <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>

    <p>A vector of transformed or backtransformed parameters with the same names
  as the original parameters.</p>
    

    <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
    <pre class="examples"><div class='input'><span class='no'>SFO_SFO</span> <span class='kw'>&lt;-</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>))</div><div class='output co'>#&gt; <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'>&lt;-</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'>#&gt; mkin version:    0.9.44.9000 
#&gt; R version:       3.3.2 
#&gt; Date of fit:     Fri Nov 18 15:20:49 2016 
#&gt; Date of summary: Fri Nov 18 15:20:49 2016 
#&gt; 
#&gt; Equations:
#&gt; d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
#&gt; d_m1/dt = + k_parent_m1 * parent - k_m1_sink * m1
#&gt; 
#&gt; Model predictions using solution type deSolve 
#&gt; 
#&gt; Fitted with method Port using 153 model solutions performed in 0.681 s
#&gt; 
#&gt; Weighting: none
#&gt; 
#&gt; Starting values for parameters to be optimised:
#&gt;                  value   type
#&gt; parent_0      100.7500  state
#&gt; k_parent_sink   0.1000 deparm
#&gt; k_parent_m1     0.1001 deparm
#&gt; k_m1_sink       0.1002 deparm
#&gt; 
#&gt; Starting values for the transformed parameters actually optimised:
#&gt;                        value lower upper
#&gt; parent_0          100.750000  -Inf   Inf
#&gt; log_k_parent_sink  -2.302585  -Inf   Inf
#&gt; log_k_parent_m1    -2.301586  -Inf   Inf
#&gt; log_k_m1_sink      -2.300587  -Inf   Inf
#&gt; 
#&gt; Fixed parameter values:
#&gt;      value  type
#&gt; m1_0     0 state
#&gt; 
#&gt; Optimised, transformed parameters with symmetric confidence intervals:
#&gt;                   Estimate Std. Error  Lower   Upper
#&gt; parent_0            99.600    1.61400 96.330 102.900
#&gt; log_k_parent_sink   -3.038    0.07826 -3.197  -2.879
#&gt; log_k_parent_m1     -2.980    0.04124 -3.064  -2.897
#&gt; log_k_m1_sink       -5.248    0.13610 -5.523  -4.972
#&gt; 
#&gt; Parameter correlation:
#&gt;                   parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink
#&gt; parent_0           1.00000            0.6075        -0.06625       -0.1701
#&gt; log_k_parent_sink  0.60752            1.0000        -0.08740       -0.6253
#&gt; log_k_parent_m1   -0.06625           -0.0874         1.00000        0.4716
#&gt; log_k_m1_sink     -0.17006           -0.6253         0.47163        1.0000
#&gt; 
#&gt; Residual standard error: 3.211 on 36 degrees of freedom
#&gt; 
#&gt; Backtransformed parameters:
#&gt; Confidence intervals for internally transformed parameters are asymmetric.
#&gt; t-test (unrealistically) based on the assumption of normal distribution
#&gt; for estimators of untransformed parameters.
#&gt;                Estimate t value    Pr(&gt;t)     Lower     Upper
#&gt; parent_0      99.600000  61.720 2.024e-38 96.330000 1.029e+02
#&gt; k_parent_sink  0.047920  12.780 3.050e-15  0.040890 5.616e-02
#&gt; k_parent_m1    0.050780  24.250 3.407e-24  0.046700 5.521e-02
#&gt; k_m1_sink      0.005261   7.349 5.758e-09  0.003992 6.933e-03
#&gt; 
#&gt; Chi2 error levels in percent:
#&gt;          err.min n.optim df
#&gt; All data   6.398       4 15
#&gt; parent     6.827       3  6
#&gt; m1         4.490       1  9
#&gt; 
#&gt; Resulting formation fractions:
#&gt;                 ff
#&gt; parent_sink 0.4855
#&gt; parent_m1   0.5145
#&gt; m1_sink     1.0000
#&gt; 
#&gt; Estimated disappearance times:
#&gt;           DT50   DT90
#&gt; parent   7.023  23.33
#&gt; m1     131.761 437.70</div><div class='input'>

<span class='no'>fit.2</span> <span class='kw'>&lt;-</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>)</div><div class='output co'>#&gt; Model cost at call  1 :  18915.53 
#&gt; Model cost at call  2 :  18915.53 
#&gt; Model cost at call  7 :  10205.88 
#&gt; Model cost at call  10 :  10205.05 
#&gt; Model cost at call  13 :  8136.609 
#&gt; Model cost at call  18 :  2504.352 
#&gt; Model cost at call  20 :  2504.35 
#&gt; Model cost at call  22 :  2504.285 
#&gt; Model cost at call  25 :  1747.542 
#&gt; Model cost at call  27 :  1745.941 
#&gt; Model cost at call  29 :  1745.431 
#&gt; Model cost at call  30 :  1341.034 
#&gt; Model cost at call  34 :  1341.034 
#&gt; Model cost at call  35 :  1032.65 
#&gt; Model cost at call  39 :  1032.649 
#&gt; Model cost at call  40 :  919.9522 
#&gt; Model cost at call  42 :  919.952 
#&gt; Model cost at call  44 :  919.9518 
#&gt; Model cost at call  45 :  903.8272 
#&gt; Model cost at call  47 :  903.827 
#&gt; Model cost at call  49 :  903.8268 
#&gt; Model cost at call  50 :  780.8699 
#&gt; Model cost at call  52 :  780.8698 
#&gt; Model cost at call  54 :  780.8697 
#&gt; Model cost at call  55 :  734.3043 
#&gt; Model cost at call  57 :  734.3036 
#&gt; Model cost at call  60 :  717.8438 
#&gt; Model cost at call  67 :  676.3908 
#&gt; Model cost at call  68 :  676.3907 
#&gt; Model cost at call  69 :  676.3906 
#&gt; Model cost at call  71 :  676.3885 
#&gt; Model cost at call  72 :  642.2738 
#&gt; Model cost at call  73 :  642.2738 
#&gt; Model cost at call  76 :  642.2738 
#&gt; Model cost at call  77 :  604.7128 
#&gt; Model cost at call  78 :  604.7126 
#&gt; Model cost at call  82 :  560.1285 
#&gt; Model cost at call  83 :  560.1285 
#&gt; Model cost at call  86 :  560.1285 
#&gt; Model cost at call  87 :  521.6932 
#&gt; Model cost at call  88 :  521.6932 
#&gt; Model cost at call  91 :  521.6931 
#&gt; Model cost at call  92 :  453.6483 
#&gt; Model cost at call  93 :  453.6483 
#&gt; Model cost at call  96 :  453.6483 
#&gt; Model cost at call  98 :  422.5498 
#&gt; Model cost at call  102 :  422.5497 
#&gt; Model cost at call  106 :  413.6426 
#&gt; Model cost at call  108 :  413.6416 
#&gt; Model cost at call  111 :  407.4639 
#&gt; Model cost at call  113 :  407.4639 
#&gt; Model cost at call  115 :  407.4639 
#&gt; Model cost at call  116 :  403.6974 
#&gt; Model cost at call  118 :  403.6973 
#&gt; Model cost at call  120 :  403.6973 
#&gt; Model cost at call  121 :  396.004 
#&gt; Model cost at call  123 :  396.004 
#&gt; Model cost at call  126 :  391.2533 
#&gt; Model cost at call  128 :  391.2533 
#&gt; Model cost at call  130 :  391.2533 
#&gt; Model cost at call  131 :  388.4056 
#&gt; Model cost at call  133 :  388.4056 
#&gt; Model cost at call  135 :  388.4055 
#&gt; Model cost at call  137 :  384.0739 
#&gt; Model cost at call  139 :  384.0734 
#&gt; Model cost at call  143 :  383.6352 
#&gt; Model cost at call  145 :  383.635 
#&gt; Model cost at call  148 :  381.1342 
#&gt; Model cost at call  152 :  381.1342 
#&gt; Model cost at call  153 :  380.1443 
#&gt; Model cost at call  157 :  380.1443 
#&gt; Model cost at call  158 :  378.5615 
#&gt; Model cost at call  162 :  378.5614 
#&gt; Model cost at call  164 :  378.4583 
#&gt; Model cost at call  168 :  378.4583 
#&gt; Model cost at call  169 :  377.7047 
#&gt; Model cost at call  173 :  377.7047 
#&gt; Model cost at call  175 :  377.7042 
#&gt; Model cost at call  178 :  377.7042 
#&gt; Model cost at call  179 :  377.7042 
#&gt; Model cost at call  180 :  377.1553 
#&gt; Model cost at call  182 :  377.1553 
#&gt; Model cost at call  183 :  377.1553 
#&gt; Model cost at call  185 :  377.0866 
#&gt; Model cost at call  187 :  377.0866 
#&gt; Model cost at call  190 :  377.0288 
#&gt; Model cost at call  194 :  377.0288 
#&gt; Model cost at call  196 :  376.9814 
#&gt; Model cost at call  200 :  376.9814 
#&gt; Model cost at call  201 :  376.9488 
#&gt; Model cost at call  203 :  376.9488 
#&gt; Model cost at call  205 :  376.9488 
#&gt; Model cost at call  206 :  376.9184 
#&gt; Model cost at call  208 :  376.9184 
#&gt; Model cost at call  211 :  376.9095 
#&gt; Model cost at call  213 :  376.9095 
#&gt; Model cost at call  215 :  376.9095 
#&gt; Model cost at call  216 :  376.901 
#&gt; Model cost at call  218 :  376.901 
#&gt; Model cost at call  221 :  376.8936 
#&gt; Model cost at call  225 :  376.8936 
#&gt; Model cost at call  226 :  376.8848 
#&gt; Model cost at call  227 :  376.8608 
#&gt; Model cost at call  228 :  376.7665 
#&gt; Model cost at call  229 :  376.4162 
#&gt; Model cost at call  230 :  375.4439 
#&gt; Model cost at call  235 :  375.4439 
#&gt; Model cost at call  237 :  375.2281 
#&gt; Model cost at call  241 :  375.2281 
#&gt; Model cost at call  242 :  374.3381 
#&gt; Model cost at call  244 :  374.3381 
#&gt; Model cost at call  251 :  374.2632 
#&gt; Model cost at call  253 :  374.2632 
#&gt; Model cost at call  256 :  374.2391 
#&gt; Model cost at call  257 :  374.2247 
#&gt; Model cost at call  259 :  374.2247 
#&gt; Model cost at call  261 :  374.2247 
#&gt; Model cost at call  263 :  374.2024 
#&gt; Model cost at call  266 :  374.2024 
#&gt; Model cost at call  270 :  374.1952 
#&gt; Model cost at call  274 :  374.1952 
#&gt; Model cost at call  275 :  374.186 
#&gt; Model cost at call  279 :  374.186 
#&gt; Model cost at call  280 :  374.1724 
#&gt; Model cost at call  281 :  374.156 
#&gt; Model cost at call  282 :  374.0763 
#&gt; Model cost at call  283 :  373.7692 
#&gt; Model cost at call  284 :  372.729 
#&gt; Model cost at call  285 :  371.4251 
#&gt; Model cost at call  287 :  371.4251 
#&gt; Model cost at call  290 :  371.2142 
#&gt; Model cost at call  291 :  371.2142 
#&gt; Model cost at call  292 :  371.2142 
#&gt; Model cost at call  295 :  371.2134 
#&gt; Model cost at call  298 :  371.2134 
#&gt; Model cost at call  300 :  371.2134 
#&gt; Model cost at call  309 :  371.2134 
#&gt; Model cost at call  320 :  371.2134 
#&gt; Optimisation by method Port successfully terminated.</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>)</div><div class='output co'>#&gt; mkin version:    0.9.44.9000 
#&gt; R version:       3.3.2 
#&gt; Date of fit:     Fri Nov 18 15:20:51 2016 
#&gt; Date of summary: Fri Nov 18 15:20:51 2016 
#&gt; 
#&gt; Equations:
#&gt; d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
#&gt; d_m1/dt = + k_parent_m1 * parent - k_m1_sink * m1
#&gt; 
#&gt; Model predictions using solution type deSolve 
#&gt; 
#&gt; Fitted with method Port using 327 model solutions performed in 1.34 s
#&gt; 
#&gt; Weighting: none
#&gt; 
#&gt; Starting values for parameters to be optimised:
#&gt;                  value   type
#&gt; parent_0      100.7500  state
#&gt; k_parent_sink   0.1000 deparm
#&gt; k_parent_m1     0.1001 deparm
#&gt; k_m1_sink       0.1002 deparm
#&gt; 
#&gt; Starting values for the transformed parameters actually optimised:
#&gt;                  value lower upper
#&gt; parent_0      100.7500  -Inf   Inf
#&gt; k_parent_sink   0.1000     0   Inf
#&gt; k_parent_m1     0.1001     0   Inf
#&gt; k_m1_sink       0.1002     0   Inf
#&gt; 
#&gt; Fixed parameter values:
#&gt;      value  type
#&gt; m1_0     0 state
#&gt; 
#&gt; Optimised, transformed parameters with symmetric confidence intervals:
#&gt;                Estimate Std. Error     Lower     Upper
#&gt; parent_0      99.600000  1.6140000 96.330000 1.029e+02
#&gt; k_parent_sink  0.047920  0.0037500  0.040310 5.553e-02
#&gt; k_parent_m1    0.050780  0.0020940  0.046530 5.502e-02
#&gt; k_m1_sink      0.005261  0.0007159  0.003809 6.713e-03
#&gt; 
#&gt; Parameter correlation:
#&gt;               parent_0 k_parent_sink k_parent_m1 k_m1_sink
#&gt; parent_0       1.00000        0.6075    -0.06625   -0.1701
#&gt; k_parent_sink  0.60752        1.0000    -0.08740   -0.6253
#&gt; k_parent_m1   -0.06625       -0.0874     1.00000    0.4716
#&gt; k_m1_sink     -0.17006       -0.6253     0.47164    1.0000
#&gt; 
#&gt; Residual standard error: 3.211 on 36 degrees of freedom
#&gt; 
#&gt; Backtransformed parameters:
#&gt; Confidence intervals for internally transformed parameters are asymmetric.
#&gt; t-test (unrealistically) based on the assumption of normal distribution
#&gt; for estimators of untransformed parameters.
#&gt;                Estimate t value    Pr(&gt;t)     Lower     Upper
#&gt; parent_0      99.600000  61.720 2.024e-38 96.330000 1.029e+02
#&gt; k_parent_sink  0.047920  12.780 3.050e-15  0.040310 5.553e-02
#&gt; k_parent_m1    0.050780  24.250 3.407e-24  0.046530 5.502e-02
#&gt; k_m1_sink      0.005261   7.349 5.758e-09  0.003809 6.713e-03
#&gt; 
#&gt; Chi2 error levels in percent:
#&gt;          err.min n.optim df
#&gt; All data   6.398       4 15
#&gt; parent     6.827       3  6
#&gt; m1         4.490       1  9
#&gt; 
#&gt; Resulting formation fractions:
#&gt;                 ff
#&gt; parent_sink 0.4855
#&gt; parent_m1   0.5145
#&gt; m1_sink     1.0000
#&gt; 
#&gt; Estimated disappearance times:
#&gt;           DT50   DT90
#&gt; parent   7.023  23.33
#&gt; m1     131.761 437.70</div><div class='input'>

<span class='no'>initials</span> <span class='kw'>&lt;-</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'>&lt;-</span> <span class='fu'>rownames</span>(<span class='no'>fit</span>$<span class='no'>start</span>)
<span class='no'>transformed</span> <span class='kw'>&lt;-</span> <span class='no'>fit</span>$<span class='no'>start_transformed</span>$<span class='no'>value</span>
<span class='fu'>names</span>(<span class='no'>transformed</span>) <span class='kw'>&lt;-</span> <span class='fu'>rownames</span>(<span class='no'>fit</span>$<span class='no'>start_transformed</span>)
<span class='fu'>transform_odeparms</span>(<span class='no'>initials</span>, <span class='no'>SFO_SFO</span>)</div><div class='output co'>#&gt;          parent_0 log_k_parent_sink   log_k_parent_m1     log_k_m1_sink 
#&gt;        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'>#&gt;      parent_0 k_parent_sink   k_parent_m1     k_m1_sink 
#&gt;      100.7500        0.1000        0.1001        0.1002 </div><div class='input'>

<span class='co'># The case of formation fractions</span>
<span class='no'>SFO_SFO.ff</span> <span class='kw'>&lt;-</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'>#&gt; <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'>
<span class='no'>fit.ff</span> <span class='kw'>&lt;-</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>)</div><div class='output co'>#&gt; Model cost at call  1 :  15156.12 
#&gt; Model cost at call  2 :  15156.12 
#&gt; Model cost at call  6 :  8243.644 
#&gt; Model cost at call  12 :  6290.714 
#&gt; Model cost at call  13 :  6290.684 
#&gt; Model cost at call  15 :  6290.453 
#&gt; Model cost at call  18 :  1700.75 
#&gt; Model cost at call  20 :  1700.612 
#&gt; Model cost at call  24 :  1190.923 
#&gt; Model cost at call  26 :  1190.922 
#&gt; Model cost at call  29 :  1017.417 
#&gt; Model cost at call  31 :  1017.417 
#&gt; Model cost at call  33 :  1017.416 
#&gt; Model cost at call  34 :  644.0471 
#&gt; Model cost at call  36 :  644.0469 
#&gt; Model cost at call  38 :  644.0468 
#&gt; Model cost at call  39 :  590.5024 
#&gt; Model cost at call  41 :  590.5021 
#&gt; Model cost at call  43 :  590.5015 
#&gt; Model cost at call  44 :  543.2187 
#&gt; Model cost at call  45 :  543.2183 
#&gt; Model cost at call  46 :  543.2182 
#&gt; Model cost at call  50 :  391.348 
#&gt; Model cost at call  51 :  391.3479 
#&gt; Model cost at call  56 :  386.4789 
#&gt; Model cost at call  58 :  386.4789 
#&gt; Model cost at call  60 :  386.4779 
#&gt; Model cost at call  61 :  384.0686 
#&gt; Model cost at call  63 :  384.0686 
#&gt; Model cost at call  66 :  382.7812 
#&gt; Model cost at call  68 :  382.7812 
#&gt; Model cost at call  70 :  382.7812 
#&gt; Model cost at call  71 :  378.9272 
#&gt; Model cost at call  73 :  378.9272 
#&gt; Model cost at call  75 :  378.9272 
#&gt; Model cost at call  76 :  377.4846 
#&gt; Model cost at call  78 :  377.4846 
#&gt; Model cost at call  81 :  375.9738 
#&gt; Model cost at call  83 :  375.9738 
#&gt; Model cost at call  86 :  375.3387 
#&gt; Model cost at call  88 :  375.3387 
#&gt; Model cost at call  91 :  374.5774 
#&gt; Model cost at call  93 :  374.5774 
#&gt; Model cost at call  95 :  374.5774 
#&gt; Model cost at call  96 :  373.5447 
#&gt; Model cost at call  100 :  373.5446 
#&gt; Model cost at call  102 :  373.2643 
#&gt; Model cost at call  104 :  373.2643 
#&gt; Model cost at call  107 :  372.6799 
#&gt; Model cost at call  111 :  372.6798 
#&gt; Model cost at call  114 :  372.6325 
#&gt; Model cost at call  116 :  372.6325 
#&gt; Model cost at call  119 :  372.6159 
#&gt; Model cost at call  121 :  372.6159 
#&gt; Model cost at call  123 :  372.6159 
#&gt; Model cost at call  124 :  372.5845 
#&gt; Model cost at call  126 :  372.5845 
#&gt; Model cost at call  129 :  372.5375 
#&gt; Model cost at call  130 :  372.4771 
#&gt; Model cost at call  131 :  372.2008 
#&gt; Model cost at call  132 :  371.4923 
#&gt; Model cost at call  134 :  371.4923 
#&gt; Model cost at call  137 :  371.3022 
#&gt; Model cost at call  139 :  371.3022 
#&gt; Model cost at call  143 :  371.2271 
#&gt; Model cost at call  144 :  371.2271 
#&gt; Model cost at call  148 :  371.2202 
#&gt; Model cost at call  149 :  371.215 
#&gt; Model cost at call  152 :  371.215 
#&gt; Model cost at call  154 :  371.2136 
#&gt; Model cost at call  155 :  371.2136 
#&gt; Model cost at call  156 :  371.2136 
#&gt; Model cost at call  160 :  371.2134 
#&gt; Model cost at call  164 :  371.2134 
#&gt; Model cost at call  167 :  371.2134 
#&gt; Optimisation by method Port successfully terminated.</div><div class='input'><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'>#&gt; mkin version:    0.9.44.9000 
#&gt; R version:       3.3.2 
#&gt; Date of fit:     Fri Nov 18 15:20:52 2016 
#&gt; Date of summary: Fri Nov 18 15:20:52 2016 
#&gt; 
#&gt; Equations:
#&gt; d_parent/dt = - k_parent * parent
#&gt; d_m1/dt = + f_parent_to_m1 * k_parent * parent - k_m1 * m1
#&gt; 
#&gt; Model predictions using solution type deSolve 
#&gt; 
#&gt; Fitted with method Port using 185 model solutions performed in 0.764 s
#&gt; 
#&gt; Weighting: none
#&gt; 
#&gt; Starting values for parameters to be optimised:
#&gt;                   value   type
#&gt; parent_0       100.7500  state
#&gt; k_parent         0.1000 deparm
#&gt; k_m1             0.1001 deparm
#&gt; f_parent_to_m1   0.5000 deparm
#&gt; 
#&gt; Starting values for the transformed parameters actually optimised:
#&gt;                     value lower upper
#&gt; parent_0       100.750000  -Inf   Inf
#&gt; log_k_parent    -2.302585  -Inf   Inf
#&gt; log_k_m1        -2.301586  -Inf   Inf
#&gt; f_parent_ilr_1   0.000000  -Inf   Inf
#&gt; 
#&gt; Fixed parameter values:
#&gt;      value  type
#&gt; m1_0     0 state
#&gt; 
#&gt; Optimised, transformed parameters with symmetric confidence intervals:
#&gt;                Estimate Std. Error   Lower    Upper
#&gt; parent_0       99.60000    1.61400 96.3300 102.9000
#&gt; log_k_parent   -2.31600    0.04187 -2.4010  -2.2310
#&gt; log_k_m1       -5.24800    0.13610 -5.5230  -4.9720
#&gt; f_parent_ilr_1  0.04096    0.06477 -0.0904   0.1723
#&gt; 
#&gt; Parameter correlation:
#&gt;                parent_0 log_k_parent log_k_m1 f_parent_ilr_1
#&gt; parent_0         1.0000       0.5178  -0.1701        -0.5489
#&gt; log_k_parent     0.5178       1.0000  -0.3285        -0.5451
#&gt; log_k_m1        -0.1701      -0.3285   1.0000         0.7466
#&gt; f_parent_ilr_1  -0.5489      -0.5451   0.7466         1.0000
#&gt; 
#&gt; Residual standard error: 3.211 on 36 degrees of freedom
#&gt; 
#&gt; Backtransformed parameters:
#&gt; Confidence intervals for internally transformed parameters are asymmetric.
#&gt; t-test (unrealistically) based on the assumption of normal distribution
#&gt; for estimators of untransformed parameters.
#&gt;                 Estimate t value    Pr(&gt;t)     Lower     Upper
#&gt; parent_0       99.600000  61.720 2.024e-38 96.330000 1.029e+02
#&gt; k_parent        0.098700  23.880 5.701e-24  0.090660 1.074e-01
#&gt; k_m1            0.005261   7.349 5.758e-09  0.003992 6.933e-03
#&gt; f_parent_to_m1  0.514500  22.490 4.374e-23  0.468100 5.606e-01
#&gt; 
#&gt; Chi2 error levels in percent:
#&gt;          err.min n.optim df
#&gt; All data   6.398       4 15
#&gt; parent     6.459       2  7
#&gt; m1         4.690       2  8
#&gt; 
#&gt; Resulting formation fractions:
#&gt;                 ff
#&gt; parent_m1   0.5145
#&gt; parent_sink 0.4855
#&gt; 
#&gt; Estimated disappearance times:
#&gt;           DT50   DT90
#&gt; parent   7.023  23.33
#&gt; m1     131.761 437.70</div><div class='input'><span class='no'>initials</span> <span class='kw'>&lt;-</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'>&lt;-</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'>#&gt; f_parent_to_m1 
#&gt;            0.5 </div><div class='input'>
<span class='co'># And without sink</span>
<span class='no'>SFO_SFO.ff.2</span> <span class='kw'>&lt;-</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'>#&gt; <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'>

<span class='no'>fit.ff.2</span> <span class='kw'>&lt;-</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>)</div><div class='output co'>#&gt; Model cost at call  1 :  12435.14 
#&gt; Model cost at call  2 :  12435.14 
#&gt; Model cost at call  5 :  8276.306 
#&gt; Model cost at call  6 :  8276.294 
#&gt; Model cost at call  7 :  8275.676 
#&gt; Model cost at call  9 :  5256.953 
#&gt; Model cost at call  11 :  5256.951 
#&gt; Model cost at call  12 :  5256.943 
#&gt; Model cost at call  14 :  4469.745 
#&gt; Model cost at call  18 :  4462.927 
#&gt; Model cost at call  21 :  4462.925 
#&gt; Model cost at call  22 :  4376.059 
#&gt; Model cost at call  24 :  4376.058 
#&gt; Model cost at call  27 :  4366.956 
#&gt; Model cost at call  29 :  4366.956 
#&gt; Model cost at call  31 :  4365.275 
#&gt; Model cost at call  33 :  4365.275 
#&gt; Model cost at call  35 :  4351.877 
#&gt; Model cost at call  37 :  4351.877 
#&gt; Model cost at call  39 :  4338.109 
#&gt; Model cost at call  41 :  4338.109 
#&gt; Model cost at call  43 :  4297.053 
#&gt; Model cost at call  44 :  4218.591 
#&gt; Model cost at call  45 :  3940.397 
#&gt; Model cost at call  46 :  3690.395 
#&gt; Model cost at call  48 :  3690.395 
#&gt; Model cost at call  49 :  3690.385 
#&gt; Model cost at call  50 :  3038.366 
#&gt; Model cost at call  53 :  3038.365 
#&gt; Model cost at call  54 :  2637.866 
#&gt; Model cost at call  57 :  2637.865 
#&gt; Model cost at call  59 :  2588.01 
#&gt; Model cost at call  60 :  2588.009 
#&gt; Model cost at call  63 :  2576.742 
#&gt; Model cost at call  66 :  2576.742 
#&gt; Model cost at call  67 :  2574 
#&gt; Model cost at call  68 :  2574 
#&gt; Model cost at call  69 :  2574 
#&gt; Model cost at call  71 :  2569.76 
#&gt; Model cost at call  73 :  2569.76 
#&gt; Model cost at call  74 :  2569.76 
#&gt; Model cost at call  75 :  2569.403 
#&gt; Model cost at call  76 :  2569.403 
#&gt; Model cost at call  79 :  2569.4 
#&gt; Model cost at call  80 :  2569.4 
#&gt; Model cost at call  81 :  2569.4 
#&gt; Model cost at call  83 :  2569.4 
#&gt; Model cost at call  86 :  2569.4 
#&gt; Model cost at call  90 :  2569.4 
#&gt; Model cost at call  99 :  2569.4 
#&gt; Model cost at call  100 :  2569.4 
#&gt; Optimisation by method Port successfully terminated.</div><div class='input'><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'>#&gt; mkin version:    0.9.44.9000 
#&gt; R version:       3.3.2 
#&gt; Date of fit:     Fri Nov 18 15:20:52 2016 
#&gt; Date of summary: Fri Nov 18 15:20:52 2016 
#&gt; 
#&gt; Equations:
#&gt; d_parent/dt = - k_parent * parent
#&gt; d_m1/dt = + k_parent * parent - k_m1 * m1
#&gt; 
#&gt; Model predictions using solution type deSolve 
#&gt; 
#&gt; Fitted with method Port using 104 model solutions performed in 0.44 s
#&gt; 
#&gt; Weighting: none
#&gt; 
#&gt; Starting values for parameters to be optimised:
#&gt;             value   type
#&gt; parent_0 100.7500  state
#&gt; k_parent   0.1000 deparm
#&gt; k_m1       0.1001 deparm
#&gt; 
#&gt; Starting values for the transformed parameters actually optimised:
#&gt;                   value lower upper
#&gt; parent_0     100.750000  -Inf   Inf
#&gt; log_k_parent  -2.302585  -Inf   Inf
#&gt; log_k_m1      -2.301586  -Inf   Inf
#&gt; 
#&gt; Fixed parameter values:
#&gt;      value  type
#&gt; m1_0     0 state
#&gt; 
#&gt; Optimised, transformed parameters with symmetric confidence intervals:
#&gt;              Estimate Std. Error Lower  Upper
#&gt; parent_0       84.790    2.96500 78.78 90.800
#&gt; log_k_parent   -2.756    0.08088 -2.92 -2.593
#&gt; log_k_m1       -4.214    0.11150 -4.44 -3.988
#&gt; 
#&gt; Parameter correlation:
#&gt;              parent_0 log_k_parent log_k_m1
#&gt; parent_0       1.0000      0.11059  0.46156
#&gt; log_k_parent   0.1106      1.00000  0.06274
#&gt; log_k_m1       0.4616      0.06274  1.00000
#&gt; 
#&gt; Residual standard error: 8.333 on 37 degrees of freedom
#&gt; 
#&gt; Backtransformed parameters:
#&gt; Confidence intervals for internally transformed parameters are asymmetric.
#&gt; t-test (unrealistically) based on the assumption of normal distribution
#&gt; for estimators of untransformed parameters.
#&gt;          Estimate t value    Pr(&gt;t)    Lower    Upper
#&gt; parent_0 84.79000  28.600 3.939e-27 78.78000 90.80000
#&gt; k_parent  0.06352  12.360 5.237e-15  0.05392  0.07483
#&gt; k_m1      0.01478   8.966 4.114e-11  0.01179  0.01853
#&gt; 
#&gt; Chi2 error levels in percent:
#&gt;          err.min n.optim df
#&gt; All data   19.66       3 16
#&gt; parent     17.56       2  7
#&gt; m1         18.71       1  9
#&gt; 
#&gt; Estimated disappearance times:
#&gt;         DT50   DT90
#&gt; parent 10.91  36.25
#&gt; m1     46.89 155.75</div><div class='input'>
</div></pre>
  </div>
  <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
    <h2>Contents</h2>
    <ul class="nav nav-pills nav-stacked">
      <li><a href="#arguments">Arguments</a></li>
      
      <li><a href="#value">Value</a></li>
      
      <li><a href="#examples">Examples</a></li>
    </ul>

    <h2>Author</h2>
    
  Johannes Ranke

  </div>
</div>

      <footer>
      <div class="copyright">
  <p>Developed by Johannes Ranke.</p>
</div>

<div class="pkgdown">
  <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p>
</div>

      </footer>
   </div>

  </body>
</html>

Contact - Imprint