aboutsummaryrefslogblamecommitdiff
path: root/docs/reference/mkinfit.html
blob: cdf7c7efbec2dcbfafc660b7c404a80aaf688325 (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>Fit a kinetic model to data with one or more state variables — mkinfit • 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://mathjax.rstudio.com/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">Functions and data</a>
</li>
<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
    Articles
     
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" role="menu">
    <li>
      <a href="../articles/mkin.html">Introduction to mkin</a>
    </li>
    <li>
      <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a>
    </li>
    <li>
      <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a>
    </li>
    <li>
      <a href="../articles/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a>
    </li>
    <li>
      <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a>
    </li>
  </ul>
</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>Fit a kinetic model to data with one or more state variables</h1>
    </div>

    
    <p>This function uses the Flexible Modelling Environment package
  <code>FME</code> to create a function calculating the model cost, i.e. the
  deviation between the kinetic model and the observed data. This model cost is
  then minimised using the Port algorithm <code>nlminb</code>,
  using the specified initial or fixed parameters and starting values.
  Per default, parameters in the kinetic models are internally transformed in order
  to better satisfy the assumption of a normal distribution of their estimators.
  In each step of the optimsation, the kinetic model is solved using the
  function <code><a href='mkinpredict.html'>mkinpredict</a></code>. The variance of the residuals for each
  observed variable can optionally be iteratively reweighted until convergence
  using the argument <code>reweight.method = "obs"</code>.</p>
    

    <pre class="usage"><span class='fu'>mkinfit</span>(<span class='no'>mkinmod</span>, <span class='no'>observed</span>,
  <span class='kw'>parms.ini</span> <span class='kw'>=</span> <span class='st'>"auto"</span>,
  <span class='kw'>state.ini</span> <span class='kw'>=</span> <span class='st'>"auto"</span>,
  <span class='kw'>fixed_parms</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>fixed_initials</span> <span class='kw'>=</span> <span class='fu'>names</span>(<span class='no'>mkinmod</span>$<span class='no'>diffs</span>)[-<span class='fl'>1</span>],
  <span class='kw'>from_max_mean</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
  <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='st'>"auto"</span>, <span class='st'>"analytical"</span>, <span class='st'>"eigen"</span>, <span class='st'>"deSolve"</span>),
  <span class='kw'>method.ode</span> <span class='kw'>=</span> <span class='st'>"lsoda"</span>,
  <span class='kw'>use_compiled</span> <span class='kw'>=</span> <span class='st'>"auto"</span>,
  <span class='kw'>method.modFit</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='st'>"Port"</span>, <span class='st'>"Marq"</span>, <span class='st'>"SANN"</span>, <span class='st'>"Nelder-Mead"</span>, <span class='st'>"BFGS"</span>, <span class='st'>"CG"</span>, <span class='st'>"L-BFGS-B"</span>),
  <span class='kw'>maxit.modFit</span> <span class='kw'>=</span> <span class='st'>"auto"</span>,
  <span class='kw'>control.modFit</span> <span class='kw'>=</span> <span class='fu'>list</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='kw'>plot</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>err</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>weight</span> <span class='kw'>=</span> <span class='st'>"none"</span>,
  <span class='kw'>scaleVar</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
  <span class='kw'>atol</span> <span class='kw'>=</span> <span class='fl'>1e-8</span>, <span class='kw'>rtol</span> <span class='kw'>=</span> <span class='fl'>1e-10</span>, <span class='kw'>n.outtimes</span> <span class='kw'>=</span> <span class='fl'>100</span>,
  <span class='kw'>reweight.method</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  <span class='kw'>reweight.tol</span> <span class='kw'>=</span> <span class='fl'>1e-8</span>, <span class='kw'>reweight.max.iter</span> <span class='kw'>=</span> <span class='fl'>10</span>,
  <span class='kw'>trace_parms</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>)</pre>
    
    <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Arguments</h2>
    <table class="ref-arguments">
    <colgroup><col class="name" /><col class="desc" /></colgroup>
    <tr>
      <th>mkinmod</th>
      <td><p>A list of class <code><a href='mkinmod.html'>mkinmod</a></code>, containing the kinetic model to be
    fitted to the data, or one of the shorthand names ("SFO", "FOMC", "DFOP",
    "HS", "SFORB"). If a shorthand name is given, a parent only degradation
    model is generated for the variable with the highest value in
    <code>observed</code>.</p></td>
    </tr>
    <tr>
      <th>observed</th>
      <td><p>The observed data. It has to be in the long format as described in
    <code>modFit</code>, i.e. the first column called "name" must contain the
    name of the observed variable for each data point. The second column must
    contain the times of observation, named "time".  The third column must be
    named "value" and contain the observed values. Optionally, a further column
    can contain weights for each data point. Its name must be passed as a
    further argument named <code>err</code> which is then passed on to
    <code>modFit</code>.</p></td>
    </tr>
    <tr>
      <th>parms.ini</th>
      <td><p>A named vector of initial values for the parameters, including parameters
    to be optimised and potentially also fixed parameters as indicated by
    <code>fixed_parms</code>.  If set to "auto", initial values for rate constants
    are set to default values.  Using parameter names that are not in the model
    gives an error.</p>
<p>It is possible to only specify a subset of the parameters that the model
    needs. You can use the parameter lists "bparms.ode" from a previously
    fitted model, which contains the differential equation parameters from this
    model. This works nicely if the models are nested. An example is given
    below.</p></td>
    </tr>
    <tr>
      <th>state.ini</th>
      <td><p>A named vector of initial values for the state variables of the model. In
    case the observed variables are represented by more than one model
    variable, the names will differ from the names of the observed variables
    (see <code>map</code> component of <code><a href='mkinmod.html'>mkinmod</a></code>). The default is to set
    the initial value of the first model variable to the mean of the time zero
    values for the variable with the maximum observed value, and all others to 0.
    If this variable has no time zero observations, its initial value is set to 100.</p></td>
    </tr>
    <tr>
      <th>fixed_parms</th>
      <td><p>The names of parameters that should not be optimised but rather kept at the
    values specified in <code>parms.ini</code>.</p></td>
    </tr>
    <tr>
      <th>fixed_initials</th>
      <td><p>The names of model variables for which the initial state at time 0 should
    be excluded from the optimisation. Defaults to all state variables except
    for the first one.</p></td>
    </tr>
    <tr>
      <th>from_max_mean</th>
      <td><p>If this is set to TRUE, and the model has only one observed variable, then
    data before the time of the maximum observed value (after averaging for each
    sampling time) are discarded, and this time is subtracted from all
    remaining time values, so the time of the maximum observed mean value is
    the new time zero.</p></td>
    </tr>
    <tr>
      <th>solution_type</th>
      <td><p>If set to "eigen", the solution of the system of differential equations is
    based on the spectral decomposition of the coefficient matrix in cases that
    this is possible. If set to "deSolve", a numerical ode solver from package
    <code>deSolve</code> is used. If set to "analytical", an analytical
    solution of the model is used. This is only implemented for simple
    degradation experiments with only one state variable, i.e. with no
    metabolites. The default is "auto", which uses "analytical" if possible,
    otherwise "eigen" if the model can be expressed using eigenvalues and
    eigenvectors, and finally "deSolve" for the remaining models (time
    dependence of degradation rates and metabolites). This argument is passed
    on to the helper function <code><a href='mkinpredict.html'>mkinpredict</a></code>.</p></td>
    </tr>
    <tr>
      <th>method.ode</th>
      <td><p>The solution method passed via <code><a href='mkinpredict.html'>mkinpredict</a></code> to
    <code>ode</code> in case the solution type is "deSolve". The default
    "lsoda" is performant, but sometimes fails to converge.</p></td>
    </tr>
    <tr>
      <th>use_compiled</th>
      <td><p>If set to <code>FALSE</code>, no compiled version of the <code><a href='mkinmod.html'>mkinmod</a></code>
    model is used, in the calls to <code><a href='mkinpredict.html'>mkinpredict</a></code> even if
    a compiled verion is present.</p></td>
    </tr>
    <tr>
      <th>method.modFit</th>
      <td><p>The optimisation method passed to <code>modFit</code>.</p>
