aboutsummaryrefslogtreecommitdiff
path: root/docs/dev/reference/saem.html
blob: 620173b27e3e2a34383cfabf5146b088977e4491 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
  <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 nonlinear mixed models with SAEM — saem • mkin</title>


<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<!-- Bootstrap -->

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous" />

<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script>

<!-- bootstrap-toc -->
<link rel="stylesheet" href="../bootstrap-toc.css">
<script src="../bootstrap-toc.js"></script>

<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous" />

<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script>

<!-- headroom.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>

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




<meta property="og:title" content="Fit nonlinear mixed models with SAEM — saem" />
<meta property="og:description" content="This function uses saemix::saemix() as a backend for fitting nonlinear mixed
effects models created from mmkin row objects using the Stochastic Approximation
Expectation Maximisation algorithm (SAEM)." />


<meta name="robots" content="noindex">

<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></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 data-spy="scroll" data-target="#toc">
    <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" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <span class="navbar-brand">
        <a class="navbar-link" href="../index.html">mkin</a>
        <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">1.0.5</span>
      </span>
    </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/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a>
    </li>
    <li>
      <a href="../articles/web_only/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>
    <li>
      <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a>
    </li>
    <li>
      <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a>
    </li>
  </ul>
</li>
<li>
  <a href="../news/index.html">News</a>
</li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        <li>
  <a href="https://github.com/jranke/mkin/">
    <span class="fab 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 nonlinear mixed models with SAEM</h1>
    <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/saem.R'><code>R/saem.R</code></a></small>
    <div class="hidden name"><code>saem.Rd</code></div>
    </div>

    <div class="ref-description">
    <p>This function uses <code><a href='https://rdrr.io/pkg/saemix/man/saemix.html'>saemix::saemix()</a></code> as a backend for fitting nonlinear mixed
effects models created from <a href='mmkin.html'>mmkin</a> row objects using the Stochastic Approximation
Expectation Maximisation algorithm (SAEM).</p>
    </div>

    <pre class="usage"><span class='fu'>saem</span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span>

<span class='co'># S3 method for mmkin</span>
<span class='fu'>saem</span><span class='op'>(</span>
  <span class='va'>object</span>,
  transformations <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"mkin"</span>, <span class='st'>"saemix"</span><span class='op'>)</span>,
  degparms_start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/numeric.html'>numeric</a></span><span class='op'>(</span><span class='op'>)</span>,
  test_log_parms <span class='op'>=</span> <span class='cn'>TRUE</span>,
  conf.level <span class='op'>=</span> <span class='fl'>0.6</span>,
  solution_type <span class='op'>=</span> <span class='st'>"auto"</span>,
  nbiter.saemix <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>300</span>, <span class='fl'>100</span><span class='op'>)</span>,
  control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>displayProgress <span class='op'>=</span> <span class='cn'>FALSE</span>, print <span class='op'>=</span> <span class='cn'>FALSE</span>, nbiter.saemix <span class='op'>=</span> <span class='va'>nbiter.saemix</span>,
    save <span class='op'>=</span> <span class='cn'>FALSE</span>, save.graphs <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span>,
  fail_with_errors <span class='op'>=</span> <span class='cn'>TRUE</span>,
  verbose <span class='op'>=</span> <span class='cn'>FALSE</span>,
  quiet <span class='op'>=</span> <span class='cn'>FALSE</span>,
  <span class='va'>...</span>
<span class='op'>)</span>

<span class='co'># S3 method for saem.mmkin</span>
<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, digits <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Extremes.html'>max</a></span><span class='op'>(</span><span class='fl'>3</span>, <span class='fu'><a href='https://rdrr.io/r/base/options.html'>getOption</a></span><span class='op'>(</span><span class='st'>"digits"</span><span class='op'>)</span> <span class='op'>-</span> <span class='fl'>3</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span>

<span class='fu'>saemix_model</span><span class='op'>(</span>
  <span class='va'>object</span>,
  solution_type <span class='op'>=</span> <span class='st'>"auto"</span>,
  transformations <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"mkin"</span>, <span class='st'>"saemix"</span><span class='op'>)</span>,
  degparms_start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/numeric.html'>numeric</a></span><span class='op'>(</span><span class='op'>)</span>,
  test_log_parms <span class='op'>=</span> <span class='cn'>FALSE</span>,
  verbose <span class='op'>=</span> <span class='cn'>FALSE</span>,
  <span class='va'>...</span>
<span class='op'>)</span>

<span class='fu'>saemix_data</span><span class='op'>(</span><span class='va'>object</span>, verbose <span class='op'>=</span> <span class='cn'>FALSE</span>, <span class='va'>...</span><span class='op'>)</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>object</th>
      <td><p>An <a href='mmkin.html'>mmkin</a> row object containing several fits of the same
<a href='mkinmod.html'>mkinmod</a> model to different datasets</p></td>
    </tr>
    <tr>
      <th>...</th>
      <td><p>Further parameters passed to <a href='https://rdrr.io/pkg/saemix/man/saemixModel.html'>saemix::saemixModel</a>.</p></td>
    </tr>
    <tr>
      <th>transformations</th>
      <td><p>Per default, all parameter transformations are done
in mkin. If this argument is set to 'saemix', parameter transformations
are done in 'saemix' for the supported cases. Currently this is only
supported in cases where the initial concentration of the parent is not fixed,
SFO or DFOP is used for the parent and there is either no metabolite or one.</p></td>
    </tr>
    <tr>
      <th>degparms_start</th>
      <td><p>Parameter values given as a named numeric vector will
be used to override the starting values obtained from the 'mmkin' object.</p></td>
    </tr>
    <tr>
      <th>test_log_parms</th>
      <td><p>If TRUE, an attempt is made to use more robust starting
