aboutsummaryrefslogblamecommitdiff
path: root/docs/reference/Extract.mmkin.html
blob: b513fac162e33820b19870bbc1065432be30488b (plain) (tree)

































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                      
                              
























































































































































































                                                                                                   
                                    




















                                                                                                    
                                    
































































                                                       
                                              















































































                                                                                                                                                                                                                                          
                              

























































































































































































                                                                                                   
                                    




















                                                                                                    
                                    





























































                                                      
                                              











































































                                                                                                                                                                                                                                                      
                              

























































































































































































                                                                                                   
                                    




















                                                                                                    
                                    





























































                                                      
                                              




















                                                                                                                                            
<!-- 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>[.mmkin. 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/bootswatch/3.3.7/cerulean/bootstrap.min.css" rel="stylesheet" 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="../pkgdown.js"></script>

<!-- mathjax -->
<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
  </head>

  <body>
    <div class="container">
      <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="../index.html">Home</a>
</li>
<li>
  <a href="../reference/index.html">Reference</a>
</li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        <li>
  <a href="https://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="page-header">
  <h1>Subsetting method for mmkin objects</h1>
</div>

<div class="row">
  <div class="col-md-9">
    
    <p>Subsetting method for mmkin objects.</p>
    

    <pre># S3 method for mmkin
[(x, i, j, ..., drop = FALSE)</pre>
    
    <h2>Arguments</h2>
    <dl class="dl-horizontal">
      <dt>x</dt>
      <dd>An <code>mmkin object</code></dd>
      <dt>i</dt>
      <dd>Row index selecting the fits for specific models</dd>
      <dt>j</dt>
      <dd>Column index selecting the fits to specific datasets</dd>
      <dt>...</dt>
      <dd>Not used, only there to satisfy the generic method definition</dd>
      <dt>drop</dt>
      <dd>If FALSE, the method always returns an mmkin object, otherwise either 
  a list of mkinfit objects or a single mkinfit object.</dd>
    </dl>
    
    <div class="Value">
      <h2>Value</h2>

      <p>An object of class <code>mmkin</code>.</p>
    </div>
    
    <h2 id="examples">Examples</h2>
    <pre class="examples"><div class='input'>  <span class='co'># Only use one core, to pass R CMD check --as-cran</span>
  <span class='no'>fits</span> <span class='kw'>&lt;-</span> <span class='fu'>mmkin</span>(<span class='fu'>c</span>(<span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>), <span class='fu'>list</span>(<span class='kw'>B</span> <span class='kw'>=</span> <span class='no'>FOCUS_2006_B</span>, <span class='kw'>C</span> <span class='kw'>=</span> <span class='no'>FOCUS_2006_C</span>),
                <span class='kw'>cores</span> <span class='kw'>=</span> <span class='fl'>1</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
  <span class='no'>fits</span>[<span class='st'>"FOMC"</span>, ]</div><div class='output co'>#&gt;       dataset
#&gt; model  B       C      
#&gt;   FOMC List,42 List,42
#&gt; attr(,&quot;class&quot;)
#&gt; [1] &quot;mmkin&quot;
#&gt; </div><div class='input'>  <span class='no'>fits</span>[, <span class='st'>"B"</span>]</div><div class='output co'>#&gt;       dataset
#&gt; model  B      
#&gt;   SFO  List,42
#&gt;   FOMC List,42
#&gt; attr(,&quot;class&quot;)
#&gt; [1] &quot;mmkin&quot;
#&gt; </div><div class='input'>  <span class='no'>fits</span>[, <span class='st'>"B"</span>, <span class='kw'>drop</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>]$<span class='no'>FOMC</span></div><div class='output co'>#&gt; $par
#&gt;  parent_0 log_alpha  log_beta 
#&gt; 99.666193  2.549849  5.050586 
#&gt; 
#&gt; $ssr
#&gt; [1] 28.58291
#&gt; 
#&gt; $convergence
#&gt; [1] 0
#&gt; 
#&gt; $iterations
#&gt; [1] 21
#&gt; 
#&gt; $evaluations
#&gt; function gradient 
#&gt;       25       78 
#&gt; 
#&gt; $counts
#&gt; [1] &quot;both X-convergence and relative convergence (5)&quot;
#&gt; 
#&gt; $hessian
#&gt;             parent_0   log_alpha    log_beta
#&gt; parent_0    4.123033   -95.69983    93.17699
#&gt; log_alpha -95.699832  6618.85833 -6352.46648
#&gt; log_beta   93.176993 -6352.46648  6101.23483
#&gt; 
#&gt; $residuals
#&gt;       parent       parent       parent       parent       parent       parent 
#&gt;  1.046192647 -3.322396479  3.655156669 -1.705316770  0.406306255 -0.123734689 
#&gt;       parent       parent 
#&gt; -0.036886982 -0.006240458 
#&gt; 
#&gt; $ms
#&gt; [1] 3.572863
#&gt; 
#&gt; $var_ms
#&gt;   parent 
#&gt; 3.572863 
#&gt; 
#&gt; $var_ms_unscaled
#&gt;   parent 
#&gt; 3.572863 
#&gt; 
#&gt; $var_ms_unweighted
#&gt;   parent 
#&gt; 3.572863 
#&gt; 
#&gt; $rank
#&gt; [1] 3
#&gt; 
#&gt; $df.residual
#&gt; [1] 5
#&gt; 
#&gt; $solution_type
#&gt; [1] &quot;analytical&quot;
#&gt; 
#&gt; $transform_rates
#&gt; [1] TRUE
#&gt; 
#&gt; $transform_fractions
#&gt; [1] TRUE
#&gt; 
#&gt; $method.modFit
#&gt; [1] &quot;Port&quot;
#&gt; 
#&gt; $maxit.modFit
#&gt; [1] &quot;auto&quot;
#&gt; 
#&gt; $calls
#&gt; [1] 111
#&gt; 
#&gt; $time
#&gt;    user  system elapsed 
#&gt;   0.252   0.000   0.253 
#&gt; 
#&gt; $mkinmod
#&gt; &lt;mkinmod&gt; model generated with
#&gt; Use of formation fractions $use_of_ff: min 
#&gt; Specification $spec:
#&gt; $parent
#&gt; $type: FOMC; $sink: TRUE
#&gt; 
#&gt; $observed
#&gt;     name time value
#&gt; 1 parent    0 98.62
#&gt; 2 parent    3 81.43
#&gt; 3 parent    7 53.18
#&gt; 4 parent   14 34.89
#&gt; 5 parent   30 10.09
#&gt; 6 parent   62  1.50
#&gt; 7 parent   90  0.33
#&gt; 8 parent  118  0.08
#&gt; 
#&gt; $obs_vars
#&gt; [1] &quot;parent&quot;
#&gt; 
#&gt; $predicted
#&gt;       name       time       value
#&gt; 1   parent   0.000000 99.66619265
#&gt; 2   parent   1.191919 90.41690342
#&gt; 3   parent   2.383838 82.08630014
#&gt; 4   parent   3.000000 78.10760352
#&gt; 5   parent   3.575758 74.57722848
#&gt; 6   parent   4.767677 67.80342415
#&gt; 7   parent   5.959596 61.68822425
#&gt; 8   parent   7.000000 56.83515667
#&gt; 9   parent   7.151515 56.16343898
#&gt; 10  parent   8.343434 51.16836285
#&gt; 11  parent   9.535354 46.64890734
#&gt; 12  parent  10.727273 42.55683931
#&gt; 13  parent  11.919192 38.84911158
#&gt; 14  parent  13.111111 35.48727414
#&gt; 15  parent  14.000000 33.18468323
#&gt; 16  parent  14.303030 32.43695565
#&gt; 17  parent  15.494949 29.66740651
#&gt; 18  parent  16.686869 27.15109578
#&gt; 19  parent  17.878788 24.86335532
#&gt; 20  parent  19.070707 22.78206538
#&gt; 21  parent  20.262626 20.88737647
#&gt; 22  parent  21.454545 19.16146324
#&gt; 23  parent  22.646465 17.58830644
#&gt; 24  parent  23.838384 16.15349953
#&gt; 25  parent  25.030303 14.84407724
#&gt; 26  parent  26.222222 13.64836315
#&gt; 27  parent  27.414141 12.55583436
#&gt; 28  parent  28.606061 11.55700107
#&gt; 29  parent  29.797980 10.64329940
#&gt; 30  parent  30.000000 10.49630626
#&gt; 31  parent  30.989899  9.80699593
#&gt; 32  parent  32.181818  9.04110261
#&gt; 33  parent  33.373737  8.33930082
#&gt; 34  parent  34.565657  7.69587362
#&gt; 35  parent  35.757576  7.10564515
#&gt; 36  parent  36.949495  6.56392657
#&gt; 37  parent  38.141414  6.06646759
#&gt; 38  parent  39.333333  5.60941311
#&gt; 39  parent  40.525253  5.18926438
#&gt; 40  parent  41.717172  4.80284421
#&gt; 41  parent  42.909091  4.44726569
#&gt; 42  parent  44.101010  4.11990420
#&gt; 43  parent  45.292929  3.81837216
#&gt; 44  parent  46.484848  3.54049644
#&gt; 45  parent  47.676768  3.28429799
#&gt; 46  parent  48.868687  3.04797350
#&gt; 47  parent  50.060606  2.82987892
#&gt; 48  parent  51.252525  2.62851456
#&gt; 49  parent  52.444444  2.44251172
#&gt; 50  parent  53.636364  2.27062056
#&gt; 51  parent  54.828283  2.11169922
#&gt; 52  parent  56.020202  1.96470393
#&gt; 53  parent  57.212121  1.82868009
#&gt; 54  parent  58.404040  1.70275424
#&gt; 55  parent  59.595960  1.58612677
#&gt; 56  parent  60.787879  1.47806529
#&gt; 57  parent  61.979798  1.37789865
#&gt; 58  parent  62.000000  1.37626531
#&gt; 59  parent  63.171717  1.28501157
#&gt; 60  parent  64.363636  1.19883967
#&gt; 61  parent  65.555556  1.11886504
#&gt; 62  parent  66.747475  1.04461220
#&gt; 63  parent  67.939394  0.97564441
#&gt; 64  parent  69.131313  0.91156031
#&gt; 65  parent  70.323232  0.85199096
#&gt; 66  parent  71.515152  0.79659697
#&gt; 67  parent  72.707071  0.74506609
#&gt; 68  parent  73.898990  0.69711084
#&gt; 69  parent  75.090909  0.65246649
#&gt; 70  parent  76.282828  0.61088912
#&gt; 71  parent  77.474747  0.57215389
#&gt; 72  parent  78.666667  0.53605348
#&gt; 73  parent  79.858586  0.50239663
#&gt; 74  parent  81.050505  0.47100683
#&gt; 75  parent  82.242424  0.44172111
#&gt; 76  parent  83.434343  0.41438896
#&gt; 77  parent  84.626263  0.38887128
#&gt; 78  parent  85.818182  0.36503953
#&gt; 79  parent  87.010101  0.34277481
#&gt; 80  parent  88.202020  0.32196716
#&gt; 81  parent  89.393939  0.30251479
#&gt; 82  parent  90.000000  0.29311302
#&gt; 83  parent  90.585859  0.28432347
#&gt; 84  parent  91.777778  0.26730596
#&gt; 85  parent  92.969697  0.25138141
#&gt; 86  parent  94.161616  0.23647487
#&gt; 87  parent  95.353535  0.22251689
#&gt; 88  parent  96.545455  0.20944302
#&gt; 89  parent  97.737374  0.19719349
#&gt; 90  parent  98.929293  0.18571281
#&gt; 91  parent 100.121212  0.17494947
#&gt; 92  parent 101.313131  0.16485560
#&gt; 93  parent 102.505051  0.15538676
#&gt; 94  parent 103.696970  0.14650163
#&gt; 95  parent 104.888889  0.13816179
#&gt; 96  parent 106.080808  0.13033150
#&gt; 97  parent 107.272727  0.12297753
#&gt; 98  parent 108.464646  0.11606895
#&gt; 99  parent 109.656566  0.10957695
#&gt; 100 parent 110.848485  0.10347470
#&gt; 101 parent 112.040404  0.09773723
#&gt; 102 parent 113.232323  0.09234125
#&gt; 103 parent 114.424242  0.08726506
#&gt; 104 parent 115.616162  0.08248842
#&gt; 105 parent 116.808081  0.07799245
#&gt; 106 parent 118.000000  0.07375954
#&gt; 
#&gt; $cost
#&gt; function (P) 
#&gt; {
#&gt;     assign(&quot;calls&quot;, calls + 1, inherits = TRUE)
#&gt;     if (trace_parms) 
#&gt;         cat(P, &quot;\n&quot;)
#&gt;     if (length(state.ini.optim) &gt; 0) {
#&gt;         odeini &lt;- c(P[1:length(state.ini.optim)], state.ini.fixed)
#&gt;         names(odeini) &lt;- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
#&gt;     }
#&gt;     else {
#&gt;         odeini &lt;- state.ini.fixed
#&gt;         names(odeini) &lt;- state.ini.fixed.boxnames
#&gt;     }
#&gt;     odeparms &lt;- c(P[(length(state.ini.optim) + 1):length(P)], 
#&gt;         transparms.fixed)
#&gt;     parms &lt;- backtransform_odeparms(odeparms, mkinmod, transform_rates = transform_rates, 
#&gt;         transform_fractions = transform_fractions)
#&gt;     out &lt;- mkinpredict(mkinmod, parms, odeini, outtimes, solution_type = solution_type, 
#&gt;         use_compiled = use_compiled, method.ode = method.ode, 
#&gt;         atol = atol, rtol = rtol, ...)
#&gt;     assign(&quot;out_predicted&quot;, out, inherits = TRUE)
#&gt;     mC &lt;- modCost(out, observed, y = &quot;value&quot;, err = err, weight = weight, 
#&gt;         scaleVar = scaleVar)
#&gt;     if (mC$model &lt; cost.old) {
#&gt;         if (!quiet) 
#&gt;             cat(&quot;Model cost at call &quot;, calls, &quot;: &quot;, mC$model, 
#&gt;                 &quot;\n&quot;)
#&gt;         if (plot) {
#&gt;             outtimes_plot = seq(min(observed$time), max(observed$time), 
#&gt;                 length.out = 100)
#&gt;             out_plot &lt;- mkinpredict(mkinmod, parms, odeini, outtimes_plot, 
#&gt;                 solution_type = solution_type, use_compiled = use_compiled, 
#&gt;                 method.ode = method.ode, atol = atol, rtol = rtol, 
#&gt;                 ...)
#&gt;             plot(0, type = &quot;n&quot;, xlim = range(observed$time), 
#&gt;                 ylim = c(0, max(observed$value, na.rm = TRUE)), 
#&gt;                 xlab = &quot;Time&quot;, ylab = &quot;Observed&quot;)
#&gt;             col_obs &lt;- pch_obs &lt;- 1:length(obs_vars)
#&gt;             lty_obs &lt;- rep(1, length(obs_vars))
#&gt;             names(col_obs) &lt;- names(pch_obs) &lt;- names(lty_obs) &lt;- obs_vars
#&gt;             for (obs_var in obs_vars) {
#&gt;                 points(subset(observed, name == obs_var, c(time, 
#&gt;                   value)), pch = pch_obs[obs_var], col = col_obs[obs_var])
#&gt;             }
#&gt;             matlines(out_plot$time, out_plot[-1], col = col_obs, 
#&gt;                 lty = lty_obs)
#&gt;             legend(&quot;topright&quot;, inset = c(0.05, 0.05), legend = obs_vars, 
#&gt;                 col = col_obs, pch = pch_obs, lty = 1:length(pch_obs))
#&gt;         }
#&gt;         assign(&quot;cost.old&quot;, mC$model, inherits = TRUE)
#&gt;     }
#&gt;     return(mC)
#&gt; }
#&gt; &lt;environment: 0x3e9c368&gt;
#&gt; 
#&gt; $cost_notrans
#&gt; function (P) 
#&gt; {
#&gt;     if (length(state.ini.optim) &gt; 0) {
#&gt;         odeini &lt;- c(P[1:length(state.ini.optim)], state.ini.fixed)
#&gt;         names(odeini) &lt;- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
#&gt;     }
#&gt;     else {
#&gt;         odeini &lt;- state.ini.fixed
#&gt;         names(odeini) &lt;- state.ini.fixed.boxnames
#&gt;     }
#&gt;     odeparms &lt;- c(P[(length(state.ini.optim) + 1):length(P)], 
#&gt;         parms.fixed)
#&gt;     out &lt;- mkinpredict(mkinmod, odeparms, odeini, outtimes, solution_type = solution_type, 
#&gt;         use_compiled = use_compiled, method.ode = method.ode, 
#&gt;         atol = atol, rtol = rtol, ...)
#&gt;     mC &lt;- modCost(out, observed, y = &quot;value&quot;, err = err, weight = weight, 
#&gt;         scaleVar = scaleVar)
#&gt;     return(mC)
#&gt; }
#&gt; &lt;environment: 0x3e9c368&gt;
#&gt; 
#&gt; $hessian_notrans
#&gt;            parent_0     alpha       beta
#&gt; parent_0  4.1230329 -7.473531  0.5968527
#&gt; alpha    -7.4735307 40.365690 -3.1777189
#&gt; beta      0.5968527 -3.177719  0.2503425
#&gt; 
#&gt; $start
#&gt;          value   type
#&gt; parent_0 98.62  state
#&gt; alpha     1.00 deparm
#&gt; beta     10.00 deparm
#&gt; 
#&gt; $start_transformed
#&gt;               value lower upper
#&gt; parent_0  98.620000  -Inf   Inf
#&gt; log_alpha  0.000000  -Inf   Inf
#&gt; log_beta   2.302585  -Inf   Inf
#&gt; 
#&gt; $fixed
#&gt; [1] value type 
#&gt; &lt;0 rows&gt; (or 0-length row.names)
#&gt; 
#&gt; $data
#&gt;   time variable observed   predicted     residual
#&gt; 1    0   parent    98.62 99.66619265 -1.046192647
#&gt; 2    3   parent    81.43 78.10760352  3.322396479
#&gt; 3    7   parent    53.18 56.83515667 -3.655156669
#&gt; 4   14   parent    34.89 33.18468323  1.705316770
#&gt; 5   30   parent    10.09 10.49630626 -0.406306255
#&gt; 6   62   parent     1.50  1.37626531  0.123734689
#&gt; 7   90   parent     0.33  0.29311302  0.036886982
#&gt; 8  118   parent     0.08  0.07375954  0.006240458
#&gt; 
#&gt; $atol
#&gt; [1] 1e-08
#&gt; 
#&gt; $rtol
#&gt; [1] 1e-10
#&gt; 
#&gt; $weight.ini
#&gt; [1] &quot;none&quot;
#&gt; 
#&gt; $reweight.tol
#&gt; [1] 1e-08
#&gt; 
#&gt; $reweight.max.iter
#&gt; [1] 10
#&gt; 
#&gt; $bparms.optim
#&gt;  parent_0     alpha      beta 
#&gt;  99.66619  12.80517 156.11390 
#&gt; 
#&gt; $bparms.fixed
#&gt; numeric(0)
#&gt; 
#&gt; $bparms.ode
#&gt;     alpha      beta 
#&gt;  12.80517 156.11390 
#&gt; 
#&gt; $bparms.state
#&gt;   parent 
#&gt; 99.66619 
#&gt; 
#&gt; $date
#&gt; [1] &quot;Thu Oct  6 10:47:28 2016&quot;
#&gt; 
#&gt; attr(,&quot;class&quot;)
#&gt; [1] &quot;mkinfit&quot; &quot;modFit&quot; 
#&gt; </div><div class='input'>  <span class='no'>fits</span>[<span class='st'>"SFO"</span>, <span class='st'>"B"</span>]</div><div class='output co'>#&gt;      dataset
#&gt; model B      
#&gt;   SFO List,42
#&gt; attr(,&quot;class&quot;)
#&gt; [1] &quot;mmkin&quot;
#&gt; </div><div class='input'>  <span class='no'>fits</span><span class='kw'>[[</span><span class='st'>"SFO"</span>, <span class='st'>"B"</span>]] <span class='co'># This is equivalent to</span></div><div class='output co'>#&gt; $par
#&gt;          parent_0 log_k_parent_sink 
#&gt;         99.174072         -2.549028 
#&gt; 
#&gt; $ssr
#&gt; [1] 30.65564
#&gt; 
#&gt; $convergence
#&gt; [1] 0
#&gt; 
#&gt; $iterations
#&gt; [1] 5
#&gt; 
#&gt; $evaluations
#&gt; function gradient 
#&gt;        8       15 
#&gt; 
#&gt; $counts
#&gt; [1] &quot;relative convergence (4)&quot;
#&gt; 
#&gt; $hessian
#&gt;                     parent_0 log_k_parent_sink
#&gt; parent_0            4.163631         -94.09343
#&gt; log_k_parent_sink -94.093431        6311.34610
#&gt; 
#&gt; $residuals
#&gt;      parent      parent      parent      parent      parent      parent 
#&gt;  0.55407218 -2.98452128  4.20445742 -1.68599939 -0.58185357 -0.72033730 
#&gt;      parent      parent 
#&gt; -0.24260405 -0.07020339 
#&gt; 
#&gt; $ms
#&gt; [1] 3.831956
#&gt; 
#&gt; $var_ms
#&gt;   parent 
#&gt; 3.831956 
#&gt; 
#&gt; $var_ms_unscaled
#&gt;   parent 
#&gt; 3.831956 
#&gt; 
#&gt; $var_ms_unweighted
#&gt;   parent 
#&gt; 3.831956 
#&gt; 
#&gt; $rank
#&gt; [1] 2
#&gt; 
#&gt; $df.residual
#&gt; [1] 6
#&gt; 
#&gt; $solution_type
#&gt; [1] &quot;analytical&quot;
#&gt; 
#&gt; $transform_rates
#&gt; [1] TRUE
#&gt; 
#&gt; $transform_fractions
#&gt; [1] TRUE
#&gt; 
#&gt; $method.modFit
#&gt; [1] &quot;Port&quot;
#&gt; 
#&gt; $maxit.modFit
#&gt; [1] &quot;auto&quot;
#&gt; 
#&gt; $calls
#&gt; [1] 29
#&gt; 
#&gt; $time
#&gt;    user  system elapsed 
#&gt;   0.064   0.000   0.067 
#&gt; 
#&gt; $mkinmod
#&gt; &lt;mkinmod&gt; model generated with
#&gt; Use of formation fractions $use_of_ff: min 
#&gt; Specification $spec:
#&gt; $parent
#&gt; $type: SFO; $sink: TRUE
#&gt; Coefficient matrix $coefmat available
#&gt; 
#&gt; $observed
#&gt;     name time value
#&gt; 1 parent    0 98.62
#&gt; 2 parent    3 81.43
#&gt; 3 parent    7 53.18
#&gt; 4 parent   14 34.89
#&gt; 5 parent   30 10.09
#&gt; 6 parent   62  1.50
#&gt; 7 parent   90  0.33
#&gt; 8 parent  118  0.08
#&gt; 
#&gt; $obs_vars
#&gt; [1] &quot;parent&quot;
#&gt; 
#&gt; $predicted
#&gt;       name       time       value
#&gt; 1   parent   0.000000 99.17407218
#&gt; 2   parent   1.191919 90.35253561
#&gt; 3   parent   2.383838 82.31567498
#&gt; 4   parent   3.000000 78.44547872
#&gt; 5   parent   3.575758 74.99369333
#&gt; 6   parent   4.767677 68.32300215
#&gt; 7   parent   5.959596 62.24566915
#&gt; 8   parent   7.000000 57.38445742
#&gt; 9   parent   7.151515 56.70891509
#&gt; 10  parent   8.343434 51.66465547
#&gt; 11  parent   9.535354 47.06908288
#&gt; 12  parent  10.727273 42.88228661
#&gt; 13  parent  11.919192 39.06790599
#&gt; 14  parent  13.111111 35.59281463
#&gt; 15  parent  14.000000 33.20400061
#&gt; 16  parent  14.303030 32.42683275
#&gt; 17  parent  15.494949 29.54246504
#&gt; 18  parent  16.686869 26.91466193
#&gt; 19  parent  17.878788 24.52060198
#&gt; 20  parent  19.070707 22.33949373
#&gt; 21  parent  20.262626 20.35239512
#&gt; 22  parent  21.454545 18.54204899
#&gt; 23  parent  22.646465 16.89273320
#&gt; 24  parent  23.838384 15.39012410
#&gt; 25  parent  25.030303 14.02117212
#&gt; 26  parent  26.222222 12.77398846
#&gt; 27  parent  27.414141 11.63774182
#&gt; 28  parent  28.606061 10.60256435
#&gt; 29  parent  29.797980  9.65946594
#&gt; 30  parent  30.000000  9.50814643
#&gt; 31  parent  30.989899  8.80025617
#&gt; 32  parent  32.181818  8.01747313
#&gt; 33  parent  33.373737  7.30431867
#&gt; 34  parent  34.565657  6.65459931
#&gt; 35  parent  35.757576  6.06267251
#&gt; 36  parent  36.949495  5.52339762
#&gt; 37  parent  38.141414  5.03209124
#&gt; 38  parent  39.333333  4.58448658
#&gt; 39  parent  40.525253  4.17669637
#&gt; 40  parent  41.717172  3.80517911
#&gt; 41  parent  42.909091  3.46670832
#&gt; 42  parent  44.101010  3.15834451
#&gt; 43  parent  45.292929  2.87740968
#&gt; 44  parent  46.484848  2.62146400
#&gt; 45  parent  47.676768  2.38828471
#&gt; 46  parent  48.868687  2.17584671
#&gt; 47  parent  50.060606  1.98230508
#&gt; 48  parent  51.252525  1.80597899
#&gt; 49  parent  52.444444  1.64533711
#&gt; 50  parent  53.636364  1.49898432
#&gt; 51  parent  54.828283  1.36564963
#&gt; 52  parent  56.020202  1.24417505
#&gt; 53  parent  57.212121  1.13350565
#&gt; 54  parent  58.404040  1.03268029
#&gt; 55  parent  59.595960  0.94082335
#&gt; 56  parent  60.787879  0.85713708
#&gt; 57  parent  61.979798  0.78089471
#&gt; 58  parent  62.000000  0.77966270
#&gt; 59  parent  63.171717  0.71143411
#&gt; 60  parent  64.363636  0.64815202
#&gt; 61  parent  65.555556  0.59049888
#&gt; 62  parent  66.747475  0.53797399
#&gt; 63  parent  67.939394  0.49012119
#&gt; 64  parent  69.131313  0.44652489
#&gt; 65  parent  70.323232  0.40680649
#&gt; 66  parent  71.515152  0.37062104
#&gt; 67  parent  72.707071  0.33765429
#&gt; 68  parent  73.898990  0.30761993
#&gt; 69  parent  75.090909  0.28025713
#&gt; 70  parent  76.282828  0.25532825
#&gt; 71  parent  77.474747  0.23261679
#&gt; 72  parent  78.666667  0.21192552
#&gt; 73  parent  79.858586  0.19307474
#&gt; 74  parent  81.050505  0.17590074
#&gt; 75  parent  82.242424  0.16025436
#&gt; 76  parent  83.434343  0.14599973
#&gt; 77  parent  84.626263  0.13301305
#&gt; 78  parent  85.818182  0.12118154
#&gt; 79  parent  87.010101  0.11040244
#&gt; 80  parent  88.202020  0.10058214
#&gt; 81  parent  89.393939  0.09163535
#&gt; 82  parent  90.000000  0.08739595
#&gt; 83  parent  90.585859  0.08348439
#&gt; 84  parent  91.777778  0.07605845
#&gt; 85  parent  92.969697  0.06929305
#&gt; 86  parent  94.161616  0.06312943
#&gt; 87  parent  95.353535  0.05751406
#&gt; 88  parent  96.545455  0.05239819
#&gt; 89  parent  97.737374  0.04773737
#&gt; 90  parent  98.929293  0.04349113
#&gt; 91  parent 100.121212  0.03962259
#&gt; 92  parent 101.313131  0.03609816
#&gt; 93  parent 102.505051  0.03288723
#&gt; 94  parent 103.696970  0.02996191
#&gt; 95  parent 104.888889  0.02729679
#&gt; 96  parent 106.080808  0.02486874
#&gt; 97  parent 107.272727  0.02265667
#&gt; 98  parent 108.464646  0.02064136
#&gt; 99  parent 109.656566  0.01880531
#&gt; 100 parent 110.848485  0.01713257
#&gt; 101 parent 112.040404  0.01560863
#&gt; 102 parent 113.232323  0.01422024
#&gt; 103 parent 114.424242  0.01295535
#&gt; 104 parent 115.616162  0.01180297
#&gt; 105 parent 116.808081  0.01075310
#&gt; 106 parent 118.000000  0.00979661
#&gt; 
#&gt; $cost
#&gt; function (P) 
#&gt; {
#&gt;     assign(&quot;calls&quot;, calls + 1, inherits = TRUE)
#&gt;     if (trace_parms) 
#&gt;         cat(P, &quot;\n&quot;)
#&gt;     if (length(state.ini.optim) &gt; 0) {
#&gt;         odeini &lt;- c(P[1:length(state.ini.optim)], state.ini.fixed)
#&gt;         names(odeini) &lt;- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
#&gt;     }
#&gt;     else {
#&gt;         odeini &lt;- state.ini.fixed
#&gt;         names(odeini) &lt;- state.ini.fixed.boxnames
#&gt;     }
#&gt;     odeparms &lt;- c(P[(length(state.ini.optim) + 1):length(P)], 
#&gt;         transparms.fixed)
#&gt;     parms &lt;- backtransform_odeparms(odeparms, mkinmod, transform_rates = transform_rates, 
#&gt;         transform_fractions = transform_fractions)
#&gt;     out &lt;- mkinpredict(mkinmod, parms, odeini, outtimes, solution_type = solution_type, 
#&gt;         use_compiled = use_compiled, method.ode = method.ode, 
#&gt;         atol = atol, rtol = rtol, ...)
#&gt;     assign(&quot;out_predicted&quot;, out, inherits = TRUE)
#&gt;     mC &lt;- modCost(out, observed, y = &quot;value&quot;, err = err, weight = weight, 
#&gt;         scaleVar = scaleVar)
#&gt;     if (mC$model &lt; cost.old) {
#&gt;         if (!quiet) 
#&gt;             cat(&quot;Model cost at call &quot;, calls, &quot;: &quot;, mC$model, 
#&gt;                 &quot;\n&quot;)
#&gt;         if (plot) {
#&gt;             outtimes_plot = seq(min(observed$time), max(observed$time), 
#&gt;                 length.out = 100)
#&gt;             out_plot &lt;- mkinpredict(mkinmod, parms, odeini, outtimes_plot, 
#&gt;                 solution_type = solution_type, use_compiled = use_compiled, 
#&gt;                 method.ode = method.ode, atol = atol, rtol = rtol, 
#&gt;                 ...)
#&gt;             plot(0, type = &quot;n&quot;, xlim = range(observed$time), 
#&gt;                 ylim = c(0, max(observed$value, na.rm = TRUE)), 
#&gt;                 xlab = &quot;Time&quot;, ylab = &quot;Observed&quot;)
#&gt;             col_obs &lt;- pch_obs &lt;- 1:length(obs_vars)
#&gt;             lty_obs &lt;- rep(1, length(obs_vars))
#&gt;             names(col_obs) &lt;- names(pch_obs) &lt;- names(lty_obs) &lt;- obs_vars
#&gt;             for (obs_var in obs_vars) {
#&gt;                 points(subset(observed, name == obs_var, c(time, 
#&gt;                   value)), pch = pch_obs[obs_var], col = col_obs[obs_var])
#&gt;             }
#&gt;             matlines(out_plot$time, out_plot[-1], col = col_obs, 
#&gt;                 lty = lty_obs)
#&gt;             legend(&quot;topright&quot;, inset = c(0.05, 0.05), legend = obs_vars, 
#&gt;                 col = col_obs, pch = pch_obs, lty = 1:length(pch_obs))
#&gt;         }
#&gt;         assign(&quot;cost.old&quot;, mC$model, inherits = TRUE)
#&gt;     }
#&gt;     return(mC)
#&gt; }
#&gt; &lt;environment: 0x3c1a660&gt;
#&gt; 
#&gt; $cost_notrans
#&gt; function (P) 
#&gt; {
#&gt;     if (length(state.ini.optim) &gt; 0) {
#&gt;         odeini &lt;- c(P[1:length(state.ini.optim)], state.ini.fixed)
#&gt;         names(odeini) &lt;- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
#&gt;     }
#&gt;     else {
#&gt;         odeini &lt;- state.ini.fixed
#&gt;         names(odeini) &lt;- state.ini.fixed.boxnames
#&gt;     }
#&gt;     odeparms &lt;- c(P[(length(state.ini.optim) + 1):length(P)], 
#&gt;         parms.fixed)
#&gt;     out &lt;- mkinpredict(mkinmod, odeparms, odeini, outtimes, solution_type = solution_type, 
#&gt;         use_compiled = use_compiled, method.ode = method.ode, 
#&gt;         atol = atol, rtol = rtol, ...)
#&gt;     mC &lt;- modCost(out, observed, y = &quot;value&quot;, err = err, weight = weight, 
#&gt;         scaleVar = scaleVar)
#&gt;     return(mC)
#&gt; }
#&gt; &lt;environment: 0x3c1a660&gt;
#&gt; 
#&gt; $hessian_notrans
#&gt;                   parent_0 k_parent_sink
#&gt; parent_0          4.163631     -1203.894
#&gt; k_parent_sink -1203.893702   1033188.753
#&gt; 
#&gt; $start
#&gt;               value   type
#&gt; parent_0      98.62  state
#&gt; k_parent_sink  0.10 deparm
#&gt; 
#&gt; $start_transformed
#&gt;                       value lower upper
#&gt; parent_0          98.620000  -Inf   Inf
#&gt; log_k_parent_sink -2.302585  -Inf   Inf
#&gt; 
#&gt; $fixed
#&gt; [1] value type 
#&gt; &lt;0 rows&gt; (or 0-length row.names)
#&gt; 
#&gt; $data
#&gt;   time variable observed   predicted    residual
#&gt; 1    0   parent    98.62 99.17407218 -0.55407218
#&gt; 2    3   parent    81.43 78.44547872  2.98452128
#&gt; 3    7   parent    53.18 57.38445742 -4.20445742
#&gt; 4   14   parent    34.89 33.20400061  1.68599939
#&gt; 5   30   parent    10.09  9.50814643  0.58185357
#&gt; 6   62   parent     1.50  0.77966270  0.72033730
#&gt; 7   90   parent     0.33  0.08739595  0.24260405
#&gt; 8  118   parent     0.08  0.00979661  0.07020339
#&gt; 
#&gt; $atol
#&gt; [1] 1e-08
#&gt; 
#&gt; $rtol
#&gt; [1] 1e-10
#&gt; 
#&gt; $weight.ini
#&gt; [1] &quot;none&quot;
#&gt; 
#&gt; $reweight.tol
#&gt; [1] 1e-08
#&gt; 
#&gt; $reweight.max.iter
#&gt; [1] 10
#&gt; 
#&gt; $bparms.optim
#&gt;      parent_0 k_parent_sink 
#&gt;   99.17407218    0.07815759 
#&gt; 
#&gt; $bparms.fixed
#&gt; numeric(0)
#&gt; 
#&gt; $bparms.ode
#&gt; k_parent_sink 
#&gt;    0.07815759 
#&gt; 
#&gt; $bparms.state
#&gt;   parent 
#&gt; 99.17407 
#&gt; 
#&gt; $date
#&gt; [1] &quot;Thu Oct  6 10:47:28 2016&quot;
#&gt; 
#&gt; attr(,&quot;class&quot;)
#&gt; [1] &quot;mkinfit&quot; &quot;modFit&quot; 
#&gt; </div><div class='input'>  <span class='no'>fits</span>[<span class='st'>"SFO"</span>, <span class='st'>"B"</span>, <span class='kw'>drop</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>]</div><div class='output co'>#&gt; [[1]]
#&gt; $par
#&gt;          parent_0 log_k_parent_sink 
#&gt;         99.174072         -2.549028 
#&gt; 
#&gt; $ssr
#&gt; [1] 30.65564
#&gt; 
#&gt; $convergence
#&gt; [1] 0
#&gt; 
#&gt; $iterations
#&gt; [1] 5
#&gt; 
#&gt; $evaluations
#&gt; function gradient 
#&gt;        8       15 
#&gt; 
#&gt; $counts
#&gt; [1] &quot;relative convergence (4)&quot;
#&gt; 
#&gt; $hessian
#&gt;                     parent_0 log_k_parent_sink
#&gt; parent_0            4.163631         -94.09343
#&gt; log_k_parent_sink -94.093431        6311.34610
#&gt; 
#&gt; $residuals
#&gt;      parent      parent      parent      parent      parent      parent 
#&gt;  0.55407218 -2.98452128  4.20445742 -1.68599939 -0.58185357 -0.72033730 
#&gt;      parent      parent 
#&gt; -0.24260405 -0.07020339 
#&gt; 
#&gt; $ms
#&gt; [1] 3.831956
#&gt; 
#&gt; $var_ms
#&gt;   parent 
#&gt; 3.831956 
#&gt; 
#&gt; $var_ms_unscaled
#&gt;   parent 
#&gt; 3.831956 
#&gt; 
#&gt; $var_ms_unweighted
#&gt;   parent 
#&gt; 3.831956 
#&gt; 
#&gt; $rank
#&gt; [1] 2
#&gt; 
#&gt; $df.residual
#&gt; [1] 6
#&gt; 
#&gt; $solution_type
#&gt; [1] &quot;analytical&quot;
#&gt; 
#&gt; $transform_rates
#&gt; [1] TRUE
#&gt; 
#&gt; $transform_fractions
#&gt; [1] TRUE
#&gt; 
#&gt; $method.modFit
#&gt; [1] &quot;Port&quot;
#&gt; 
#&gt; $maxit.modFit
#&gt; [1] &quot;auto&quot;
#&gt; 
#&gt; $calls
#&gt; [1] 29
#&gt; 
#&gt; $time
#&gt;    user  system elapsed 
#&gt;   0.064   0.000   0.067 
#&gt; 
#&gt; $mkinmod
#&gt; &lt;mkinmod&gt; model generated with
#&gt; Use of formation fractions $use_of_ff: min 
#&gt; Specification $spec:
#&gt; $parent
#&gt; $type: SFO; $sink: TRUE
#&gt; Coefficient matrix $coefmat available
#&gt; 
#&gt; $observed
#&gt;     name time value
#&gt; 1 parent    0 98.62
#&gt; 2 parent    3 81.43
#&gt; 3 parent    7 53.18
#&gt; 4 parent   14 34.89
#&gt; 5 parent   30 10.09
#&gt; 6 parent   62  1.50
#&gt; 7 parent   90  0.33
#&gt; 8 parent  118  0.08
#&gt; 
#&gt; $obs_vars
#&gt; [1] &quot;parent&quot;
#&gt; 
#&gt; $predicted
#&gt;       name       time       value
#&gt; 1   parent   0.000000 99.17407218
#&gt; 2   parent   1.191919 90.35253561
#&gt; 3   parent   2.383838 82.31567498
#&gt; 4   parent   3.000000 78.44547872
#&gt; 5   parent   3.575758 74.99369333
#&gt; 6   parent   4.767677 68.32300215
#&gt; 7   parent   5.959596 62.24566915
#&gt; 8   parent   7.000000 57.38445742
#&gt; 9   parent   7.151515 56.70891509
#&gt; 10  parent   8.343434 51.66465547
#&gt; 11  parent   9.535354 47.06908288
#&gt; 12  parent  10.727273 42.88228661
#&gt; 13  parent  11.919192 39.06790599
#&gt; 14  parent  13.111111 35.59281463
#&gt; 15  parent  14.000000 33.20400061
#&gt; 16  parent  14.303030 32.42683275
#&gt; 17  parent  15.494949 29.54246504
#&gt; 18  parent  16.686869 26.91466193
#&gt; 19  parent  17.878788 24.52060198
#&gt; 20  parent  19.070707 22.33949373
#&gt; 21  parent  20.262626 20.35239512
#&gt; 22  parent  21.454545 18.54204899
#&gt; 23  parent  22.646465 16.89273320
#&gt; 24  parent  23.838384 15.39012410
#&gt; 25  parent  25.030303 14.02117212
#&gt; 26  parent  26.222222 12.77398846
#&gt; 27  parent  27.414141 11.63774182
#&gt; 28  parent  28.606061 10.60256435
#&gt; 29  parent  29.797980  9.65946594
#&gt; 30  parent  30.000000  9.50814643
#&gt; 31  parent  30.989899  8.80025617
#&gt; 32  parent  32.181818  8.01747313
#&gt; 33  parent  33.373737  7.30431867
#&gt; 34  parent  34.565657  6.65459931
#&gt; 35  parent  35.757576  6.06267251
#&gt; 36  parent  36.949495  5.52339762
#&gt; 37  parent  38.141414  5.03209124
#&gt; 38  parent  39.333333  4.58448658
#&gt; 39  parent  40.525253  4.17669637
#&gt; 40  parent  41.717172  3.80517911
#&gt; 41  parent  42.909091  3.46670832
#&gt; 42  parent  44.101010  3.15834451
#&gt; 43  parent  45.292929  2.87740968
#&gt; 44  parent  46.484848  2.62146400
#&gt; 45  parent  47.676768  2.38828471
#&gt; 46  parent  48.868687  2.17584671
#&gt; 47  parent  50.060606  1.98230508
#&gt; 48  parent  51.252525  1.80597899
#&gt; 49  parent  52.444444  1.64533711
#&gt; 50  parent  53.636364  1.49898432
#&gt; 51  parent  54.828283  1.36564963
#&gt; 52  parent  56.020202  1.24417505
#&gt; 53  parent  57.212121  1.13350565
#&gt; 54  parent  58.404040  1.03268029
#&gt; 55  parent  59.595960  0.94082335
#&gt; 56  parent  60.787879  0.85713708
#&gt; 57  parent  61.979798  0.78089471
#&gt; 58  parent  62.000000  0.77966270
#&gt; 59  parent  63.171717  0.71143411
#&gt; 60  parent  64.363636  0.64815202
#&gt; 61  parent  65.555556  0.59049888
#&gt; 62  parent  66.747475  0.53797399
#&gt; 63  parent  67.939394  0.49012119
#&gt; 64  parent  69.131313  0.44652489
#&gt; 65  parent  70.323232  0.40680649
#&gt; 66  parent  71.515152  0.37062104
#&gt; 67  parent  72.707071  0.33765429
#&gt; 68  parent  73.898990  0.30761993
#&gt; 69  parent  75.090909  0.28025713
#&gt; 70  parent  76.282828  0.25532825
#&gt; 71  parent  77.474747  0.23261679
#&gt; 72  parent  78.666667  0.21192552
#&gt; 73  parent  79.858586  0.19307474
#&gt; 74  parent  81.050505  0.17590074
#&gt; 75  parent  82.242424  0.16025436
#&gt; 76  parent  83.434343  0.14599973
#&gt; 77  parent  84.626263  0.13301305
#&gt; 78  parent  85.818182  0.12118154
#&gt; 79  parent  87.010101  0.11040244
#&gt; 80  parent  88.202020  0.10058214
#&gt; 81  parent  89.393939  0.09163535
#&gt; 82  parent  90.000000  0.08739595
#&gt; 83  parent  90.585859  0.08348439
#&gt; 84  parent  91.777778  0.07605845
#&gt; 85  parent  92.969697  0.06929305
#&gt; 86  parent  94.161616  0.06312943
#&gt; 87  parent  95.353535  0.05751406
#&gt; 88  parent  96.545455  0.05239819
#&gt; 89  parent  97.737374  0.04773737
#&gt; 90  parent  98.929293  0.04349113
#&gt; 91  parent 100.121212  0.03962259
#&gt; 92  parent 101.313131  0.03609816
#&gt; 93  parent 102.505051  0.03288723
#&gt; 94  parent 103.696970  0.02996191
#&gt; 95  parent 104.888889  0.02729679
#&gt; 96  parent 106.080808  0.02486874
#&gt; 97  parent 107.272727  0.02265667
#&gt; 98  parent 108.464646  0.02064136
#&gt; 99  parent 109.656566  0.01880531
#&gt; 100 parent 110.848485  0.01713257
#&gt; 101 parent 112.040404  0.01560863
#&gt; 102 parent 113.232323  0.01422024
#&gt; 103 parent 114.424242  0.01295535
#&gt; 104 parent 115.616162  0.01180297
#&gt; 105 parent 116.808081  0.01075310
#&gt; 106 parent 118.000000  0.00979661
#&gt; 
#&gt; $cost
#&gt; function (P) 
#&gt; {
#&gt;     assign(&quot;calls&quot;, calls + 1, inherits = TRUE)
#&gt;     if (trace_parms) 
#&gt;         cat(P, &quot;\n&quot;)
#&gt;     if (length(state.ini.optim) &gt; 0) {
#&gt;         odeini &lt;- c(P[1:length(state.ini.optim)], state.ini.fixed)
#&gt;         names(odeini) &lt;- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
#&gt;     }
#&gt;     else {
#&gt;         odeini &lt;- state.ini.fixed
#&gt;         names(odeini) &lt;- state.ini.fixed.boxnames
#&gt;     }
#&gt;     odeparms &lt;- c(P[(length(state.ini.optim) + 1):length(P)], 
#&gt;         transparms.fixed)
#&gt;     parms &lt;- backtransform_odeparms(odeparms, mkinmod, transform_rates = transform_rates, 
#&gt;         transform_fractions = transform_fractions)
#&gt;     out &lt;- mkinpredict(mkinmod, parms, odeini, outtimes, solution_type = solution_type, 
#&gt;         use_compiled = use_compiled, method.ode = method.ode, 
#&gt;         atol = atol, rtol = rtol, ...)
#&gt;     assign(&quot;out_predicted&quot;, out, inherits = TRUE)
#&gt;     mC &lt;- modCost(out, observed, y = &quot;value&quot;, err = err, weight = weight, 
#&gt;         scaleVar = scaleVar)
#&gt;     if (mC$model &lt; cost.old) {
#&gt;         if (!quiet) 
#&gt;             cat(&quot;Model cost at call &quot;, calls, &quot;: &quot;, mC$model, 
#&gt;                 &quot;\n&quot;)
#&gt;         if (plot) {
#&gt;             outtimes_plot = seq(min(observed$time), max(observed$time), 
#&gt;                 length.out = 100)
#&gt;             out_plot &lt;- mkinpredict(mkinmod, parms, odeini, outtimes_plot, 
#&gt;                 solution_type = solution_type, use_compiled = use_compiled, 
#&gt;                 method.ode = method.ode, atol = atol, rtol = rtol, 
#&gt;                 ...)
#&gt;             plot(0, type = &quot;n&quot;, xlim = range(observed$time), 
#&gt;                 ylim = c(0, max(observed$value, na.rm = TRUE)), 
#&gt;                 xlab = &quot;Time&quot;, ylab = &quot;Observed&quot;)
#&gt;             col_obs &lt;- pch_obs &lt;- 1:length(obs_vars)
#&gt;             lty_obs &lt;- rep(1, length(obs_vars))
#&gt;             names(col_obs) &lt;- names(pch_obs) &lt;- names(lty_obs) &lt;- obs_vars
#&gt;             for (obs_var in obs_vars) {
#&gt;                 points(subset(observed, name == obs_var, c(time, 
#&gt;                   value)), pch = pch_obs[obs_var], col = col_obs[obs_var])
#&gt;             }
#&gt;             matlines(out_plot$time, out_plot[-1], col = col_obs, 
#&gt;                 lty = lty_obs)
#&gt;             legend(&quot;topright&quot;, inset = c(0.05, 0.05), legend = obs_vars, 
#&gt;                 col = col_obs, pch = pch_obs, lty = 1:length(pch_obs))
#&gt;         }
#&gt;         assign(&quot;cost.old&quot;, mC$model, inherits = TRUE)
#&gt;     }
#&gt;     return(mC)
#&gt; }
#&gt; &lt;environment: 0x3c1a660&gt;
#&gt; 
#&gt; $cost_notrans
#&gt; function (P) 
#&gt; {
#&gt;     if (length(state.ini.optim) &gt; 0) {
#&gt;         odeini &lt;- c(P[1:length(state.ini.optim)], state.ini.fixed)
#&gt;         names(odeini) &lt;- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
#&gt;     }
#&gt;     else {
#&gt;         odeini &lt;- state.ini.fixed
#&gt;         names(odeini) &lt;- state.ini.fixed.boxnames
#&gt;     }
#&gt;     odeparms &lt;- c(P[(length(state.ini.optim) + 1):length(P)], 
#&gt;         parms.fixed)
#&gt;     out &lt;- mkinpredict(mkinmod, odeparms, odeini, outtimes, solution_type = solution_type, 
#&gt;         use_compiled = use_compiled, method.ode = method.ode, 
#&gt;         atol = atol, rtol = rtol, ...)
#&gt;     mC &lt;- modCost(out, observed, y = &quot;value&quot;, err = err, weight = weight, 
#&gt;         scaleVar = scaleVar)
#&gt;     return(mC)
#&gt; }
#&gt; &lt;environment: 0x3c1a660&gt;
#&gt; 
#&gt; $hessian_notrans
#&gt;                   parent_0 k_parent_sink
#&gt; parent_0          4.163631     -1203.894
#&gt; k_parent_sink -1203.893702   1033188.753
#&gt; 
#&gt; $start
#&gt;               value   type
#&gt; parent_0      98.62  state
#&gt; k_parent_sink  0.10 deparm
#&gt; 
#&gt; $start_transformed
#&gt;                       value lower upper
#&gt; parent_0          98.620000  -Inf   Inf
#&gt; log_k_parent_sink -2.302585  -Inf   Inf
#&gt; 
#&gt; $fixed
#&gt; [1] value type 
#&gt; &lt;0 rows&gt; (or 0-length row.names)
#&gt; 
#&gt; $data
#&gt;   time variable observed   predicted    residual
#&gt; 1    0   parent    98.62 99.17407218 -0.55407218
#&gt; 2    3   parent    81.43 78.44547872  2.98452128
#&gt; 3    7   parent    53.18 57.38445742 -4.20445742
#&gt; 4   14   parent    34.89 33.20400061  1.68599939
#&gt; 5   30   parent    10.09  9.50814643  0.58185357
#&gt; 6   62   parent     1.50  0.77966270  0.72033730
#&gt; 7   90   parent     0.33  0.08739595  0.24260405
#&gt; 8  118   parent     0.08  0.00979661  0.07020339
#&gt; 
#&gt; $atol
#&gt; [1] 1e-08
#&gt; 
#&gt; $rtol
#&gt; [1] 1e-10
#&gt; 
#&gt; $weight.ini
#&gt; [1] &quot;none&quot;
#&gt; 
#&gt; $reweight.tol
#&gt; [1] 1e-08
#&gt; 
#&gt; $reweight.max.iter
#&gt; [1] 10
#&gt; 
#&gt; $bparms.optim
#&gt;      parent_0 k_parent_sink 
#&gt;   99.17407218    0.07815759 
#&gt; 
#&gt; $bparms.fixed
#&gt; numeric(0)
#&gt; 
#&gt; $bparms.ode
#&gt; k_parent_sink 
#&gt;    0.07815759 
#&gt; 
#&gt; $bparms.state
#&gt;   parent 
#&gt; 99.17407 
#&gt; 
#&gt; $date
#&gt; [1] &quot;Thu Oct  6 10:47:28 2016&quot;
#&gt; 
#&gt; attr(,&quot;class&quot;)
#&gt; [1] &quot;mkinfit&quot; &quot;modFit&quot; 
#&gt; 
#&gt; </div></pre>
  </div>
  <div class="col-md-3">
    <h2>Author</h2>
    
  Johannes Ranke

  </div>
</div>

      <footer>
      <p>Built by <a href="http://hadley.github.io/pkgdown/">pkgdown</a>. Styled with <a href="http://getbootstrap.com">Bootstrap 3</a>.</p>
      </footer>
   </div>

  </body>
</html>

Contact - Imprint