<p>In order to optimally deal with problems where local minima occur, the
    "Port" algorithm is now used per default as it is less prone to get trapped
    in local minima and depends less on starting values for parameters than
    the Levenberg Marquardt variant selected by "Marq".  However, "Port" needs
    more iterations.</p>
<p>The former default "Marq" is the Levenberg Marquardt algorithm
    <code>nls.lm</code> from the package <code>minpack.lm</code> and usually needs
    the least number of iterations.</p>
<p>The "Pseudo" algorithm is not included because it needs finite parameter bounds
    which are currently not supported.</p>
<p>The "Newton" algorithm is not included because its number of iterations
    can not be controlled by <code>control.modFit</code> and it does not appear
    to provide advantages over the other algorithms.</p></td>
    </tr>
    <tr>
      <th>maxit.modFit</th>
      <td><p>Maximum number of iterations in the optimisation. If not "auto", this will
    be passed to the method called by <code>modFit</code>, overriding
    what may be specified in the next argument <code>control.modFit</code>.</p></td>
    </tr>
    <tr>
      <th>control.modFit</th>
      <td><p>Additional arguments passed to the optimisation method used by
    <code>modFit</code>.</p></td>
    </tr>
    <tr>
      <th>transform_rates</th>
      <td><p>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.
    If FALSE, zero is used as a lower bound for the rates in the optimisation.</p></td>
    </tr>
    <tr>
      <th>transform_fractions</th>
      <td><p>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. If TRUE, 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.</p></td>
    </tr>
    <tr>
      <th>plot</th>
      <td><p>Should the observed values and the numerical solutions be plotted at each
    stage of the optimisation?</p></td>
    </tr>
    <tr>
      <th>quiet</th>
      <td><p>Suppress printing out the current model cost after each improvement?</p></td>
    </tr>
    <tr>
      <th>err </th>
      <td><p>either <code>NULL</code>, or the name of the column with the
    <em>error</em> estimates, used to weigh the residuals (see details of
    <code>modCost</code>); if <code>NULL</code>, then the residuals are not weighed.</p></td>
    </tr>
    <tr>
      <th>weight</th>
      <td><p>only if <code>err</code>=<code>NULL</code>: how to weight the residuals, one of "none",
    "std", "mean", see details of <code>modCost</code>.</p></td>
    </tr>
    <tr>
      <th>scaleVar</th>
      <td><p>Will be passed to <code>modCost</code>. Default is not to scale Variables
    according to the number of observations.</p></td>
    </tr>
    <tr>
      <th>atol</th>
      <td><p>Absolute error tolerance, passed to <code>ode</code>. Default is 1e-8,
    lower than in <code>lsoda</code>.</p></td>
    </tr>
    <tr>
      <th>rtol</th>
      <td><p>Absolute error tolerance, passed to <code>ode</code>. Default is 1e-10,
    much lower than in <code>lsoda</code>.</p></td>
    </tr>
    <tr>
      <th>n.outtimes</th>
      <td><p>The length of the dataseries that is produced by the model prediction
    function <code><a href='mkinpredict.html'>mkinpredict</a></code>. This impacts the accuracy of
    the numerical solver if that is used (see <code>solution_type</code> argument.
    The default value is 100.</p></td>
    </tr>
    <tr>
      <th>reweight.method</th>
      <td><p>The method used for iteratively reweighting residuals, also known
    as iteratively reweighted least squares (IRLS). Default is NULL,
    the other method implemented is called "obs", meaning that each
    observed variable is assumed to have its own variance, this is
    estimated from the fit and used for weighting the residuals
    in each iteration until convergence of this estimate up to
    <code>reweight.tol</code> or up to the maximum number of iterations
    specified by <code>reweight.max.iter</code>.</p></td>
    </tr>
    <tr>
      <th>reweight.tol</th>
      <td><p>Tolerance for convergence criterion for the variance components
    in IRLS fits.</p></td>
    </tr>
    <tr>
      <th>reweight.max.iter</th>
      <td><p>Maximum iterations in IRLS fits.</p></td>
    </tr>
    <tr>
      <th>trace_parms</th>
      <td><p>Should a trace of the parameter values be listed?</p></td>
    </tr>
    <tr>
      <th>&#8230;</th>
      <td><p>Further arguments that will be passed to <code>modFit</code>.</p></td>
    </tr>
    </table>
    
    <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>

    <p>A list with "mkinfit" and "modFit" in the class attribute.
  A summary can be obtained by <code><a href='summary.mkinfit.html'>summary.mkinfit</a></code>.</p>
    
    <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>

    <p>Plotting methods <code><a href='plot.mkinfit.html'>plot.mkinfit</a></code> and
  <code><a href='mkinparplot.html'>mkinparplot</a></code>.</p>
<p>Fitting of several models to several datasets in a single call to
  <code><a href='mmkin.html'>mmkin</a></code>.</p>
    
    <h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>

    <p>The implementation of iteratively reweighted least squares is inspired by the
  work of the KinGUII team at Bayer Crop Science (Walter Schmitt and Zhenglei
  Gao). A similar implemention can also be found in CAKE 2.0, which is the
  other GUI derivative of mkin, sponsored by Syngenta.</p>
    
    <h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>

    <p>When using the "IORE" submodel for metabolites, fitting with
  "transform_rates = TRUE" (the default) often leads to failures of the
  numerical ODE solver. In this situation it may help to switch off the
  internal rate transformation.</p>
    

    <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
    <pre class="examples"><div class='input'><span class='co'># Use shorthand notation for parent only degradation</span>
<span class='no'>fit</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='st'>"FOMC"</span>, <span class='no'>FOCUS_2006_C</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>)</div><div class='output co'>#&gt; mkin version:    0.9.46 
#&gt; R version:       3.4.1 
#&gt; Date of fit:     Sat Jul 29 15:14:18 2017 
#&gt; Date of summary: Sat Jul 29 15:14:18 2017 
#&gt; 
#&gt; Equations:
#&gt; d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
#&gt; 
#&gt; Model predictions using solution type analytical 
#&gt; 
#&gt; Fitted with method Port using 64 model solutions performed in 0.141 s
#&gt; 
#&gt; Weighting: none
#&gt; 
#&gt; Starting values for parameters to be optimised:
#&gt;          value   type
#&gt; parent_0  85.1  state
#&gt; alpha      1.0 deparm
#&gt; beta      10.0 deparm
#&gt; 
#&gt; Starting values for the transformed parameters actually optimised:
#&gt;               value lower upper
#&gt; parent_0  85.100000  -Inf   Inf
#&gt; log_alpha  0.000000  -Inf   Inf
#&gt; log_beta   2.302585  -Inf   Inf
#&gt; 
#&gt; Fixed parameter values:
#&gt; None
#&gt; 
#&gt; Optimised, transformed parameters with symmetric confidence intervals:
#&gt;           Estimate Std. Error    Lower   Upper
#&gt; parent_0  85.87000     2.2460 80.38000 91.3700
#&gt; log_alpha  0.05192     0.1605 -0.34080  0.4446
#&gt; log_beta   0.65100     0.2801 -0.03452  1.3360
#&gt; 
#&gt; Parameter correlation:
#&gt;           parent_0 log_alpha log_beta
#&gt; parent_0    1.0000   -0.2033  -0.3624
#&gt; log_alpha  -0.2033    1.0000   0.9547
#&gt; log_beta   -0.3624    0.9547   1.0000
#&gt; 
#&gt; Residual standard error: 2.275 on 6 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   85.870  38.230 1.069e-08 80.3800 91.370
#&gt; alpha       1.053   6.231 3.953e-04  0.7112  1.560
#&gt; beta        1.917   3.570 5.895e-03  0.9661  3.806
#&gt; 
#&gt; Chi2 error levels in percent:
#&gt;          err.min n.optim df
#&gt; All data   6.657       3  6
#&gt; parent     6.657       3  6
#&gt; 
#&gt; Estimated disappearance times:
#&gt;         DT50  DT90 DT50back
#&gt; parent 1.785 15.15     4.56
#&gt; 
#&gt; Data:
#&gt;  time variable observed predicted residual
#&gt;     0   parent     85.1    85.875  -0.7749
#&gt;     1   parent     57.9    55.191   2.7091
#&gt;     3   parent     29.9    31.845  -1.9452
#&gt;     7   parent     14.6    17.012  -2.4124
#&gt;    14   parent      9.7     9.241   0.4590
#&gt;    28   parent      6.6     4.754   1.8460
#&gt;    63   parent      4.0     2.102   1.8977
#&gt;    91   parent      3.9     1.441   2.4590
#&gt;   119   parent      0.6     1.092  -0.4919</div><div class='input'>
<span class='co'># One parent compound, one metabolite, both single first order.</span>
<span class='co'># Use mkinsub for convenience in model formulation. Pathway to sink included per default.</span>
<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'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>),
  <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></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='fu'>print</span>(<span class='fu'>system.time</span>(<span class='no'>fit</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>,
                           <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"eigen"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)))</div><div class='output co'>#&gt;    user  system elapsed 