values for population parameters fitted as log parameters in mkin (like
rate constants) by only considering rate constants that pass the t-test
when calculating mean degradation parameters using <a href='mean_degparms.html'>mean_degparms</a>.</p></td>
    </tr>
    <tr>
      <th>conf.level</th>
      <td><p>Possibility to adjust the required confidence level
for parameter that are tested if requested by 'test_log_parms'.</p></td>
    </tr>
    <tr>
      <th>solution_type</th>
      <td><p>Possibility to specify the solution type in case the
automatic choice is not desired</p></td>
    </tr>
    <tr>
      <th>nbiter.saemix</th>
      <td><p>Convenience option to increase the number of
iterations</p></td>
    </tr>
    <tr>
      <th>control</th>
      <td><p>Passed to <a href='https://rdrr.io/pkg/saemix/man/saemix.html'>saemix::saemix</a>.</p></td>
    </tr>
    <tr>
      <th>fail_with_errors</th>
      <td><p>Should a failure to compute standard errors
from the inverse of the Fisher Information Matrix be a failure?</p></td>
    </tr>
    <tr>
      <th>verbose</th>
      <td><p>Should we print information about created objects of
type <a href='https://rdrr.io/pkg/saemix/man/SaemixModel-class.html'>saemix::SaemixModel</a> and <a href='https://rdrr.io/pkg/saemix/man/SaemixData-class.html'>saemix::SaemixData</a>?</p></td>
    </tr>
    <tr>
      <th>quiet</th>
      <td><p>Should we suppress the messages saemix prints at the beginning
and the end of the optimisation process?</p></td>
    </tr>
    <tr>
      <th>x</th>
      <td><p>An saem.mmkin object to print</p></td>
    </tr>
    <tr>
      <th>digits</th>
      <td><p>Number of digits to use for printing</p></td>
    </tr>
    </table>

    <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>

    <p>An S3 object of class 'saem.mmkin', containing the fitted
<a href='https://rdrr.io/pkg/saemix/man/SaemixObject-class.html'>saemix::SaemixObject</a> as a list component named 'so'. The
object also inherits from 'mixed.mmkin'.</p>
<p>An <a href='https://rdrr.io/pkg/saemix/man/SaemixModel-class.html'>saemix::SaemixModel</a> object.</p>
<p>An <a href='https://rdrr.io/pkg/saemix/man/SaemixData-class.html'>saemix::SaemixData</a> object.</p>
    <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>

    <p>An mmkin row object is essentially a list of mkinfit objects that have been
obtained by fitting the same model to a list of datasets using <a href='mkinfit.html'>mkinfit</a>.</p>
<p>Starting values for the fixed effects (population mean parameters, argument
psi0 of <code><a href='https://rdrr.io/pkg/saemix/man/saemixModel.html'>saemix::saemixModel()</a></code> are the mean values of the parameters found
using <a href='mmkin.html'>mmkin</a>.</p>
    <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>

    <div class='dont-index'><p><a href='summary.saem.mmkin.html'>summary.saem.mmkin</a> <a href='plot.mixed.mmkin.html'>plot.mixed.mmkin</a></p></div>

    <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
    <pre class="examples"><div class='input'><span class='co'># \dontrun{</span>
<span class='va'>ds</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>experimental_data_for_UBA_2019</span><span class='op'>[</span><span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>]</span>,
 <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>[</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"name"</span>, <span class='st'>"time"</span>, <span class='st'>"value"</span><span class='op'>)</span><span class='op'>]</span><span class='op'>)</span><span class='op'>)</span>
<span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>ds</span><span class='op'>)</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Dataset"</span>, <span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>)</span>
<span class='va'>f_mmkin_parent_p0_fixed</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='va'>ds</span>,
  state.ini <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fl'>100</span><span class='op'>)</span>, fixed_initials <span class='op'>=</span> <span class='st'>"parent"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