#&gt;   0.888   0.000   0.890 </div><div class='input'><span class='fu'>coef</span>(<span class='no'>fit</span>)</div><div class='output co'>#&gt;          parent_0 log_k_parent_sink   log_k_parent_m1     log_k_m1_sink 
#&gt;          99.59848          -3.03822          -2.98030          -5.24750 </div><div class='input'><span class='fu'><a href='endpoints.html'>endpoints</a></span>(<span class='no'>fit</span>)</div><div class='output co'>#&gt; $ff
#&gt; parent_sink   parent_m1     m1_sink 
#&gt;    0.485524    0.514476    1.000000 
#&gt; 
#&gt; $SFORB
#&gt; logical(0)
#&gt; 
#&gt; $distimes
#&gt;              DT50      DT90
#&gt; parent   7.022929  23.32967
#&gt; m1     131.760712 437.69961
#&gt; </div><div class='input'>
<span class='co'># deSolve is slower when no C compiler (gcc) was available during model generation</span>
<span class='fu'>print</span>(<span class='fu'>system.time</span>(<span class='no'>fit.deSolve</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>,
                           <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"deSolve"</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  6 :  11424.02 
#&gt; Model cost at call  10 :  11424 
#&gt; Model cost at call  12 :  4094.396 
#&gt; Model cost at call  16 :  4094.396 
#&gt; Model cost at call  19 :  1340.595 
#&gt; Model cost at call  20 :  1340.593 
#&gt; Model cost at call  25 :  1072.239 
#&gt; Model cost at call  28 :  1072.236 
#&gt; Model cost at call  30 :  874.2614 
#&gt; Model cost at call  33 :  874.2611 
#&gt; Model cost at call  35 :  616.2379 
#&gt; Model cost at call  37 :  616.2374 
#&gt; Model cost at call  40 :  467.4387 
#&gt; Model cost at call  42 :  467.4382 
#&gt; Model cost at call  46 :  398.2913 
#&gt; Model cost at call  48 :  398.2912 
#&gt; Model cost at call  49 :  398.2911 
#&gt; Model cost at call  51 :  395.0711 
#&gt; Model cost at call  54 :  395.071 
#&gt; Model cost at call  56 :  378.3298 
#&gt; Model cost at call  59 :  378.3298 
#&gt; Model cost at call  62 :  376.9812 
#&gt; Model cost at call  64 :  376.9811 
#&gt; Model cost at call  67 :  375.2085 
#&gt; Model cost at call  69 :  375.2085 
#&gt; Model cost at call  70 :  375.2085 
#&gt; Model cost at call  71 :  375.2085 
#&gt; Model cost at call  72 :  374.5723 
#&gt; Model cost at call  74 :  374.5723 
#&gt; Model cost at call  77 :  374.0075 
#&gt; Model cost at call  79 :  374.0075 
#&gt; Model cost at call  80 :  374.0075 
#&gt; Model cost at call  82 :  373.1711 
#&gt; Model cost at call  84 :  373.1711 
#&gt; Model cost at call  87 :  372.6445 
#&gt; Model cost at call  88 :  372.1614 
#&gt; Model cost at call  90 :  372.1614 
#&gt; Model cost at call  91 :  372.1614 
#&gt; Model cost at call  94 :  371.6464 
#&gt; Model cost at call  99 :  371.4299 
#&gt; Model cost at call  101 :  371.4299 
#&gt; Model cost at call  104 :  371.4071 
#&gt; Model cost at call  106 :  371.4071 
#&gt; Model cost at call  107 :  371.4071 
#&gt; Model cost at call  109 :  371.2524 
#&gt; Model cost at call  113 :  371.2524 
#&gt; Model cost at call  114 :  371.2136 
#&gt; Model cost at call  115 :  371.2136 
#&gt; Model cost at call  116 :  371.2136 
#&gt; Model cost at call  119 :  371.2134 
#&gt; Model cost at call  120 :  371.2134 
#&gt; Model cost at call  122 :  371.2134 
#&gt; Model cost at call  123 :  371.2134 
#&gt; Model cost at call  125 :  371.2134 
#&gt; Model cost at call  126 :  371.2134 
#&gt; Model cost at call  135 :  371.2134 
#&gt; Model cost at call  147 :  371.2134 
#&gt; Model cost at call  151 :  371.2134 
#&gt; Model cost at call  152 :  371.2134 
#&gt; Model cost at call  153 :  371.2134 
#&gt; Optimisation by method Port successfully terminated.
#&gt;    user  system elapsed 
#&gt;   0.728   0.000   0.729 </div><div class='input'><span class='fu'>coef</span>(<span class='no'>fit.deSolve</span>)</div><div class='output co'>#&gt;          parent_0 log_k_parent_sink   log_k_parent_m1     log_k_m1_sink 
#&gt;          99.59848          -3.03822          -2.98030          -5.24750 </div><div class='input'><span class='fu'><a href='endpoints.html'>endpoints</a></span>(<span class='no'>fit.deSolve</span>)</div><div class='output co'>#&gt; $ff
#&gt; parent_sink   parent_m1     m1_sink 
#&gt;    0.485524    0.514476    1.000000 
#&gt; 
#&gt; $SFORB
#&gt; logical(0)
#&gt; 
#&gt; $distimes
#&gt;              DT50      DT90
#&gt; parent   7.022929  23.32967
#&gt; m1     131.760712 437.69961
#&gt; </div><div class='input'>

<span class='co'># Use stepwise fitting, using optimised parameters from parent only fit, FOMC</span>

<span class='no'>FOMC_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'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"FOMC"</span>, <span class='st'>"m1"</span>),
  <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></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.FOMC_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>FOMC_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='co'># Use starting parameters from parent only FOMC fit</span>
<span class='no'>fit.FOMC</span> <span class='kw'>=</span> <span class='fu'>mkinfit</span>(<span class='st'>"FOMC"</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='no'>fit.FOMC_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>FOMC_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='kw'>parms.ini</span> <span class='kw'>=</span> <span class='no'>fit.FOMC</span>$<span class='no'>bparms.ode</span>)

<span class='co'># Use stepwise fitting, using optimised parameters from parent only fit, SFORB</span>
<span class='no'>SFORB_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'>"SFORB"</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.SFORB_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFORB_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='no'>fit.SFORB_SFO.deSolve</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFORB_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"deSolve"</span>,
                                 <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='co'># Use starting parameters from parent only SFORB fit (not really needed in this case)</span>
<span class='no'>fit.SFORB</span> <span class='kw'>=</span> <span class='fu'>mkinfit</span>(<span class='st'>"SFORB"</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='no'>fit.SFORB_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFORB_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>parms.ini</span> <span class='kw'>=</span> <span class='no'>fit.SFORB</span>$<span class='no'>bparms.ode</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)



<span class='co'># Weighted fits, including IRLS</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'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>),
                      <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></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'>f.noweight</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</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'>f.noweight</span>)</div><div class='output co'>#&gt; mkin version:    0.9.46 
#&gt; R version:       3.4.1 
#&gt; Date of fit:     Sat Jul 29 15:14:28 2017 
#&gt; Date of summary: Sat Jul 29 15:14:28 2017 
#&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.746 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
#&gt; 
#&gt; Data:
#&gt;  time variable observed predicted   residual
#&gt;     0   parent    99.46 9.960e+01 -1.385e-01
#&gt;     0   parent   102.04 9.960e+01  2.442e+00
#&gt;     1   parent    93.50 9.024e+01  3.262e+00
#&gt;     1   parent    92.50 9.024e+01  2.262e+00
#&gt;     3   parent    63.23 7.407e+01 -1.084e+01
#&gt;     3   parent    68.99 7.407e+01 -5.083e+00
#&gt;     7   parent    52.32 4.991e+01  2.408e+00
#&gt;     7   parent    55.13 4.991e+01  5.218e+00
#&gt;    14   parent    27.27 2.501e+01  2.257e+00
#&gt;    14   parent    26.64 2.501e+01  1.627e+00
#&gt;    21   parent    11.50 1.253e+01 -1.035e+00
#&gt;    21   parent    11.64 1.253e+01 -8.946e-01
#&gt;    35   parent     2.85 3.148e+00 -2.979e-01
#&gt;    35   parent     2.91 3.148e+00 -2.379e-01
#&gt;    50   parent     0.69 7.162e-01 -2.624e-02
#&gt;    50   parent     0.63 7.162e-01 -8.624e-02
#&gt;    75   parent     0.05 6.074e-02 -1.074e-02
#&gt;    75   parent     0.06 6.074e-02 -7.381e-04
#&gt;   100   parent       NA 5.151e-03         NA
#&gt;   100   parent       NA 5.151e-03         NA
#&gt;   120   parent       NA 7.155e-04         NA
#&gt;   120   parent       NA 7.155e-04         NA
#&gt;     0       m1     0.00 0.000e+00  0.000e+00
#&gt;     0       m1     0.00 0.000e+00  0.000e+00
#&gt;     1       m1     4.84 4.803e+00  3.704e-02
#&gt;     1       m1     5.64 4.803e+00  8.370e-01
#&gt;     3       m1    12.91 1.302e+01 -1.140e-01
#&gt;     3       m1    12.96 1.302e+01 -6.400e-02
#&gt;     7       m1    22.97 2.504e+01 -2.075e+00
#&gt;     7       m1    24.47 2.504e+01 -5.748e-01
#&gt;    14       m1    41.69 3.669e+01  5.000e+00
#&gt;    14       m1    33.21 3.669e+01 -3.480e+00
#&gt;    21       m1    44.37 4.165e+01  2.717e+00
#&gt;    21       m1    46.44 4.165e+01  4.787e+00
#&gt;    35       m1    41.22 4.331e+01 -2.093e+00
#&gt;    35       m1    37.95 4.331e+01 -5.363e+00
#&gt;    50       m1    41.19 4.122e+01 -2.831e-02
#&gt;    50       m1    40.01 4.122e+01 -1.208e+00
#&gt;    75       m1    40.09 3.645e+01  3.643e+00
#&gt;    75       m1    33.85 3.645e+01 -2.597e+00
#&gt;   100       m1    31.04 3.198e+01 -9.416e-01
#&gt;   100       m1    33.13 3.198e+01  1.148e+00
#&gt;   120       m1    25.15 2.879e+01 -3.640e+00
#&gt;   120       m1    33.31 2.879e+01  4.520e+00</div><div class='input'><span class='no'>f.irls</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>reweight.method</span> <span class='kw'>=</span> <span class='st'>"obs"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='fu'>summary</span>(<span class='no'>f.irls</span>)</div><div class='output co'>#&gt; mkin version:    0.9.46 
#&gt; R version:       3.4.1 
#&gt; Date of fit:     Sat Jul 29 15:14:30 2017 
#&gt; Date of summary: Sat Jul 29 15:14:30 2017 
#&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 468 model solutions performed in 1.914 s
#&gt; 
#&gt; Weighting: none then iterative reweighting method obs
#&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.67000    1.79200 96.04000 103.300
#&gt; log_k_parent   -2.31200    0.04560 -2.40400  -2.219
#&gt; log_k_m1       -5.25100    0.12510 -5.50500  -4.998
#&gt; f_parent_ilr_1  0.03785    0.06318 -0.09027   0.166
#&gt; 
#&gt; Parameter correlation:
#&gt;                parent_0 log_k_parent log_k_m1 f_parent_ilr_1
#&gt; parent_0         1.0000       0.5083  -0.1979        -0.6147
#&gt; log_k_parent     0.5083       1.0000  -0.3894        -0.6062
#&gt; log_k_m1        -0.1979      -0.3894   1.0000         0.7417
#&gt; f_parent_ilr_1  -0.6147      -0.6062   0.7417         1.0000
#&gt; 
#&gt; Residual standard error: 1.054 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.67000  55.630 8.181e-37 96.040000 1.033e+02
#&gt; k_parent        0.09906  21.930 1.016e-22  0.090310 1.087e-01
#&gt; k_m1            0.00524   7.996 8.487e-10  0.004066 6.753e-03
#&gt; f_parent_to_m1  0.51340  23.000 2.038e-23  0.468100 5.584e-01
#&gt; 
#&gt; Chi2 error levels in percent:
#&gt;          err.min n.optim df
#&gt; All data   6.399       4 15
#&gt; parent     6.466       2  7
#&gt; m1         4.679       2  8
#&gt; 
#&gt; Resulting formation fractions:
#&gt;                 ff
#&gt; parent_m1   0.5134
#&gt; parent_sink 0.4866
#&gt; 
#&gt; Estimated disappearance times:
#&gt;           DT50   DT90
#&gt; parent   6.997  23.24
#&gt; m1     132.282 439.43
#&gt; 
#&gt; Data:
#&gt;  time variable observed predicted   residual   err
#&gt;     0   parent    99.46 9.967e+01 -2.122e-01 3.402
#&gt;     0   parent   102.04 9.967e+01  2.368e+00 3.402
#&gt;     1   parent    93.50 9.027e+01  3.228e+00 3.402
#&gt;     1   parent    92.50 9.027e+01  2.228e+00 3.402
#&gt;     3   parent    63.23 7.405e+01 -1.082e+01 3.402
#&gt;     3   parent    68.99 7.405e+01 -5.056e+00 3.402
#&gt;     7   parent    52.32 4.982e+01  2.499e+00 3.402
#&gt;     7   parent    55.13 4.982e+01  5.309e+00 3.402
#&gt;    14   parent    27.27 2.490e+01  2.367e+00 3.402
#&gt;    14   parent    26.64 2.490e+01  1.737e+00 3.402
#&gt;    21   parent    11.50 1.245e+01 -9.476e-01 3.402
#&gt;    21   parent    11.64 1.245e+01 -8.076e-01 3.402
#&gt;    35   parent     2.85 3.110e+00 -2.600e-01 3.402
#&gt;    35   parent     2.91 3.110e+00 -2.000e-01 3.402
#&gt;    50   parent     0.69 7.037e-01 -1.374e-02 3.402
#&gt;    50   parent     0.63 7.037e-01 -7.374e-02 3.402
#&gt;    75   parent     0.05 5.913e-02 -9.133e-03 3.402
#&gt;    75   parent     0.06 5.913e-02  8.666e-04 3.402
#&gt;   100   parent       NA 4.969e-03         NA 3.402
#&gt;   100   parent       NA 4.969e-03         NA 3.402
#&gt;   120   parent       NA 6.852e-04         NA 3.402
#&gt;   120   parent       NA 6.852e-04         NA 3.402
#&gt;     0       m1     0.00 0.000e+00  0.000e+00 2.722
#&gt;     0       m1     0.00 0.000e+00  0.000e+00 2.722
#&gt;     1       m1     4.84 4.813e+00  2.672e-02 2.722
#&gt;     1       m1     5.64 4.813e+00  8.267e-01 2.722
#&gt;     3       m1    12.91 1.305e+01 -1.378e-01 2.722
#&gt;     3       m1    12.96 1.305e+01 -8.779e-02 2.722
#&gt;     7       m1    22.97 2.508e+01 -2.106e+00 2.722
#&gt;     7       m1    24.47 2.508e+01 -6.062e-01 2.722
#&gt;    14       m1    41.69 3.671e+01  4.983e+00 2.722
#&gt;    14       m1    33.21 3.671e+01 -3.497e+00 2.722
#&gt;    21       m1    44.37 4.165e+01  2.720e+00 2.722
#&gt;    21       m1    46.44 4.165e+01  4.790e+00 2.722
#&gt;    35       m1    41.22 4.329e+01 -2.069e+00 2.722
#&gt;    35       m1    37.95 4.329e+01 -5.339e+00 2.722
#&gt;    50       m1    41.19 4.119e+01 -3.376e-03 2.722
#&gt;    50       m1    40.01 4.119e+01 -1.183e+00 2.722
#&gt;    75       m1    40.09 3.644e+01  3.652e+00 2.722
#&gt;    75       m1    33.85 3.644e+01 -2.588e+00 2.722
#&gt;   100       m1    31.04 3.199e+01 -9.497e-01 2.722
#&gt;   100       m1    33.13 3.199e+01  1.140e+00 2.722
#&gt;   120       m1    25.15 2.881e+01 -3.659e+00 2.722
#&gt;   120       m1    33.31 2.881e+01  4.501e+00 2.722</div><div class='input'><span class='no'>f.w.mean</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>weight</span> <span class='kw'>=</span> <span class='st'>"mean"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='fu'>summary</span>(<span class='no'>f.w.mean</span>)</div><div class='output co'>#&gt; mkin version:    0.9.46 
#&gt; R version:       3.4.1 
#&gt; Date of fit:     Sat Jul 29 15:14:31 2017 
#&gt; Date of summary: Sat Jul 29 15:14:31 2017 
#&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 155 model solutions performed in 0.692 s
#&gt; 
#&gt; Weighting: mean
#&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.7300    1.93200 95.81000 103.6000
#&gt; log_k_parent    -2.3090    0.04837 -2.40700  -2.2110
#&gt; log_k_m1        -5.2550    0.12070 -5.49900  -5.0100
#&gt; f_parent_ilr_1   0.0354    0.06344 -0.09327   0.1641
#&gt; 
#&gt; Parameter correlation:
#&gt;                parent_0 log_k_parent log_k_m1 f_parent_ilr_1
#&gt; parent_0         1.0000       0.5004  -0.2143        -0.6514
#&gt; log_k_parent     0.5004       1.0000  -0.4282        -0.6383
#&gt; log_k_m1        -0.2143      -0.4282   1.0000         0.7390
#&gt; f_parent_ilr_1  -0.6514      -0.6383   0.7390         1.0000
#&gt; 
#&gt; Residual standard error: 0.09829 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.730000  51.630 1.166e-35 95.81000 1.036e+02
#&gt; k_parent        0.099360  20.670 7.303e-22  0.09007 1.096e-01
#&gt; k_m1            0.005224   8.287 3.649e-10  0.00409 6.672e-03
#&gt; f_parent_to_m1  0.512500  22.860 2.497e-23  0.46710 5.578e-01
#&gt; 
#&gt; Chi2 error levels in percent:
#&gt;          err.min n.optim df
#&gt; All data   6.401       4 15
#&gt; parent     6.473       2  7
#&gt; m1         4.671       2  8
#&gt; 
#&gt; Resulting formation fractions:
#&gt;                 ff
#&gt; parent_m1   0.5125
#&gt; parent_sink 0.4875
#&gt; 
#&gt; Estimated disappearance times:
#&gt;           DT50   DT90
#&gt; parent   6.976  23.18
#&gt; m1     132.696 440.81
#&gt; 
#&gt; Data:
#&gt;  time variable observed predicted   residual
#&gt;     0   parent    99.46 99.730570  -0.270570
#&gt;     0   parent   102.04 99.730570   2.309430
#&gt;     1   parent    93.50 90.298055   3.201945
#&gt;     1   parent    92.50 90.298055   2.201945
#&gt;     3   parent    63.23 74.025028 -10.795028
#&gt;     3   parent    68.99 74.025028  -5.035028
#&gt;     7   parent    52.32 49.748382   2.571618
#&gt;     7   parent    55.13 49.748382   5.381618
#&gt;    14   parent    27.27 24.815876   2.454124
#&gt;    14   parent    26.64 24.815876   1.824124
#&gt;    21   parent    11.50 12.378849  -0.878849
#&gt;    21   parent    11.64 12.378849  -0.738849
#&gt;    35   parent     2.85  3.080219  -0.230219
#&gt;    35   parent     2.91  3.080219  -0.170219
#&gt;    50   parent     0.69  0.693958  -0.003958
#&gt;    50   parent     0.63  0.693958  -0.063958
#&gt;    75   parent     0.05  0.057888  -0.007888
#&gt;    75   parent     0.06  0.057888   0.002112
#&gt;   100   parent       NA  0.004829         NA
#&gt;   100   parent       NA  0.004829         NA
#&gt;   120   parent       NA  0.000662         NA
#&gt;   120   parent       NA  0.000662         NA
#&gt;     0       m1     0.00  0.000000   0.000000
#&gt;     0       m1     0.00  0.000000   0.000000
#&gt;     1       m1     4.84  4.821488   0.018512
#&gt;     1       m1     5.64  4.821488   0.818512
#&gt;     3       m1    12.91 13.066692  -0.156692
#&gt;     3       m1    12.96 13.066692  -0.106692
#&gt;     7       m1    22.97 25.101058  -2.131058
#&gt;     7       m1    24.47 25.101058  -0.631058
#&gt;    14       m1    41.69 36.720923   4.969077
#&gt;    14       m1    33.21 36.720923  -3.510923
#&gt;    21       m1    44.37 41.648353   2.721647
#&gt;    21       m1    46.44 41.648353   4.791647
#&gt;    35       m1    41.22 43.269225  -2.049225
#&gt;    35       m1    37.95 43.269225  -5.319225
#&gt;    50       m1    41.19 41.173639   0.016361
#&gt;    50       m1    40.01 41.173639  -1.163639
#&gt;    75       m1    40.09 36.431224   3.658776
#&gt;    75       m1    33.85 36.431224  -2.581224
#&gt;   100       m1    31.04 31.996124  -0.956124
#&gt;   100       m1    33.13 31.996124   1.133876
#&gt;   120       m1    25.15 28.824128  -3.674128
#&gt;   120       m1    33.31 28.824128   4.485872</div><div class='input'><span class='no'>f.w.value</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</span>, <span class='fu'>subset</span>(<span class='no'>FOCUS_2006_D</span>, <span class='no'>value</span> <span class='kw'>!=</span> <span class='fl'>0</span>), <span class='kw'>err</span> <span class='kw'>=</span> <span class='st'>"value"</span>,
                     <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='fu'>summary</span>(<span class='no'>f.w.value</span>)</div><div class='output co'>#&gt; mkin version:    0.9.46 
#&gt; R version:       3.4.1 
#&gt; Date of fit:     Sat Jul 29 15:14:32 2017 
#&gt; Date of summary: Sat Jul 29 15:14:32 2017 
#&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 174 model solutions performed in 0.701 s
#&gt; 
#&gt; Weighting: manual
#&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.6600   2.712000 94.14000 105.2000
#&gt; log_k_parent    -2.2980   0.008118 -2.31500  -2.2820
#&gt; log_k_m1        -5.2410   0.096690 -5.43800  -5.0450
#&gt; f_parent_ilr_1   0.0231   0.057990 -0.09474   0.1409
#&gt; 
#&gt; Parameter correlation:
#&gt;                parent_0 log_k_parent log_k_m1 f_parent_ilr_1
#&gt; parent_0        1.00000       0.6844 -0.08687        -0.7564
#&gt; log_k_parent    0.68435       1.0000 -0.12694        -0.5812
#&gt; log_k_m1       -0.08687      -0.1269  1.00000         0.5195
#&gt; f_parent_ilr_1 -0.75644      -0.5812  0.51951         1.0000
#&gt; 
#&gt; Residual standard error: 0.08396 on 34 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.660000   36.75 2.957e-29 94.14000 1.052e+02
#&gt; k_parent        0.100400  123.20 5.927e-47  0.09878 1.021e-01
#&gt; k_m1            0.005295   10.34 2.447e-12  0.00435 6.444e-03
#&gt; f_parent_to_m1  0.508200   24.79 1.184e-23  0.46660 5.497e-01
#&gt; 
#&gt; Chi2 error levels in percent:
#&gt;          err.min n.optim df
#&gt; All data   6.461       4 15
#&gt; parent     6.520       2  7
#&gt; m1         4.744       2  8
#&gt; 
#&gt; Resulting formation fractions:
#&gt;                 ff
#&gt; parent_m1   0.5082
#&gt; parent_sink 0.4918
#&gt; 
#&gt; Estimated disappearance times:
#&gt;           DT50   DT90
#&gt; parent   6.902  22.93
#&gt; m1     130.916 434.89
#&gt; 
#&gt; Data:
#&gt;  time variable observed predicted   residual    err
#&gt;     0   parent    99.46  99.65571  -0.195714  99.46
#&gt;     0   parent   102.04  99.65571   2.384286 102.04
#&gt;     1   parent    93.50  90.13383   3.366170  93.50
#&gt;     1   parent    92.50  90.13383   2.366170  92.50
#&gt;     3   parent    63.23  73.73252 -10.502518  63.23
#&gt;     3   parent    68.99  73.73252  -4.742518  68.99
#&gt;     7   parent    52.32  49.34027   2.979728  52.32
#&gt;     7   parent    55.13  49.34027   5.789728  55.13
#&gt;    14   parent    27.27  24.42873   2.841271  27.27
#&gt;    14   parent    26.64  24.42873   2.211271  26.64
#&gt;    21   parent    11.50  12.09484  -0.594842  11.50
#&gt;    21   parent    11.64  12.09484  -0.454842  11.64
#&gt;    35   parent     2.85   2.96482  -0.114824   2.85
#&gt;    35   parent     2.91   2.96482  -0.054824   2.91
#&gt;    50   parent     0.69   0.65733   0.032670   0.69
#&gt;    50   parent     0.63   0.65733  -0.027330   0.63
#&gt;    75   parent     0.05   0.05339  -0.003386   0.05
#&gt;    75   parent     0.06   0.05339   0.006614   0.06
#&gt;     1       m1     4.84   4.82570   0.014301   4.84
#&gt;     1       m1     5.64   4.82570   0.814301   5.64
#&gt;     3       m1    12.91  13.06402  -0.154020  12.91
#&gt;     3       m1    12.96  13.06402  -0.104020  12.96
#&gt;     7       m1    22.97  25.04656  -2.076564  22.97
#&gt;     7       m1    24.47  25.04656  -0.576564  24.47
#&gt;    14       m1    41.69  36.53601   5.153988  41.69
#&gt;    14       m1    33.21  36.53601  -3.326012  33.21
#&gt;    21       m1    44.37  41.34639   3.023609  44.37
#&gt;    21       m1    46.44  41.34639   5.093609  46.44
#&gt;    35       m1    41.22  42.82669  -1.606690  41.22
#&gt;    35       m1    37.95  42.82669  -4.876690  37.95
#&gt;    50       m1    41.19  40.67342   0.516578  41.19
#&gt;    50       m1    40.01  40.67342  -0.663422  40.01
#&gt;    75       m1    40.09  35.91105   4.178947  40.09
#&gt;    75       m1    33.85  35.91105  -2.061053  33.85
#&gt;   100       m1    31.04  31.48161  -0.441612  31.04
#&gt;   100       m1    33.13  31.48161   1.648388  33.13
#&gt;   120       m1    25.15  28.32018  -3.170181  25.15
#&gt;   120       m1    33.31  28.32018   4.989819  33.31</div><div class='input'>


<span class='co'># Manual weighting</span>
<span class='no'>dw</span> <span class='kw'>&lt;-</span> <span class='no'>FOCUS_2006_D</span>
<span class='no'>errors</span> <span class='kw'>&lt;-</span> <span class='fu'>c</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fl'>2</span>, <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fl'>1</span>)
<span class='no'>dw</span>$<span class='no'>err.man</span> <span class='kw'>&lt;-</span> <span class='no'>errors</span>[<span class='no'>FOCUS_2006_D</span>$<span class='no'>name</span>]
<span class='no'>f.w.man</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>dw</span>, <span class='kw'>err</span> <span class='kw'>=</span> <span class='st'>"err.man"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='fu'>summary</span>(<span class='no'>f.w.man</span>)</div><div class='output co'>#&gt; mkin version:    0.9.46 
#&gt; R version:       3.4.1 
#&gt; Date of fit:     Sat Jul 29 15:14:33 2017 
#&gt; Date of summary: Sat Jul 29 15:14:33 2017 
#&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 297 model solutions performed in 1.223 s
#&gt; 
#&gt; Weighting: manual
#&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.49000    1.33200 96.7800 102.2000
#&gt; log_k_parent   -2.32100    0.03550 -2.3930  -2.2490
#&gt; log_k_m1       -5.24100    0.21280 -5.6730  -4.8100
#&gt; f_parent_ilr_1  0.04571    0.08966 -0.1361   0.2275
#&gt; 
#&gt; Parameter correlation:
#&gt;                parent_0 log_k_parent log_k_m1 f_parent_ilr_1
#&gt; parent_0        1.00000       0.5312 -0.09456        -0.3351
#&gt; log_k_parent    0.53123       1.0000 -0.17800        -0.3360
#&gt; log_k_m1       -0.09456      -0.1780  1.00000         0.7616
#&gt; f_parent_ilr_1 -0.33514      -0.3360  0.76156         1.0000
#&gt; 
#&gt; Residual standard error: 2.628 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.490000   74.69 2.221e-41 96.780000 1.022e+02
#&gt; k_parent        0.098140   28.17 2.012e-26  0.091320 1.055e-01
#&gt; k_m1            0.005292    4.70 1.873e-05  0.003437 8.148e-03
#&gt; f_parent_to_m1  0.516200   16.30 1.686e-18  0.452000 5.798e-01
#&gt; 
#&gt; Chi2 error levels in percent:
#&gt;          err.min n.optim df
#&gt; All data   6.400       4 15
#&gt; parent     6.454       2  7
#&gt; m1         4.708       2  8
#&gt; 
#&gt; Resulting formation fractions:
#&gt;                 ff
#&gt; parent_m1   0.5162
#&gt; parent_sink 0.4838
#&gt; 
#&gt; Estimated disappearance times:
#&gt;           DT50   DT90
#&gt; parent   7.063  23.46
#&gt; m1     130.971 435.08
#&gt; 
#&gt; Data:
#&gt;  time variable observed predicted   residual err
#&gt;     0   parent    99.46 99.485976  -0.025976   1
#&gt;     0   parent   102.04 99.485976   2.554024   1
#&gt;     1   parent    93.50 90.186117   3.313883   1
#&gt;     1   parent    92.50 90.186117   2.313883   1
#&gt;     3   parent    63.23 74.113162 -10.883162   1
#&gt;     3   parent    68.99 74.113162  -5.123162   1
#&gt;     7   parent    52.32 50.050295   2.269705   1
#&gt;     7   parent    55.13 50.050295   5.079705   1
#&gt;    14   parent    27.27 25.179750   2.090250   1
#&gt;    14   parent    26.64 25.179750   1.460250   1
#&gt;    21   parent    11.50 12.667654  -1.167654   1
#&gt;    21   parent    11.64 12.667654  -1.027654   1
#&gt;    35   parent     2.85  3.206164  -0.356164   1
#&gt;    35   parent     2.91  3.206164  -0.296164   1
#&gt;    50   parent     0.69  0.735619  -0.045619   1
#&gt;    50   parent     0.63  0.735619  -0.105619   1
#&gt;    75   parent     0.05  0.063256  -0.013256   1
#&gt;    75   parent     0.06  0.063256  -0.003256   1
#&gt;   100   parent       NA  0.005439         NA   1
#&gt;   100   parent       NA  0.005439         NA   1
#&gt;   120   parent       NA  0.000764         NA   1
#&gt;   120   parent       NA  0.000764         NA   1
#&gt;     0       m1     0.00  0.000000   0.000000   2
#&gt;     0       m1     0.00  0.000000   0.000000   2
#&gt;     1       m1     4.84  4.787287   0.052713   2
#&gt;     1       m1     5.64  4.787287   0.852713   2
#&gt;     3       m1    12.91 12.987848  -0.077848   2
#&gt;     3       m1    12.96 12.987848  -0.027848   2
#&gt;     7       m1    22.97 24.996945  -2.026945   2
#&gt;     7       m1    24.47 24.996945  -0.526945   2
#&gt;    14       m1    41.69 36.663527   5.026473   2
#&gt;    14       m1    33.21 36.663527  -3.453527   2
#&gt;    21       m1    44.37 41.656813   2.713187   2
#&gt;    21       m1    46.44 41.656813   4.783187   2
#&gt;    35       m1    41.22 43.350312  -2.130312   2
#&gt;    35       m1    37.95 43.350312  -5.400312   2
#&gt;    50       m1    41.19 41.256365  -0.066365   2
#&gt;    50       m1    40.01 41.256365  -1.246365   2
#&gt;    75       m1    40.09 36.460567   3.629433   2
#&gt;    75       m1    33.85 36.460567  -2.610567   2
#&gt;   100       m1    31.04 31.969288  -0.929288   2
#&gt;   100       m1    33.13 31.969288   1.160712   2
#&gt;   120       m1    25.15 28.760616  -3.610616   2
#&gt;   120       m1    33.31 28.760616   4.549384   2</div><div class='input'><span class='no'>f.w.man.irls</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>dw</span>, <span class='kw'>err</span> <span class='kw'>=</span> <span class='st'>"err.man"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
                       <span class='kw'>reweight.method</span> <span class='kw'>=</span> <span class='st'>"obs"</span>)