<span class='va'>f_saem_p0_fixed</span> <span class='op'>&lt;-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin_parent_p0_fixed</span><span class='op'>)</span>
</div><div class='output co'>#&gt; Running main SAEM algorithm
#&gt; [1] "Wed Aug  4 16:22:05 2021"
#&gt; ....
#&gt;     Minimisation finished
#&gt; [1] "Wed Aug  4 16:22:06 2021"</div><div class='input'>
<span class='va'>f_mmkin_parent</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
<span class='va'>f_saem_sfo</span> <span class='op'>&lt;-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin_parent</span><span class='op'>[</span><span class='st'>"SFO"</span>, <span class='op'>]</span><span class='op'>)</span>
</div><div class='output co'>#&gt; Running main SAEM algorithm
#&gt; [1] "Wed Aug  4 16:22:08 2021"
#&gt; ....
#&gt;     Minimisation finished
#&gt; [1] "Wed Aug  4 16:22:10 2021"</div><div class='input'><span class='va'>f_saem_fomc</span> <span class='op'>&lt;-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin_parent</span><span class='op'>[</span><span class='st'>"FOMC"</span>, <span class='op'>]</span><span class='op'>)</span>
</div><div class='output co'>#&gt; Running main SAEM algorithm
#&gt; [1] "Wed Aug  4 16:22:10 2021"
#&gt; ....
#&gt;     Minimisation finished
#&gt; [1] "Wed Aug  4 16:22:12 2021"</div><div class='input'><span class='va'>f_saem_dfop</span> <span class='op'>&lt;-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin_parent</span><span class='op'>[</span><span class='st'>"DFOP"</span>, <span class='op'>]</span><span class='op'>)</span>
</div><div class='output co'>#&gt; Running main SAEM algorithm
#&gt; [1] "Wed Aug  4 16:22:12 2021"
#&gt; ....
#&gt;     Minimisation finished
#&gt; [1] "Wed Aug  4 16:22:16 2021"</div><div class='input'>
<span class='co'># The returned saem.mmkin object contains an SaemixObject, therefore we can use</span>
<span class='co'># functions from saemix</span>
<span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'>saemix</span><span class='op'>)</span>
</div><div class='output co'>#&gt; <span class='message'>Package saemix, version 3.1.9000</span>
#&gt; <span class='message'>  please direct bugs, questions and feedback to emmanuelle.comets@inserm.fr</span></div><div class='output co'>#&gt; <span class='message'></span>
#&gt; <span class='message'>Attaching package: ‘saemix’</span></div><div class='output co'>#&gt; <span class='message'>The following object is masked from ‘package:RxODE’:</span>
#&gt; <span class='message'></span>
#&gt; <span class='message'>    phi</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/saemix/man/compare.saemix.html'>compare.saemix</a></span><span class='op'>(</span><span class='va'>f_saem_sfo</span><span class='op'>$</span><span class='va'>so</span>, <span class='va'>f_saem_fomc</span><span class='op'>$</span><span class='va'>so</span>, <span class='va'>f_saem_dfop</span><span class='op'>$</span><span class='va'>so</span><span class='op'>)</span>
</div><div class='output co'>#&gt; <span class='message'>Likelihoods calculated by importance sampling</span></div><div class='output co'>#&gt;        AIC      BIC
#&gt; 1 624.2484 622.2956
#&gt; 2 467.7096 464.9757
#&gt; 3 495.4373 491.9222</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/saemix/man/plot-SaemixObject-method.html'>plot</a></span><span class='op'>(</span><span class='va'>f_saem_fomc</span><span class='op'>$</span><span class='va'>so</span>, plot.type <span class='op'>=</span> <span class='st'>"convergence"</span><span class='op'>)</span>
</div><div class='output co'>#&gt; Plotting convergence plots</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/saemix/man/plot-SaemixObject-method.html'>plot</a></span><span class='op'>(</span><span class='va'>f_saem_fomc</span><span class='op'>$</span><span class='va'>so</span>, plot.type <span class='op'>=</span> <span class='st'>"individual.fit"</span><span class='op'>)</span>
</div><div class='img'><img src='saem-1.png' alt='' width='700' height='433' /></div><div class='output co'>#&gt; Plotting individual fits</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/saemix/man/plot-SaemixObject-method.html'>plot</a></span><span class='op'>(</span><span class='va'>f_saem_fomc</span><span class='op'>$</span><span class='va'>so</span>, plot.type <span class='op'>=</span> <span class='st'>"npde"</span><span class='op'>)</span>
</div><div class='img'><img src='saem-2.png' alt='' width='700' height='433' /></div><div class='output co'>#&gt; Simulating data using nsim = 1000 simulated datasets
#&gt; Computing WRES and npde .
#&gt; Plotting npde</div><div class='img'><img src='saem-3.png' alt='' width='700' height='433' /></div><div class='output co'>#&gt; ---------------------------------------------
#&gt; Distribution of npde:
#&gt;            mean= -0.01528   (SE= 0.098 )
#&gt;        variance= 0.862   (SE= 0.13 )
#&gt;        skewness= 0.5016 
#&gt;        kurtosis= 1.18 
#&gt; ---------------------------------------------
#&gt; 
#&gt; Statistical tests
#&gt;   Wilcoxon signed rank test  : 0.679
#&gt;   Fisher variance test       : 0.36
#&gt;   SW test of normality       : 0.0855 .
#&gt; Global adjusted p-value      : 0.257
#&gt; ---
#&gt; Signif. codes: '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 
#&gt; ---------------------------------------------</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/saemix/man/plot-SaemixObject-method.html'>plot</a></span><span class='op'>(</span><span class='va'>f_saem_fomc</span><span class='op'>$</span><span class='va'>so</span>, plot.type <span class='op'>=</span> <span class='st'>"vpc"</span><span class='op'>)</span>
</div><div class='output co'>#&gt; Performing simulations under the model.
#&gt; Plotting VPC
#&gt; Method used for VPC: binning by quantiles on X , dividing into the following intervals
#&gt;   Interval  Centered.On
#&gt; 1 (-1,3]      1.3      
#&gt; 2 (3,8]       7.4      
#&gt; 3 (8,14]     13.2      
#&gt; 4 (14,21]    20.5      
#&gt; 5 (21,37.7]  29.5      
#&gt; 6 (37.7,60]  50.4      
#&gt; 7 (60,90]    76.6      
#&gt; 8 (90,120]  109.0      
#&gt; 9 (120,180] 156.0      </div><div class='img'><img src='saem-4.png' alt='' width='700' height='433' /></div><div class='input'>
<span class='va'>f_mmkin_parent_tc</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>f_mmkin_parent</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span>
<span class='va'>f_saem_fomc_tc</span> <span class='op'>&lt;-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin_parent_tc</span><span class='op'>[</span><span class='st'>"FOMC"</span>, <span class='op'>]</span><span class='op'>)</span>
</div><div class='output co'>#&gt; Running main SAEM algorithm
#&gt; [1] "Wed Aug  4 16:22:19 2021"
#&gt; ....
#&gt;     Minimisation finished
#&gt; [1] "Wed Aug  4 16:22:24 2021"</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/saemix/man/compare.saemix.html'>compare.saemix</a></span><span class='op'>(</span><span class='va'>f_saem_fomc</span><span class='op'>$</span><span class='va'>so</span>, <span class='va'>f_saem_fomc_tc</span><span class='op'>$</span><span class='va'>so</span><span class='op'>)</span>
</div><div class='output co'>#&gt; <span class='message'>Likelihoods calculated by importance sampling</span></div><div class='output co'>#&gt;        AIC      BIC
#&gt; 1 467.7096 464.9757
#&gt; 2 469.6831 466.5586</div><div class='input'>
<span class='va'>sfo_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
  A1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span>