<span class='fu'>summary</span>(<span class='no'>f.w.man.irls</span>)</div><div class='output co'>#&gt; mkin version:    0.9.46 
#&gt; R version:       3.4.1 
#&gt; Date of fit:     Sat Jul 29 15:14:36 2017 
#&gt; Date of summary: Sat Jul 29 15:14:36 2017 
#&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 628 model solutions performed in 2.578 s
#&gt; 
#&gt; Weighting: manual then iterative reweighting method obs
#&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.67000    1.79200 96.04000 103.300
#&gt; log_k_parent   -2.31200    0.04560 -2.40400  -2.220
#&gt; log_k_m1       -5.25100    0.12510 -5.50500  -4.998
#&gt; f_parent_ilr_1  0.03785    0.06318 -0.09027   0.166
#&gt; 
#&gt; Parameter correlation:
#&gt;                parent_0 log_k_parent log_k_m1 f_parent_ilr_1
#&gt; parent_0         1.0000       0.5083  -0.1979        -0.6147
#&gt; log_k_parent     0.5083       1.0000  -0.3894        -0.6062
#&gt; log_k_m1        -0.1979      -0.3894   1.0000         0.7417
#&gt; f_parent_ilr_1  -0.6147      -0.6062   0.7417         1.0000
#&gt; 
#&gt; Residual standard error: 1.054 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.67000  55.630 8.179e-37 96.040000 1.033e+02
#&gt; k_parent        0.09906  21.930 1.015e-22  0.090310 1.087e-01
#&gt; k_m1            0.00524   7.996 8.488e-10  0.004066 6.753e-03
#&gt; f_parent_to_m1  0.51340  23.000 2.039e-23  0.468100 5.584e-01
#&gt; 
#&gt; Chi2 error levels in percent:
#&gt;          err.min n.optim df
#&gt; All data   6.399       4 15
#&gt; parent     6.466       2  7
#&gt; m1         4.679       2  8
#&gt; 
#&gt; Resulting formation fractions:
#&gt;                 ff
#&gt; parent_m1   0.5134
#&gt; parent_sink 0.4866
#&gt; 
#&gt; Estimated disappearance times:
#&gt;           DT50   DT90
#&gt; parent   6.997  23.24
#&gt; m1     132.281 439.43
#&gt; 
#&gt; Data:
#&gt;  time variable observed predicted   residual err.ini   err
#&gt;     0   parent    99.46 9.967e+01 -2.122e-01       1 3.402
#&gt;     0   parent   102.04 9.967e+01  2.368e+00       1 3.402
#&gt;     1   parent    93.50 9.027e+01  3.228e+00       1 3.402
#&gt;     1   parent    92.50 9.027e+01  2.228e+00       1 3.402
#&gt;     3   parent    63.23 7.405e+01 -1.082e+01       1 3.402
#&gt;     3   parent    68.99 7.405e+01 -5.056e+00       1 3.402
#&gt;     7   parent    52.32 4.982e+01  2.499e+00       1 3.402
#&gt;     7   parent    55.13 4.982e+01  5.309e+00       1 3.402
#&gt;    14   parent    27.27 2.490e+01  2.367e+00       1 3.402
#&gt;    14   parent    26.64 2.490e+01  1.737e+00       1 3.402
#&gt;    21   parent    11.50 1.245e+01 -9.477e-01       1 3.402
#&gt;    21   parent    11.64 1.245e+01 -8.077e-01       1 3.402
#&gt;    35   parent     2.85 3.110e+00 -2.600e-01       1 3.402
#&gt;    35   parent     2.91 3.110e+00 -2.000e-01       1 3.402
#&gt;    50   parent     0.69 7.037e-01 -1.375e-02       1 3.402
#&gt;    50   parent     0.63 7.037e-01 -7.375e-02       1 3.402
#&gt;    75   parent     0.05 5.913e-02 -9.134e-03       1 3.402
#&gt;    75   parent     0.06 5.913e-02  8.659e-04       1 3.402
#&gt;   100   parent       NA 4.969e-03         NA       1 3.402
#&gt;   100   parent       NA 4.969e-03         NA       1 3.402
#&gt;   120   parent       NA 6.852e-04         NA       1 3.402
#&gt;   120   parent       NA 6.852e-04         NA       1 3.402
#&gt;     0       m1     0.00 0.000e+00  0.000e+00       2 2.722
#&gt;     0       m1     0.00 0.000e+00  0.000e+00       2 2.722
#&gt;     1       m1     4.84 4.813e+00  2.672e-02       2 2.722
#&gt;     1       m1     5.64 4.813e+00  8.267e-01       2 2.722
#&gt;     3       m1    12.91 1.305e+01 -1.378e-01       2 2.722
#&gt;     3       m1    12.96 1.305e+01 -8.778e-02       2 2.722
#&gt;     7       m1    22.97 2.508e+01 -2.106e+00       2 2.722
#&gt;     7       m1    24.47 2.508e+01 -6.061e-01       2 2.722
#&gt;    14       m1    41.69 3.671e+01  4.983e+00       2 2.722
#&gt;    14       m1    33.21 3.671e+01 -3.497e+00       2 2.722
#&gt;    21       m1    44.37 4.165e+01  2.719e+00       2 2.722
#&gt;    21       m1    46.44 4.165e+01  4.789e+00       2 2.722
#&gt;    35       m1    41.22 4.329e+01 -2.069e+00       2 2.722
#&gt;    35       m1    37.95 4.329e+01 -5.339e+00       2 2.722
#&gt;    50       m1    41.19 4.119e+01 -3.394e-03       2 2.722
#&gt;    50       m1    40.01 4.119e+01 -1.183e+00       2 2.722
#&gt;    75       m1    40.09 3.644e+01  3.652e+00       2 2.722
#&gt;    75       m1    33.85 3.644e+01 -2.588e+00       2 2.722
#&gt;   100       m1    31.04 3.199e+01 -9.497e-01       2 2.722
#&gt;   100       m1    33.13 3.199e+01  1.140e+00       2 2.722
#&gt;   120       m1    25.15 2.881e+01 -3.659e+00       2 2.722
#&gt;   120       m1    33.31 2.881e+01  4.501e+00       2 2.722</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="#see-also">See also</a></li>

      <li><a href="#note">Note</a></li>

      <li><a href="#note">Note</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