</div><div class='output co'>#&gt; <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='va'>fomc_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
  A1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span>
</div><div class='output co'>#&gt; <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='va'>dfop_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
  A1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span>
</div><div class='output co'>#&gt; <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'><span class='co'># The following fit uses analytical solutions for SFO-SFO and DFOP-SFO,</span>
<span class='co'># and compiled ODEs for FOMC that are much slower</span>
<span class='va'>f_mmkin</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>
    <span class='st'>"SFO-SFO"</span> <span class='op'>=</span> <span class='va'>sfo_sfo</span>, <span class='st'>"FOMC-SFO"</span> <span class='op'>=</span> <span class='va'>fomc_sfo</span>, <span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>dfop_sfo</span><span class='op'>)</span>,
  <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
<span class='co'># saem fits of SFO-SFO and DFOP-SFO to these data take about five seconds</span>
<span class='co'># each on this system, as we use analytical solutions written for saemix.</span>
<span class='co'># When using the analytical solutions written for mkin this took around</span>
<span class='co'># four minutes</span>
<span class='va'>f_saem_sfo_sfo</span> <span class='op'>&lt;-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='op'>]</span><span class='op'>)</span>
</div><div class='output co'>#&gt; Running main SAEM algorithm
#&gt; [1] "Wed Aug  4 16:22:27 2021"
#&gt; ....
#&gt;     Minimisation finished
#&gt; [1] "Wed Aug  4 16:22:32 2021"</div><div class='input'><span class='va'>f_saem_dfop_sfo</span> <span class='op'>&lt;-</span> <span class='fu'>saem</span><span class='op'>(</span><span class='va'>f_mmkin</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span><span class='op'>)</span>
</div><div class='output co'>#&gt; Running main SAEM algorithm
#&gt; [1] "Wed Aug  4 16:22:33 2021"
#&gt; ....
#&gt;     Minimisation finished
#&gt; [1] "Wed Aug  4 16:22:42 2021"</div><div class='input'><span class='co'># We can use print, plot and summary methods to check the results</span>
<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_saem_dfop_sfo</span><span class='op'>)</span>
</div><div class='output co'>#&gt; Kinetic nonlinear mixed-effects model fit by SAEM
#&gt; Structural model:
#&gt; d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
#&gt;            time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
#&gt;            * parent
#&gt; d_A1/dt = + f_parent_to_A1 * ((k1 * g * exp(-k1 * time) + k2 * (1 - g)
#&gt;            * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
#&gt;            exp(-k2 * time))) * parent - k_A1 * A1
#&gt; 
#&gt; Data:
#&gt; 170 observations of 2 variable(s) grouped in 5 datasets
#&gt; 
#&gt; Likelihood computed by importance sampling
#&gt;     AIC   BIC logLik
#&gt;   839.6 834.6 -406.8
#&gt; 
#&gt; Fitted parameters:
#&gt;                     estimate    lower   upper
#&gt; parent_0            93.80521 91.22487 96.3856
#&gt; log_k_A1            -6.06244 -8.26517 -3.8597
#&gt; f_parent_qlogis     -0.97319 -1.37024 -0.5761
#&gt; log_k1              -2.55394 -4.00815 -1.0997
#&gt; log_k2              -3.47160 -5.18763 -1.7556
#&gt; g_qlogis            -0.09324 -1.42737  1.2409
#&gt; Var.parent_0         7.42157 -3.25683 18.1000
#&gt; Var.log_k_A1         4.22850 -2.46339 10.9204
#&gt; Var.f_parent_qlogis  0.19803 -0.05541  0.4515
#&gt; Var.log_k1           2.28644 -0.86079  5.4337
#&gt; Var.log_k2           3.35626 -1.14639  7.8589
#&gt; Var.g_qlogis         0.20084 -1.32516  1.7268
#&gt; a.1                  1.88399  1.66794  2.1000
#&gt; SD.parent_0          2.72425  0.76438  4.6841
#&gt; SD.log_k_A1          2.05633  0.42919  3.6835
#&gt; SD.f_parent_qlogis   0.44501  0.16025  0.7298
#&gt; SD.log_k1            1.51210  0.47142  2.5528
#&gt; SD.log_k2            1.83201  0.60313  3.0609
#&gt; SD.g_qlogis          0.44816 -1.25437  2.1507</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/saemix/man/plot-SaemixObject-method.html'>plot</a></span><span class='op'>(</span><span class='va'>f_saem_dfop_sfo</span><span class='op'>)</span>
</div><div class='img'><img src='saem-5.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/saemix/man/summary-methods.html'>summary</a></span><span class='op'>(</span><span class='va'>f_saem_dfop_sfo</span>, data <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
</div><div class='output co'>#&gt; saemix version used for fitting:      3.1.9000 
#&gt; mkin version used for pre-fitting:  1.0.5 
#&gt; R version used for fitting:         4.1.0 
#&gt; Date of fit:     Wed Aug  4 16:22:43 2021 
#&gt; Date of summary: Wed Aug  4 16:22:43 2021 
#&gt; 
#&gt; Equations:
#&gt; d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
#&gt;            time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 * time)))
#&gt;            * parent
#&gt; d_A1/dt = + f_parent_to_A1 * ((k1 * g * exp(-k1 * time) + k2 * (1 - g)
#&gt;            * exp(-k2 * time)) / (g * exp(-k1 * time) + (1 - g) *
#&gt;            exp(-k2 * time))) * parent - k_A1 * A1
#&gt; 
#&gt; Data:
#&gt; 170 observations of 2 variable(s) grouped in 5 datasets
#&gt; 
#&gt; Model predictions using solution type analytical 
#&gt; 
#&gt; Fitted in 10.143 s using 300, 100 iterations
#&gt; 
#&gt; Variance model: Constant variance 
#&gt; 
#&gt; Mean of starting values for individual parameters:
#&gt;        parent_0        log_k_A1 f_parent_qlogis          log_k1          log_k2 
#&gt;         93.8102         -5.3734         -0.9711         -1.8799         -4.2708 
#&gt;        g_qlogis 
#&gt;          0.1356 
#&gt; 
#&gt; Fixed degradation parameter values:
#&gt; None
#&gt; 
#&gt; Results:
#&gt; 
#&gt; Likelihood computed by importance sampling
#&gt;     AIC   BIC logLik
#&gt;   839.6 834.6 -406.8
#&gt; 
#&gt; Optimised parameters:
#&gt;                     est.  lower   upper
#&gt; parent_0        93.80521 91.225 96.3856
#&gt; log_k_A1        -6.06244 -8.265 -3.8597
#&gt; f_parent_qlogis -0.97319 -1.370 -0.5761
#&gt; log_k1          -2.55394 -4.008 -1.0997
#&gt; log_k2          -3.47160 -5.188 -1.7556
#&gt; g_qlogis        -0.09324 -1.427  1.2409
#&gt; 
#&gt; Correlation: 
#&gt;                 prnt_0 lg__A1 f_prn_ log_k1 log_k2
#&gt; log_k_A1        -0.014                            
#&gt; f_parent_qlogis -0.025  0.054                     
#&gt; log_k1           0.027 -0.003 -0.005              
#&gt; log_k2           0.011  0.005 -0.002 -0.070       
#&gt; g_qlogis        -0.067 -0.009  0.011 -0.189 -0.171
#&gt; 
#&gt; Random effects:
#&gt;                      est.   lower  upper
#&gt; SD.parent_0        2.7243  0.7644 4.6841
#&gt; SD.log_k_A1        2.0563  0.4292 3.6835
#&gt; SD.f_parent_qlogis 0.4450  0.1602 0.7298
#&gt; SD.log_k1          1.5121  0.4714 2.5528
#&gt; SD.log_k2          1.8320  0.6031 3.0609
#&gt; SD.g_qlogis        0.4482 -1.2544 2.1507
#&gt; 
#&gt; Variance model:
#&gt;      est. lower upper
#&gt; a.1 1.884 1.668   2.1
#&gt; 
#&gt; Backtransformed parameters:
#&gt;                     est.     lower    upper
#&gt; parent_0       93.805214 9.122e+01 96.38556
#&gt; k_A1            0.002329 2.573e-04  0.02107
#&gt; f_parent_to_A1  0.274245 2.026e-01  0.35982
#&gt; k1              0.077775 1.817e-02  0.33296
#&gt; k2              0.031067 5.585e-03  0.17281
#&gt; g               0.476707 1.935e-01  0.77572
#&gt; 
#&gt; Resulting formation fractions:
#&gt;                 ff
#&gt; parent_A1   0.2742
#&gt; parent_sink 0.7258
#&gt; 
#&gt; Estimated disappearance times:
#&gt;          DT50  DT90 DT50back DT50_k1 DT50_k2
#&gt; parent  13.96  55.4    16.68   8.912   22.31
#&gt; A1     297.65 988.8       NA      NA      NA
#&gt; 
#&gt; Data:
#&gt;          ds   name time observed predicted  residual   std standardized
#&gt;   Dataset 6 parent    0     97.2  95.75408  1.445920 1.884     0.767479
#&gt;   Dataset 6 parent    0     96.4  95.75408  0.645920 1.884     0.342847
#&gt;   Dataset 6 parent    3     71.1  71.22466 -0.124662 1.884    -0.066169
#&gt;   Dataset 6 parent    3     69.2  71.22466 -2.024662 1.884    -1.074669
#&gt;   Dataset 6 parent    6     58.1  56.42290  1.677100 1.884     0.890187
#&gt;   Dataset 6 parent    6     56.6  56.42290  0.177100 1.884     0.094003
#&gt;   Dataset 6 parent   10     44.4  44.55255 -0.152554 1.884    -0.080974
#&gt;   Dataset 6 parent   10     43.4  44.55255 -1.152554 1.884    -0.611763
#&gt;   Dataset 6 parent   20     33.3  29.88846  3.411537 1.884     1.810807
#&gt;   Dataset 6 parent   20     29.2  29.88846 -0.688463 1.884    -0.365429
#&gt;   Dataset 6 parent   34     17.6  19.40826 -1.808260 1.884    -0.959805
#&gt;   Dataset 6 parent   34     18.0  19.40826 -1.408260 1.884    -0.747489
#&gt;   Dataset 6 parent   55     10.5  10.45560  0.044398 1.884     0.023566
#&gt;   Dataset 6 parent   55      9.3  10.45560 -1.155602 1.884    -0.613381
#&gt;   Dataset 6 parent   90      4.5   3.74026  0.759744 1.884     0.403264
#&gt;   Dataset 6 parent   90      4.7   3.74026  0.959744 1.884     0.509421
#&gt;   Dataset 6 parent  112      3.0   1.96015  1.039853 1.884     0.551943
#&gt;   Dataset 6 parent  112      3.4   1.96015  1.439853 1.884     0.764258
#&gt;   Dataset 6 parent  132      2.3   1.08940  1.210603 1.884     0.642575
#&gt;   Dataset 6 parent  132      2.7   1.08940  1.610603 1.884     0.854890
#&gt;   Dataset 6     A1    3      4.3   4.75601 -0.456009 1.884    -0.242045
#&gt;   Dataset 6     A1    3      4.6   4.75601 -0.156009 1.884    -0.082808
#&gt;   Dataset 6     A1    6      7.0   7.53839 -0.538391 1.884    -0.285772
#&gt;   Dataset 6     A1    6      7.2   7.53839 -0.338391 1.884    -0.179614
#&gt;   Dataset 6     A1   10      8.2   9.64728 -1.447276 1.884    -0.768198
#&gt;   Dataset 6     A1   10      8.0   9.64728 -1.647276 1.884    -0.874356
#&gt;   Dataset 6     A1   20     11.0  11.83954 -0.839545 1.884    -0.445621
#&gt;   Dataset 6     A1   20     13.7  11.83954  1.860455 1.884     0.987509
#&gt;   Dataset 6     A1   34     11.5  12.81233 -1.312327 1.884    -0.696569
#&gt;   Dataset 6     A1   34     12.7  12.81233 -0.112327 1.884    -0.059622
#&gt;   Dataset 6     A1   55     14.9  12.87919  2.020809 1.884     1.072624
#&gt;   Dataset 6     A1   55     14.5  12.87919  1.620809 1.884     0.860308
#&gt;   Dataset 6     A1   90     12.1  11.52464  0.575364 1.884     0.305397
#&gt;   Dataset 6     A1   90     12.3  11.52464  0.775364 1.884     0.411555
#&gt;   Dataset 6     A1  112      9.9  10.37694 -0.476938 1.884    -0.253153
#&gt;   Dataset 6     A1  112     10.2  10.37694 -0.176938 1.884    -0.093917
#&gt;   Dataset 6     A1  132      8.8   9.32474 -0.524742 1.884    -0.278528
#&gt;   Dataset 6     A1  132      7.8   9.32474 -1.524742 1.884    -0.809317
#&gt;   Dataset 7 parent    0     93.6  90.16918  3.430816 1.884     1.821040
#&gt;   Dataset 7 parent    0     92.3  90.16918  2.130816 1.884     1.131014
#&gt;   Dataset 7 parent    3     87.0  84.05442  2.945583 1.884     1.563483
#&gt;   Dataset 7 parent    3     82.2  84.05442 -1.854417 1.884    -0.984304
#&gt;   Dataset 7 parent    7     74.0  77.00960 -3.009596 1.884    -1.597461
#&gt;   Dataset 7 parent    7     73.9  77.00960 -3.109596 1.884    -1.650540
#&gt;   Dataset 7 parent   14     64.2  67.15684 -2.956840 1.884    -1.569459
#&gt;   Dataset 7 parent   14     69.5  67.15684  2.343160 1.884     1.243724
#&gt;   Dataset 7 parent   30     54.0  52.66290  1.337101 1.884     0.709719
#&gt;   Dataset 7 parent   30     54.6  52.66290  1.937101 1.884     1.028192
#&gt;   Dataset 7 parent   60     41.1  40.04995  1.050050 1.884     0.557355
#&gt;   Dataset 7 parent   60     38.4  40.04995 -1.649950 1.884    -0.875775
#&gt;   Dataset 7 parent   90     32.5  34.09675 -1.596746 1.884    -0.847535
#&gt;   Dataset 7 parent   90     35.5  34.09675  1.403254 1.884     0.744832
#&gt;   Dataset 7 parent  120     28.1  30.12281 -2.022814 1.884    -1.073688
#&gt;   Dataset 7 parent  120     29.0  30.12281 -1.122814 1.884    -0.595977
#&gt;   Dataset 7 parent  180     26.5  24.10888  2.391123 1.884     1.269182
#&gt;   Dataset 7 parent  180     27.6  24.10888  3.491123 1.884     1.853050
#&gt;   Dataset 7     A1    3      3.9   2.77684  1.123161 1.884     0.596161
#&gt;   Dataset 7     A1    3      3.1   2.77684  0.323161 1.884     0.171530
#&gt;   Dataset 7     A1    7      6.9   5.96705  0.932950 1.884     0.495200
#&gt;   Dataset 7     A1    7      6.6   5.96705  0.632950 1.884     0.335963
#&gt;   Dataset 7     A1   14     10.4  10.40535 -0.005348 1.884    -0.002839
#&gt;   Dataset 7     A1   14      8.3  10.40535 -2.105348 1.884    -1.117496
#&gt;   Dataset 7     A1   30     14.4  16.83722 -2.437216 1.884    -1.293648
#&gt;   Dataset 7     A1   30     13.7  16.83722 -3.137216 1.884    -1.665200
#&gt;   Dataset 7     A1   60     22.1  22.15018 -0.050179 1.884    -0.026635
#&gt;   Dataset 7     A1   60     22.3  22.15018  0.149821 1.884     0.079523
#&gt;   Dataset 7     A1   90     27.5  24.36286  3.137143 1.884     1.665161
#&gt;   Dataset 7     A1   90     25.4  24.36286  1.037143 1.884     0.550504
#&gt;   Dataset 7     A1  120     28.0  25.64064  2.359361 1.884     1.252323
#&gt;   Dataset 7     A1  120     26.6  25.64064  0.959361 1.884     0.509218
#&gt;   Dataset 7     A1  180     25.8  27.25486 -1.454858 1.884    -0.772223
#&gt;   Dataset 7     A1  180     25.3  27.25486 -1.954858 1.884    -1.037617
#&gt;   Dataset 8 parent    0     91.9  91.72652  0.173479 1.884     0.092081
#&gt;   Dataset 8 parent    0     90.8  91.72652 -0.926521 1.884    -0.491787
#&gt;   Dataset 8 parent    1     64.9  67.22810 -2.328104 1.884    -1.235732
#&gt;   Dataset 8 parent    1     66.2  67.22810 -1.028104 1.884    -0.545706
#&gt;   Dataset 8 parent    3     43.5  41.46375  2.036251 1.884     1.080820
#&gt;   Dataset 8 parent    3     44.1  41.46375  2.636251 1.884     1.399293
#&gt;   Dataset 8 parent    8     18.3  19.83597 -1.535968 1.884    -0.815275
#&gt;   Dataset 8 parent    8     18.1  19.83597 -1.735968 1.884    -0.921433
#&gt;   Dataset 8 parent   14     10.2  10.34793 -0.147927 1.884    -0.078518
#&gt;   Dataset 8 parent   14     10.8  10.34793  0.452073 1.884     0.239956
#&gt;   Dataset 8 parent   27      4.9   2.67641  2.223595 1.884     1.180260
#&gt;   Dataset 8 parent   27      3.3   2.67641  0.623595 1.884     0.330997
#&gt;   Dataset 8 parent   48      1.6   0.30218  1.297822 1.884     0.688870
#&gt;   Dataset 8 parent   48      1.5   0.30218  1.197822 1.884     0.635791
#&gt;   Dataset 8 parent   70      1.1   0.03075  1.069248 1.884     0.567545
#&gt;   Dataset 8 parent   70      0.9   0.03075  0.869248 1.884     0.461388
#&gt;   Dataset 8     A1    1      9.6   7.74066  1.859342 1.884     0.986918
#&gt;   Dataset 8     A1    1      7.7   7.74066 -0.040658 1.884    -0.021581
#&gt;   Dataset 8     A1    3     15.0  15.37549 -0.375495 1.884    -0.199309
#&gt;   Dataset 8     A1    3     15.1  15.37549 -0.275495 1.884    -0.146230
#&gt;   Dataset 8     A1    8     21.2  19.95900  1.241003 1.884     0.658711
#&gt;   Dataset 8     A1    8     21.1  19.95900  1.141003 1.884     0.605632
#&gt;   Dataset 8     A1   14     19.7  19.92898 -0.228978 1.884    -0.121539
#&gt;   Dataset 8     A1   14     18.9  19.92898 -1.028978 1.884    -0.546170
#&gt;   Dataset 8     A1   27     17.5  16.34046  1.159536 1.884     0.615469
#&gt;   Dataset 8     A1   27     15.9  16.34046 -0.440464 1.884    -0.233793
#&gt;   Dataset 8     A1   48      9.5  10.12131 -0.621313 1.884    -0.329786
#&gt;   Dataset 8     A1   48      9.8  10.12131 -0.321313 1.884    -0.170550
#&gt;   Dataset 8     A1   70      6.2   5.84753  0.352469 1.884     0.187087
#&gt;   Dataset 8     A1   70      6.1   5.84753  0.252469 1.884     0.134008
#&gt;   Dataset 9 parent    0     99.8  98.23600  1.564002 1.884     0.830155
#&gt;   Dataset 9 parent    0     98.3  98.23600  0.064002 1.884     0.033972
#&gt;   Dataset 9 parent    1     77.1  79.68007 -2.580074 1.884    -1.369475
#&gt;   Dataset 9 parent    1     77.2  79.68007 -2.480074 1.884    -1.316396
#&gt;   Dataset 9 parent    3     59.0  55.81142  3.188584 1.884     1.692465
#&gt;   Dataset 9 parent    3     58.1  55.81142  2.288584 1.884     1.214755
#&gt;   Dataset 9 parent    8     27.4  31.81995 -4.419948 1.884    -2.346060
#&gt;   Dataset 9 parent    8     29.2  31.81995 -2.619948 1.884    -1.390640
#&gt;   Dataset 9 parent   14     19.1  22.78328 -3.683282 1.884    -1.955046
#&gt;   Dataset 9 parent   14     29.6  22.78328  6.816718 1.884     3.618240
#&gt;   Dataset 9 parent   27     10.1  14.15172 -4.051720 1.884    -2.150609
#&gt;   Dataset 9 parent   27     18.2  14.15172  4.048280 1.884     2.148783
#&gt;   Dataset 9 parent   48      4.5   6.86094 -2.360941 1.884    -1.253162
#&gt;   Dataset 9 parent   48      9.1   6.86094  2.239059 1.884     1.188468
#&gt;   Dataset 9 parent   70      2.3   3.21580 -0.915798 1.884    -0.486096
#&gt;   Dataset 9 parent   70      2.9   3.21580 -0.315798 1.884    -0.167622
#&gt;   Dataset 9 parent   91      2.0   1.56010  0.439897 1.884     0.233492
#&gt;   Dataset 9 parent   91      1.8   1.56010  0.239897 1.884     0.127335
#&gt;   Dataset 9 parent  120      2.0   0.57458  1.425424 1.884     0.756600
#&gt;   Dataset 9 parent  120      2.2   0.57458  1.625424 1.884     0.862757
#&gt;   Dataset 9     A1    1      4.2   4.01796  0.182037 1.884     0.096623
#&gt;   Dataset 9     A1    1      3.9   4.01796 -0.117963 1.884    -0.062613
#&gt;   Dataset 9     A1    3      7.4   9.08527 -1.685270 1.884    -0.894523
#&gt;   Dataset 9     A1    3      7.9   9.08527 -1.185270 1.884    -0.629129
#&gt;   Dataset 9     A1    8     14.5  13.75054  0.749457 1.884     0.397804
#&gt;   Dataset 9     A1    8     13.7  13.75054 -0.050543 1.884    -0.026827
#&gt;   Dataset 9     A1   14     14.2  14.91180 -0.711804 1.884    -0.377818
#&gt;   Dataset 9     A1   14     12.2  14.91180 -2.711804 1.884    -1.439396
#&gt;   Dataset 9     A1   27     13.7  14.97813 -1.278129 1.884    -0.678417
#&gt;   Dataset 9     A1   27     13.2  14.97813 -1.778129 1.884    -0.943812
#&gt;   Dataset 9     A1   48     13.6  13.75574 -0.155745 1.884    -0.082668
#&gt;   Dataset 9     A1   48     15.4  13.75574  1.644255 1.884     0.872753
#&gt;   Dataset 9     A1   70     10.4  11.92861 -1.528608 1.884    -0.811369
#&gt;   Dataset 9     A1   70     11.6  11.92861 -0.328608 1.884    -0.174422
#&gt;   Dataset 9     A1   91     10.0  10.14395 -0.143947 1.884    -0.076405
#&gt;   Dataset 9     A1   91      9.5  10.14395 -0.643947 1.884    -0.341800
#&gt;   Dataset 9     A1  120      9.1   7.93869  1.161307 1.884     0.616409
#&gt;   Dataset 9     A1  120      9.0   7.93869  1.061307 1.884     0.563330
#&gt;  Dataset 10 parent    0     96.1  93.65914  2.440862 1.884     1.295583
#&gt;  Dataset 10 parent    0     94.3  93.65914  0.640862 1.884     0.340163
#&gt;  Dataset 10 parent    8     73.9  77.83065 -3.930647 1.884    -2.086344
#&gt;  Dataset 10 parent    8     73.9  77.83065 -3.930647 1.884    -2.086344
#&gt;  Dataset 10 parent   14     69.4  70.15862 -0.758619 1.884    -0.402667
#&gt;  Dataset 10 parent   14     73.1  70.15862  2.941381 1.884     1.561253
#&gt;  Dataset 10 parent   21     65.6  64.00840  1.591600 1.884     0.844804
#&gt;  Dataset 10 parent   21     65.3  64.00840  1.291600 1.884     0.685567
#&gt;  Dataset 10 parent   41     55.9  54.71192  1.188076 1.884     0.630618
#&gt;  Dataset 10 parent   41     54.4  54.71192 -0.311924 1.884    -0.165566
#&gt;  Dataset 10 parent   63     47.0  49.66775 -2.667747 1.884    -1.416011
#&gt;  Dataset 10 parent   63     49.3  49.66775 -0.367747 1.884    -0.195196
#&gt;  Dataset 10 parent   91     44.7  45.17119 -0.471186 1.884    -0.250101
#&gt;  Dataset 10 parent   91     46.7  45.17119  1.528814 1.884     0.811478
#&gt;  Dataset 10 parent  120     42.1  41.20430  0.895699 1.884     0.475427
#&gt;  Dataset 10 parent  120     41.3  41.20430  0.095699 1.884     0.050796
#&gt;  Dataset 10     A1    8      3.3   4.00920 -0.709204 1.884    -0.376438
#&gt;  Dataset 10     A1    8      3.4   4.00920 -0.609204 1.884    -0.323359
#&gt;  Dataset 10     A1   14      3.9   5.94267 -2.042668 1.884    -1.084226
#&gt;  Dataset 10     A1   14      2.9   5.94267 -3.042668 1.884    -1.615015
#&gt;  Dataset 10     A1   21      6.4   7.48222 -1.082219 1.884    -0.574430
#&gt;  Dataset 10     A1   21      7.2   7.48222 -0.282219 1.884    -0.149799
#&gt;  Dataset 10     A1   41      9.1   9.76246 -0.662460 1.884    -0.351626
#&gt;  Dataset 10     A1   41      8.5   9.76246 -1.262460 1.884    -0.670100
#&gt;  Dataset 10     A1   63     11.7  10.93972  0.760278 1.884     0.403547
#&gt;  Dataset 10     A1   63     12.0  10.93972  1.060278 1.884     0.562784
#&gt;  Dataset 10     A1   91     13.3  11.93666  1.363337 1.884     0.723645
#&gt;  Dataset 10     A1   91     13.2  11.93666  1.263337 1.884     0.670566
#&gt;  Dataset 10     A1  120     14.3  12.78218  1.517817 1.884     0.805641
#&gt;  Dataset 10     A1  120     12.1  12.78218 -0.682183 1.884    -0.362095</div><div class='input'>
<span class='co'># The following takes about 6 minutes</span>
<span class='co'>#f_saem_dfop_sfo_deSolve &lt;- saem(f_mmkin["DFOP-SFO", ], solution_type = "deSolve",</span>
<span class='co'>#  control = list(nbiter.saemix = c(200, 80), nbdisplay = 10))</span>

<span class='co'>#saemix::compare.saemix(list(</span>
<span class='co'>#  f_saem_dfop_sfo$so,</span>
<span class='co'>#  f_saem_dfop_sfo_deSolve$so))</span>

<span class='co'># If the model supports it, we can also use eigenvalue based solutions, which</span>
<span class='co'># take a similar amount of time</span>
<span class='co'>#f_saem_sfo_sfo_eigen &lt;- saem(f_mmkin["SFO-SFO", ], solution_type = "eigen",</span>
<span class='co'>#  control = list(nbiter.saemix = c(200, 80), nbdisplay = 10))</span>
<span class='co'># }</span>
</div></pre>
  </div>
  <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
    <nav id="toc" data-toggle="toc" class="sticky-top">
      <h2 data-toc-skip>Contents</h2>
    </nav>
  </div>
</div>


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

<div class="pkgdown">
  <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>

      </footer>
   </div>

  


  </body>
</html>


Contact - Imprint