aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--R/multistart.R23
-rw-r--r--log/test.log32
-rw-r--r--tests/testthat/_snaps/multistart/llhist-for-biphasic-saemix-fit.svg61
-rw-r--r--tests/testthat/_snaps/multistart/parhist-for-biphasic-saemix-fit.svg196
-rw-r--r--tests/testthat/test_mixed.R1
-rw-r--r--tests/testthat/test_multistart.R4
-rw-r--r--tests/testthat/test_saemix_parent.R2
7 files changed, 301 insertions, 18 deletions
diff --git a/R/multistart.R b/R/multistart.R
index 4282de9c..4f5ecde3 100644
--- a/R/multistart.R
+++ b/R/multistart.R
@@ -74,17 +74,34 @@ multistart.saem.mmkin <- function(object, n = 50, cores = 1,
call <- match.call()
if (n <= 1) stop("Please specify an n of at least 2")
- mmkin_parms <- parms(object$mmkin, errparms = FALSE,
+ mmkin_object <- object$mmkin
+
+ mmkin_parms <- parms(mmkin_object, errparms = FALSE,
transformed = object$transformations == "mkin")
start_parms <- apply(
mmkin_parms, 1,
function(x) stats::runif(n, min(x), max(x)))
+ saem_call <- object$call
+ saem_call[[1]] <- saem
+ saem_call[[2]] <- mmkin_object
+ i_startparms <- which(names(saem_call) == "degparms_start")
+
fit_function <- function(x) {
- ret <- update(object, degparms_start = start_parms[x, ], ...)
- ret$call[[4]] <- str2lang(
+
+ new_startparms <- str2lang(
paste0(capture.output(dput(start_parms[x, ])),
collapse = ""))
+
+ if (length(i_startparms) == 0) {
+ saem_call <- c(as.list(saem_call), degparms_start = new_startparms)
+ saem_call <- as.call(saem_call)
+ } else {
+ saem_call[i_startparms] <- new_startparms
+ }
+
+ ret <- eval(saem_call)
+
return(ret)
}
diff --git a/log/test.log b/log/test.log
index 84f81103..1e5dc943 100644
--- a/log/test.log
+++ b/log/test.log
@@ -1,25 +1,25 @@
ℹ Testing mkin
✔ | F W S OK | Context
✔ | 5 | AIC calculation
-✔ | 5 | Analytical solutions for coupled models [3.2s]
+✔ | 5 | Analytical solutions for coupled models [3.3s]
✔ | 5 | Calculation of Akaike weights
✔ | 3 | Export dataset for reading into CAKE
-✔ | 12 | Confidence intervals and p-values [1.0s]
-✔ | 1 12 | Dimethenamid data from 2018 [31.8s]
+✔ | 12 | Confidence intervals and p-values [1.1s]
+✔ | 1 12 | Dimethenamid data from 2018 [31.7s]
────────────────────────────────────────────────────────────────────────────────
Skip (test_dmta.R:98:3): Different backends get consistent results for SFO-SFO3+, dimethenamid data
Reason: Fitting this ODE model with saemix takes about 15 minutes on my system
────────────────────────────────────────────────────────────────────────────────
-✔ | 14 | Error model fitting [4.8s]
+✔ | 14 | Error model fitting [4.9s]
✔ | 5 | Time step normalisation
✔ | 4 | Calculation of FOCUS chi2 error levels [0.6s]
✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.8s]
✔ | 4 | Test fitting the decline of metabolites from their maximum [0.4s]
✔ | 1 | Fitting the logistic model [0.2s]
-✔ | 7 | Batch fitting and diagnosing hierarchical kinetic models [14.3s]
+✔ | 7 | Batch fitting and diagnosing hierarchical kinetic models [14.0s]
✔ | 1 12 | Nonlinear mixed-effects models [0.3s]
────────────────────────────────────────────────────────────────────────────────
-Skip (test_mixed.R:68:3): saemix results are reproducible for biphasic fits
+Skip (test_mixed.R:74:3): saemix results are reproducible for biphasic fits
Reason: Fitting with saemix takes around 10 minutes when using deSolve
────────────────────────────────────────────────────────────────────────────────
✔ | 3 | Test dataset classes mkinds and mkindsg
@@ -27,11 +27,19 @@ Reason: Fitting with saemix takes around 10 minutes when using deSolve
✔ | 3 | mkinfit features [0.7s]
✔ | 8 | mkinmod model generation and printing [0.2s]
✔ | 3 | Model predictions with mkinpredict [0.3s]
-✔ | 16 | Evaluations according to 2015 NAFTA guidance [1.7s]
-✔ | 9 | Nonlinear mixed-effects models with nlme [8.3s]
-✔ | 16 | Plotting [10.0s]
+✔ | 2 3 | Multistart method for saem.mmkin models [17.7s]
+────────────────────────────────────────────────────────────────────────────────
+Warning (test_multistart.R:15:3): multistart works for saem.mmkin models
+Adding new file snapshot: 'tests/testhat/_snaps/llhist-for-biphasic-saemix-fit.svg'
+
+Warning (test_multistart.R:16:3): multistart works for saem.mmkin models
+Adding new file snapshot: 'tests/testhat/_snaps/parhist-for-biphasic-saemix-fit.svg'
+────────────────────────────────────────────────────────────────────────────────
+✔ | 16 | Evaluations according to 2015 NAFTA guidance [1.8s]
+✔ | 9 | Nonlinear mixed-effects models with nlme [8.4s]
+✔ | 16 | Plotting [10.1s]
✔ | 4 | Residuals extracted from mkinfit models
-✔ | 36 | saemix parent models [308.7s]
+✔ | 36 | saemix parent models [309.8s]
✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.4s]
✔ | 11 | Processing of residue series
✔ | 7 | Fitting the SFORB model [3.6s]
@@ -42,10 +50,10 @@ Reason: Fitting with saemix takes around 10 minutes when using deSolve
✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.2s]
══ Results ═════════════════════════════════════════════════════════════════════
-Duration: 405.5 s
+Duration: 424.4 s
── Skipped tests ──────────────────────────────────────────────────────────────
• Fitting this ODE model with saemix takes about 15 minutes on my system (1)
• Fitting with saemix takes around 10 minutes when using deSolve (1)
-[ FAIL 0 | WARN 0 | SKIP 2 | PASS 254 ]
+[ FAIL 0 | WARN 2 | SKIP 2 | PASS 257 ]
diff --git a/tests/testthat/_snaps/multistart/llhist-for-biphasic-saemix-fit.svg b/tests/testthat/_snaps/multistart/llhist-for-biphasic-saemix-fit.svg
new file mode 100644
index 00000000..154eb60d
--- /dev/null
+++ b/tests/testthat/_snaps/multistart/llhist-for-biphasic-saemix-fit.svg
@@ -0,0 +1,61 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' class='svglite' data-engine-version='2.0' width='720.00pt' height='576.00pt' viewBox='0 0 720.00 576.00'>
+<defs>
+ <style type='text/css'><![CDATA[
+ .svglite line, .svglite polyline, .svglite polygon, .svglite path, .svglite rect, .svglite circle {
+ fill: none;
+ stroke: #000000;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ stroke-miterlimit: 10.00;
+ }
+ ]]></style>
+</defs>
+<rect width='100%' height='100%' style='stroke: none; fill: #FFFFFF;'/>
+<defs>
+ <clipPath id='cpMC4wMHw3MjAuMDB8MC4wMHw1NzYuMDA='>
+ <rect x='0.00' y='0.00' width='720.00' height='576.00' />
+ </clipPath>
+</defs>
+<g clip-path='url(#cpMC4wMHw3MjAuMDB8MC4wMHw1NzYuMDA=)'>
+<text transform='translate(12.96,280.80) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='148.77px' lengthAdjust='spacingAndGlyphs'>Frequency of log likelihoods</text>
+<line x1='101.56' y1='502.56' x2='601.12' y2='502.56' style='stroke-width: 0.75;' />
+<line x1='101.56' y1='502.56' x2='101.56' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='201.47' y1='502.56' x2='201.47' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='301.38' y1='502.56' x2='301.38' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='401.29' y1='502.56' x2='401.29' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='501.21' y1='502.56' x2='501.21' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='601.12' y1='502.56' x2='601.12' y2='509.76' style='stroke-width: 0.75;' />
+<text x='101.56' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='30.69px' lengthAdjust='spacingAndGlyphs'>-1190</text>
+<text x='201.47' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='30.69px' lengthAdjust='spacingAndGlyphs'>-1185</text>
+<text x='301.38' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='30.69px' lengthAdjust='spacingAndGlyphs'>-1180</text>
+<text x='401.29' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='30.69px' lengthAdjust='spacingAndGlyphs'>-1175</text>
+<text x='501.21' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='30.69px' lengthAdjust='spacingAndGlyphs'>-1170</text>
+<text x='601.12' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='30.69px' lengthAdjust='spacingAndGlyphs'>-1165</text>
+<line x1='59.04' y1='486.13' x2='59.04' y2='75.47' style='stroke-width: 0.75;' />
+<line x1='59.04' y1='486.13' x2='51.84' y2='486.13' style='stroke-width: 0.75;' />
+<line x1='59.04' y1='280.80' x2='51.84' y2='280.80' style='stroke-width: 0.75;' />
+<line x1='59.04' y1='75.47' x2='51.84' y2='75.47' style='stroke-width: 0.75;' />
+<text x='44.64' y='490.26' text-anchor='end' style='font-size: 12.00px; font-family: sans;' textLength='6.67px' lengthAdjust='spacingAndGlyphs'>0</text>
+<text x='44.64' y='284.93' text-anchor='end' style='font-size: 12.00px; font-family: sans;' textLength='6.67px' lengthAdjust='spacingAndGlyphs'>1</text>
+<text x='44.64' y='79.60' text-anchor='end' style='font-size: 12.00px; font-family: sans;' textLength='6.67px' lengthAdjust='spacingAndGlyphs'>2</text>
+</g>
+<defs>
+ <clipPath id='cpNTkuMDR8Njg5Ljc2fDU5LjA0fDUwMi41Ng=='>
+ <rect x='59.04' y='59.04' width='630.72' height='443.52' />
+ </clipPath>
+</defs>
+<g clip-path='url(#cpNTkuMDR8Njg5Ljc2fDU5LjA0fDUwMi41Ng==)'>
+<rect x='261.42' y='75.47' width='39.96' height='410.67' style='stroke-width: 0.75; fill: #D3D3D3;' />
+<rect x='301.38' y='280.80' width='39.96' height='205.33' style='stroke-width: 0.75; fill: #D3D3D3;' />
+<rect x='341.35' y='75.47' width='39.96' height='410.67' style='stroke-width: 0.75; fill: #D3D3D3;' />
+<rect x='381.31' y='280.80' width='39.96' height='205.33' style='stroke-width: 0.75; fill: #D3D3D3;' />
+<rect x='421.28' y='280.80' width='39.96' height='205.33' style='stroke-width: 0.75; fill: #D3D3D3;' />
+<rect x='461.24' y='280.80' width='39.96' height='205.33' style='stroke-width: 0.75; fill: #D3D3D3;' />
+<polyline points='82.40,486.13 83.86,486.11 85.32,486.11 86.78,486.10 88.24,486.10 89.70,486.10 91.16,486.09 92.62,486.09 94.08,486.08 95.54,486.07 97.00,486.07 98.46,486.06 99.92,486.03 101.38,486.02 102.84,486.00 104.30,485.99 105.76,485.96 107.22,485.93 108.68,485.91 110.14,485.88 111.60,485.85 113.06,485.83 114.52,485.79 115.98,485.76 117.44,485.72 118.90,485.67 120.36,485.63 121.82,485.57 123.28,485.52 124.74,485.46 126.20,485.39 127.66,485.32 129.12,485.24 130.58,485.15 132.04,485.06 133.50,484.95 134.96,484.84 136.42,484.72 137.88,484.59 139.34,484.45 140.80,484.30 142.26,484.14 143.72,483.96 145.18,483.77 146.64,483.56 148.10,483.32 149.56,483.08 151.02,482.82 152.48,482.53 153.94,482.22 155.40,481.89 156.86,481.55 158.32,481.18 159.78,480.78 161.24,480.36 162.70,479.91 164.16,479.43 165.62,478.92 167.08,478.37 168.54,477.79 170.00,477.17 171.46,476.52 172.92,475.83 174.38,475.09 175.84,474.31 177.30,473.48 178.76,472.61 180.22,471.69 181.68,470.72 183.14,469.69 184.60,468.62 186.06,467.48 187.52,466.29 188.98,465.03 190.44,463.71 191.90,462.33 193.36,460.89 194.82,459.37 196.28,457.79 197.74,456.11 199.20,454.38 200.66,452.58 202.12,450.70 203.58,448.75 205.04,446.71 206.50,444.60 207.96,442.40 209.42,440.12 210.88,437.77 212.34,435.32 213.80,432.80 215.26,430.19 216.72,427.49 218.18,424.71 219.64,421.85 221.10,418.90 222.56,415.86 224.02,412.75 225.48,409.55 226.94,406.27 228.40,402.91 229.86,399.47 231.32,395.95 232.78,392.36 234.24,388.69 235.70,384.95 237.16,381.14 238.62,377.27 240.08,373.33 241.54,369.33 243.00,365.27 244.46,361.14 245.92,356.98 247.38,352.76 248.84,348.51 250.30,344.22 251.76,339.89 253.22,335.53 254.68,331.14 256.14,326.74 257.60,322.31 259.06,317.88 260.52,313.44 261.98,308.98 263.44,304.53 264.90,300.10 266.36,295.68 267.82,291.28 269.28,286.90 270.74,282.56 272.20,278.24 273.66,273.97 275.12,269.75 276.58,265.57 278.04,261.45 279.50,257.39 280.96,253.40 282.42,249.47 283.88,245.62 285.34,241.85 286.80,238.17 288.26,234.57 289.72,231.06 291.18,227.65 292.64,224.34 294.10,221.13 295.56,218.02 297.02,215.03 298.48,212.15 299.94,209.38 301.40,206.73 302.86,204.19 304.32,201.78 305.78,199.49 307.24,197.32 308.70,195.28 310.16,193.37 311.62,191.58 313.08,189.91 314.54,188.37 316.00,186.96 317.46,185.68 318.92,184.52 320.38,183.48 321.84,182.57 323.30,181.78 324.76,181.11 326.22,180.56 327.68,180.13 329.14,179.81 330.60,179.61 332.06,179.51 333.52,179.53 334.98,179.64 336.44,179.86 337.90,180.18 339.36,180.60 340.82,181.11 342.28,181.70 343.74,182.38 345.20,183.15 346.66,183.99 348.12,184.91 349.58,185.90 351.04,186.96 352.50,188.09 353.96,189.27 355.42,190.51 356.88,191.80 358.34,193.14 359.80,194.53 361.26,195.96 362.72,197.43 364.18,198.93 365.64,200.47 367.10,202.03 368.56,203.62 370.02,205.23 371.48,206.86 372.94,208.51 374.40,210.17 375.86,211.84 377.32,213.52 378.78,215.20 380.24,216.89 381.70,218.58 383.16,220.27 384.62,221.96 386.08,223.64 387.54,225.32 389.00,227.00 390.46,228.66 391.92,230.32 393.38,231.97 394.84,233.61 396.30,235.25 397.76,236.87 399.22,238.48 400.68,240.09 402.14,241.68 403.60,243.27 405.06,244.85 406.52,246.42 407.98,247.99 409.44,249.55 410.90,251.11 412.36,252.66 413.82,254.22 415.28,255.78 416.74,257.33 418.20,258.90 419.66,260.46 421.12,262.04 422.58,263.63 424.04,265.22 425.50,266.83 426.96,268.46 428.42,270.10 429.88,271.76 431.34,273.45 432.80,275.15 434.26,276.89 435.72,278.65 437.18,280.43 438.64,282.25 440.10,284.10 441.56,285.98 443.02,287.90 444.48,289.85 445.94,291.85 447.40,293.88 448.86,295.94 450.32,298.05 451.78,300.20 453.24,302.39 454.70,304.62 456.16,306.89 457.62,309.20 459.08,311.56 460.54,313.95 462.00,316.38 463.46,318.86 464.92,321.37 466.38,323.92 467.84,326.50 469.30,329.12 470.76,331.78 472.22,334.46 473.68,337.18 475.14,339.92 476.60,342.69 478.06,345.48 479.52,348.29 480.98,351.13 482.44,353.98 483.90,356.84 485.36,359.72 486.82,362.61 488.28,365.52 489.74,368.41 491.20,371.31 492.66,374.20 494.12,377.09 495.58,379.97 497.04,382.84 498.50,385.70 499.96,388.54 501.42,391.37 502.88,394.17 504.34,396.97 505.80,399.73 507.26,402.45 508.72,405.14 510.18,407.82 511.64,410.45 513.10,413.04 514.56,415.58 516.02,418.09 517.48,420.55 518.94,422.97 520.40,425.35 521.86,427.67 523.32,429.95 524.78,432.18 526.24,434.36 527.70,436.48 529.16,438.56 530.62,440.58 532.08,442.54 533.54,444.46 535.00,446.32 536.46,448.12 537.92,449.87 539.38,451.56 540.84,453.20 542.30,454.79 543.76,456.32 545.22,457.80 546.68,459.23 548.14,460.60 549.60,461.92 551.06,463.19 552.52,464.43 553.98,465.60 555.44,466.73 556.90,467.80 558.36,468.85 559.82,469.83 561.28,470.77 562.74,471.66 564.20,472.51 565.66,473.33 567.12,474.10 568.58,474.84 570.04,475.54 571.50,476.20 572.96,476.83 574.42,477.43 575.88,477.99 577.34,478.53 578.80,479.03 580.26,479.51 581.72,479.96 583.18,480.38 584.64,480.78 586.10,481.15 587.56,481.51 589.02,481.84 590.48,482.15 591.94,482.44 593.40,482.71 594.86,482.96 596.32,483.20 597.78,483.43 599.24,483.63 600.70,483.83 602.16,484.03 603.62,484.19 605.08,484.35 606.54,484.49 608.00,484.62 609.46,484.75 610.92,484.86 612.38,484.97 613.84,485.06 615.30,485.15 616.76,485.24 618.22,485.31 619.68,485.39 621.14,485.45 622.60,485.51 624.06,485.57 625.52,485.62 626.98,485.66 628.44,485.71 629.90,485.75 631.36,485.78 632.82,485.81 634.28,485.84 635.74,485.87 637.20,485.90 638.66,485.92 640.12,485.94 641.58,485.96 643.04,485.98 644.50,485.99 645.96,486.01 647.42,486.02 648.88,486.05 650.34,486.06 651.80,486.07 653.26,486.07 654.72,486.08 656.18,486.09 657.64,486.09 659.10,486.10 660.56,486.10 662.02,486.10 663.48,486.11 664.94,486.11 666.40,486.13 ' style='stroke-width: 0.75;' />
+<line x1='101.38' y1='95.62' x2='122.98' y2='95.62' style='stroke-width: 0.75; stroke: #DF536B;' />
+<line x1='101.38' y1='110.02' x2='122.98' y2='110.02' style='stroke-width: 0.75;' />
+<text x='133.78' y='99.75' style='font-size: 12.00px; font-family: sans;' textLength='111.40px' lengthAdjust='spacingAndGlyphs'>original log likelihood</text>
+<text x='133.78' y='114.15' style='font-size: 12.00px; font-family: sans;' textLength='122.75px' lengthAdjust='spacingAndGlyphs'>kernel density estimate</text>
+</g>
+</svg>
diff --git a/tests/testthat/_snaps/multistart/parhist-for-biphasic-saemix-fit.svg b/tests/testthat/_snaps/multistart/parhist-for-biphasic-saemix-fit.svg
new file mode 100644
index 00000000..aa2bc3d4
--- /dev/null
+++ b/tests/testthat/_snaps/multistart/parhist-for-biphasic-saemix-fit.svg
@@ -0,0 +1,196 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' class='svglite' data-engine-version='2.0' width='720.00pt' height='576.00pt' viewBox='0 0 720.00 576.00'>
+<defs>
+ <style type='text/css'><![CDATA[
+ .svglite line, .svglite polyline, .svglite polygon, .svglite path, .svglite rect, .svglite circle {
+ fill: none;
+ stroke: #000000;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ stroke-miterlimit: 10.00;
+ }
+ ]]></style>
+</defs>
+<rect width='100%' height='100%' style='stroke: none; fill: #FFFFFF;'/>
+<defs>
+ <clipPath id='cpMC4wMHw3MjAuMDB8MC4wMHw1NzYuMDA='>
+ <rect x='0.00' y='0.00' width='720.00' height='576.00' />
+ </clipPath>
+</defs>
+<g clip-path='url(#cpMC4wMHw3MjAuMDB8MC4wMHw1NzYuMDA=)'>
+</g>
+<defs>
+ <clipPath id='cpNTkuMDR8Njg5Ljc2fDU5LjA0fDUwMi41Ng=='>
+ <rect x='59.04' y='59.04' width='630.72' height='443.52' />
+ </clipPath>
+</defs>
+<g clip-path='url(#cpNTkuMDR8Njg5Ljc2fDU5LjA0fDUwMi41Ng==)'>
+<polygon points='86.57,280.80 119.94,280.80 119.94,279.73 86.57,279.73 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='86.57' y1='280.64' x2='119.94' y2='280.64' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='103.26' y1='280.88' x2='103.26' y2='280.80' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='103.26' y1='279.40' x2='103.26' y2='279.73' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='94.91' y1='280.88' x2='111.60' y2='280.88' style='stroke-width: 0.75;' />
+<line x1='94.91' y1='279.40' x2='111.60' y2='279.40' style='stroke-width: 0.75;' />
+<polygon points='86.57,280.80 119.94,280.80 119.94,279.73 86.57,279.73 ' style='stroke-width: 0.75; fill: none;' />
+<polygon points='128.29,283.31 161.66,283.31 161.66,281.06 128.29,281.06 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='128.29' y1='281.55' x2='161.66' y2='281.55' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='144.97' y1='284.32' x2='144.97' y2='283.31' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='144.97' y1='280.40' x2='144.97' y2='281.06' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='136.63' y1='284.32' x2='153.31' y2='284.32' style='stroke-width: 0.75;' />
+<line x1='136.63' y1='280.40' x2='153.31' y2='280.40' style='stroke-width: 0.75;' />
+<polygon points='128.29,283.31 161.66,283.31 161.66,281.06 128.29,281.06 ' style='stroke-width: 0.75; fill: none;' />
+<polygon points='170.00,282.97 203.37,282.97 203.37,280.93 170.00,280.93 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='170.00' y1='281.23' x2='203.37' y2='281.23' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='186.69' y1='283.92' x2='186.69' y2='282.97' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='186.69' y1='280.60' x2='186.69' y2='280.93' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='178.34' y1='283.92' x2='195.03' y2='283.92' style='stroke-width: 0.75;' />
+<line x1='178.34' y1='280.60' x2='195.03' y2='280.60' style='stroke-width: 0.75;' />
+<polygon points='170.00,282.97 203.37,282.97 203.37,280.93 170.00,280.93 ' style='stroke-width: 0.75; fill: none;' />
+<polygon points='211.71,288.27 245.09,288.27 245.09,230.06 211.71,230.06 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='211.71' y1='274.99' x2='245.09' y2='274.99' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='228.40' y1='311.96' x2='228.40' y2='288.27' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='228.40' y1='188.50' x2='228.40' y2='230.06' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='220.06' y1='311.96' x2='236.74' y2='311.96' style='stroke-width: 0.75;' />
+<line x1='220.06' y1='188.50' x2='236.74' y2='188.50' style='stroke-width: 0.75;' />
+<polygon points='211.71,288.27 245.09,288.27 245.09,230.06 211.71,230.06 ' style='stroke-width: 0.75; fill: none;' />
+<polygon points='253.43,327.28 286.80,327.28 286.80,270.78 253.43,270.78 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='253.43' y1='285.69' x2='286.80' y2='285.69' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='270.11' y1='371.25' x2='270.11' y2='327.28' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='270.11' y1='241.88' x2='270.11' y2='270.78' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='261.77' y1='371.25' x2='278.46' y2='371.25' style='stroke-width: 0.75;' />
+<line x1='261.77' y1='241.88' x2='278.46' y2='241.88' style='stroke-width: 0.75;' />
+<polygon points='253.43,327.28 286.80,327.28 286.80,270.78 253.43,270.78 ' style='stroke-width: 0.75; fill: none;' />
+<polygon points='295.14,291.59 328.51,291.59 328.51,287.40 295.14,287.40 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='295.14' y1='288.41' x2='328.51' y2='288.41' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='311.83' y1='293.74' x2='311.83' y2='291.59' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='311.83' y1='287.34' x2='311.83' y2='287.40' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='303.49' y1='293.74' x2='320.17' y2='293.74' style='stroke-width: 0.75;' />
+<line x1='303.49' y1='287.34' x2='320.17' y2='287.34' style='stroke-width: 0.75;' />
+<polygon points='295.14,291.59 328.51,291.59 328.51,287.40 295.14,287.40 ' style='stroke-width: 0.75; fill: none;' />
+<circle cx='311.83' cy='280.80' r='2.70' style='stroke-width: 0.75;' />
+<polygon points='336.86,283.90 370.23,283.90 370.23,281.59 336.86,281.59 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='336.86' y1='282.92' x2='370.23' y2='282.92' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='353.54' y1='284.49' x2='353.54' y2='283.90' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='353.54' y1='280.76' x2='353.54' y2='281.59' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='345.20' y1='284.49' x2='361.89' y2='284.49' style='stroke-width: 0.75;' />
+<line x1='345.20' y1='280.76' x2='361.89' y2='280.76' style='stroke-width: 0.75;' />
+<polygon points='336.86,283.90 370.23,283.90 370.23,281.59 336.86,281.59 ' style='stroke-width: 0.75; fill: none;' />
+<polygon points='378.57,280.94 411.94,280.94 411.94,280.30 378.57,280.30 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='378.57' y1='280.84' x2='411.94' y2='280.84' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='395.26' y1='280.97' x2='395.26' y2='280.94' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='395.26' y1='279.67' x2='395.26' y2='280.30' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='386.91' y1='280.97' x2='403.60' y2='280.97' style='stroke-width: 0.75;' />
+<line x1='386.91' y1='279.67' x2='403.60' y2='279.67' style='stroke-width: 0.75;' />
+<polygon points='378.57,280.94 411.94,280.94 411.94,280.30 378.57,280.30 ' style='stroke-width: 0.75; fill: none;' />
+<polygon points='420.29,344.39 453.66,344.39 453.66,85.91 420.29,85.91 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='420.29' y1='201.33' x2='453.66' y2='201.33' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='436.97' y1='745.85' x2='436.97' y2='344.39' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='436.97' y1='-33.80' x2='436.97' y2='85.91' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='428.63' y1='745.85' x2='445.31' y2='745.85' style='stroke-width: 0.75;' />
+<line x1='428.63' y1='-33.80' x2='445.31' y2='-33.80' style='stroke-width: 0.75;' />
+<polygon points='420.29,344.39 453.66,344.39 453.66,85.91 420.29,85.91 ' style='stroke-width: 0.75; fill: none;' />
+<polygon points='462.00,281.17 495.37,281.17 495.37,277.61 462.00,277.61 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='462.00' y1='279.82' x2='495.37' y2='279.82' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='478.69' y1='281.54' x2='478.69' y2='281.17' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='478.69' y1='275.99' x2='478.69' y2='277.61' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='470.34' y1='281.54' x2='487.03' y2='281.54' style='stroke-width: 0.75;' />
+<line x1='470.34' y1='275.99' x2='487.03' y2='275.99' style='stroke-width: 0.75;' />
+<polygon points='462.00,281.17 495.37,281.17 495.37,277.61 462.00,277.61 ' style='stroke-width: 0.75; fill: none;' />
+<circle cx='478.69' cy='288.66' r='2.70' style='stroke-width: 0.75;' />
+<polygon points='503.71,281.91 537.09,281.91 537.09,279.30 503.71,279.30 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='503.71' y1='280.26' x2='537.09' y2='280.26' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='520.40' y1='283.41' x2='520.40' y2='281.91' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='520.40' y1='275.80' x2='520.40' y2='279.30' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='512.06' y1='283.41' x2='528.74' y2='283.41' style='stroke-width: 0.75;' />
+<line x1='512.06' y1='275.80' x2='528.74' y2='275.80' style='stroke-width: 0.75;' />
+<polygon points='503.71,281.91 537.09,281.91 537.09,279.30 503.71,279.30 ' style='stroke-width: 0.75; fill: none;' />
+<polygon points='545.43,295.35 578.80,295.35 578.80,275.39 545.43,275.39 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='545.43' y1='280.51' x2='578.80' y2='280.51' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='562.11' y1='319.35' x2='562.11' y2='295.35' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='562.11' y1='268.77' x2='562.11' y2='275.39' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='553.77' y1='319.35' x2='570.46' y2='319.35' style='stroke-width: 0.75;' />
+<line x1='553.77' y1='268.77' x2='570.46' y2='268.77' style='stroke-width: 0.75;' />
+<polygon points='545.43,295.35 578.80,295.35 578.80,275.39 545.43,275.39 ' style='stroke-width: 0.75; fill: none;' />
+<polygon points='587.14,305.26 620.51,305.26 620.51,280.40 587.14,280.40 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='587.14' y1='283.54' x2='620.51' y2='283.54' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='603.83' y1='328.16' x2='603.83' y2='305.26' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='603.83' y1='272.69' x2='603.83' y2='280.40' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='595.49' y1='328.16' x2='612.17' y2='328.16' style='stroke-width: 0.75;' />
+<line x1='595.49' y1='272.69' x2='612.17' y2='272.69' style='stroke-width: 0.75;' />
+<polygon points='587.14,305.26 620.51,305.26 620.51,280.40 587.14,280.40 ' style='stroke-width: 0.75; fill: none;' />
+<polygon points='628.86,263.17 662.23,263.17 662.23,225.96 628.86,225.96 ' style='stroke-width: 0.75; stroke: none; fill: #D3D3D3;' />
+<line x1='628.86' y1='244.47' x2='662.23' y2='244.47' style='stroke-width: 2.25; stroke-linecap: butt;' />
+<line x1='645.54' y1='299.95' x2='645.54' y2='263.17' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='645.54' y1='192.88' x2='645.54' y2='225.96' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='637.20' y1='299.95' x2='653.89' y2='299.95' style='stroke-width: 0.75;' />
+<line x1='637.20' y1='192.88' x2='653.89' y2='192.88' style='stroke-width: 0.75;' />
+<polygon points='628.86,263.17 662.23,263.17 662.23,225.96 628.86,225.96 ' style='stroke-width: 0.75; fill: none;' />
+</g>
+<g clip-path='url(#cpMC4wMHw3MjAuMDB8MC4wMHw1NzYuMDA=)'>
+<line x1='103.26' y1='502.56' x2='645.54' y2='502.56' style='stroke-width: 0.75;' />
+<line x1='103.26' y1='502.56' x2='103.26' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='144.97' y1='502.56' x2='144.97' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='186.69' y1='502.56' x2='186.69' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='228.40' y1='502.56' x2='228.40' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='270.11' y1='502.56' x2='270.11' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='311.83' y1='502.56' x2='311.83' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='353.54' y1='502.56' x2='353.54' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='395.26' y1='502.56' x2='395.26' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='436.97' y1='502.56' x2='436.97' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='478.69' y1='502.56' x2='478.69' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='520.40' y1='502.56' x2='520.40' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='562.11' y1='502.56' x2='562.11' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='603.83' y1='502.56' x2='603.83' y2='509.76' style='stroke-width: 0.75;' />
+<line x1='645.54' y1='502.56' x2='645.54' y2='509.76' style='stroke-width: 0.75;' />
+<text x='103.26' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='47.38px' lengthAdjust='spacingAndGlyphs'>parent_0</text>
+<text x='186.69' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='84.07px' lengthAdjust='spacingAndGlyphs'>f_parent_to_m1</text>
+<text x='270.11' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='12.68px' lengthAdjust='spacingAndGlyphs'>k2</text>
+<text x='311.83' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='6.67px' lengthAdjust='spacingAndGlyphs'>g</text>
+<text x='353.54' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='16.68px' lengthAdjust='spacingAndGlyphs'>a.1</text>
+<text x='395.26' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='16.68px' lengthAdjust='spacingAndGlyphs'>b.1</text>
+<text x='478.69' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='72.05px' lengthAdjust='spacingAndGlyphs'>SD.log_k_m1</text>
+<text x='562.11' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='55.38px' lengthAdjust='spacingAndGlyphs'>SD.log_k1</text>
+<text x='645.54' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='64.71px' lengthAdjust='spacingAndGlyphs'>SD.g_qlogis</text>
+<line x1='59.04' y1='486.13' x2='59.04' y2='75.47' style='stroke-width: 0.75;' />
+<line x1='59.04' y1='486.13' x2='51.84' y2='486.13' style='stroke-width: 0.75;' />
+<line x1='59.04' y1='280.80' x2='51.84' y2='280.80' style='stroke-width: 0.75;' />
+<line x1='59.04' y1='160.69' x2='51.84' y2='160.69' style='stroke-width: 0.75;' />
+<line x1='59.04' y1='75.47' x2='51.84' y2='75.47' style='stroke-width: 0.75;' />
+<text x='44.64' y='490.26' text-anchor='end' style='font-size: 12.00px; font-family: sans;' textLength='16.68px' lengthAdjust='spacingAndGlyphs'>0.5</text>
+<text x='44.64' y='284.93' text-anchor='end' style='font-size: 12.00px; font-family: sans;' textLength='16.68px' lengthAdjust='spacingAndGlyphs'>1.0</text>
+<text x='44.64' y='164.82' text-anchor='end' style='font-size: 12.00px; font-family: sans;' textLength='16.68px' lengthAdjust='spacingAndGlyphs'>1.5</text>
+<text x='44.64' y='79.60' text-anchor='end' style='font-size: 12.00px; font-family: sans;' textLength='16.68px' lengthAdjust='spacingAndGlyphs'>2.0</text>
+<text transform='translate(12.96,280.80) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: sans;' textLength='124.73px' lengthAdjust='spacingAndGlyphs'>Normalised parameters</text>
+<polygon points='59.04,502.56 689.76,502.56 689.76,59.04 59.04,59.04 ' style='stroke-width: 0.75; fill: none;' />
+</g>
+<g clip-path='url(#cpNTkuMDR8Njg5Ljc2fDU5LjA0fDUwMi41Ng==)'>
+<circle cx='103.26' cy='279.55' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
+<circle cx='144.97' cy='287.60' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
+<circle cx='186.69' cy='283.99' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
+<circle cx='228.40' cy='61.16' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
+<circle cx='270.11' cy='482.33' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
+<circle cx='311.83' cy='299.21' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
+<circle cx='103.26' cy='280.26' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='144.97' cy='283.67' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='186.69' cy='282.56' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='228.40' cy='232.04' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='270.11' cy='324.73' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='311.83' cy='288.37' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='353.54' cy='283.16' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='395.26' cy='281.33' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='436.97' cy='267.20' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='478.69' cy='280.92' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='520.40' cy='277.10' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='562.11' cy='291.56' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='603.83' cy='297.83' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='645.54' cy='252.27' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
+<line x1='59.04' y1='280.80' x2='689.76' y2='280.80' style='stroke-width: 0.75; stroke-dasharray: 4.00,4.00;' />
+<line x1='93.82' y1='465.98' x2='115.42' y2='465.98' style='stroke-width: 0.75;' />
+<circle cx='104.62' cy='437.18' r='2.70' style='stroke-width: 0.75; stroke: #61D04F;' />
+<circle cx='104.62' cy='451.58' r='2.70' style='stroke-width: 0.75; stroke: #DF536B;' />
+<circle cx='104.62' cy='465.98' r='2.70' style='stroke-width: 0.75;' />
+<text x='126.22' y='441.31' style='font-size: 12.00px; font-family: sans;' textLength='105.39px' lengthAdjust='spacingAndGlyphs'>Starting parameters</text>
+<text x='126.22' y='455.71' style='font-size: 12.00px; font-family: sans;' textLength='62.03px' lengthAdjust='spacingAndGlyphs'>Original run</text>
+<text x='126.22' y='470.11' style='font-size: 12.00px; font-family: sans;' textLength='75.36px' lengthAdjust='spacingAndGlyphs'>Multistart runs</text>
+</g>
+</svg>
diff --git a/tests/testthat/test_mixed.R b/tests/testthat/test_mixed.R
index de030199..e005c982 100644
--- a/tests/testthat/test_mixed.R
+++ b/tests/testthat/test_mixed.R
@@ -24,7 +24,6 @@ test_that("nlme results are reproducible to some degree", {
test_summary$date.summary <- "Dummy date for testing"
test_summary$time <- c(elapsed = "test time 0")
- print(test_summary, digits = 1)
expect_known_output(print(test_summary, digits = 1), "summary_dfop_nlme_1.txt")
# The biphasic example data illustrate that DFOP parameters are difficult to
diff --git a/tests/testthat/test_multistart.R b/tests/testthat/test_multistart.R
index 04f08aa7..e0b1ecd7 100644
--- a/tests/testthat/test_multistart.R
+++ b/tests/testthat/test_multistart.R
@@ -1,4 +1,6 @@
-test_that("multistart works for saem.mmix models", {
+context("Multistart method for saem.mmkin models")
+
+test_that("multistart works for saem.mmkin models", {
saem_biphasic_m_multi <- multistart(saem_biphasic_m, n = 8,
cores = n_cores)
expect_known_output(print(saem_biphasic_m_multi),
diff --git a/tests/testthat/test_saemix_parent.R b/tests/testthat/test_saemix_parent.R
index 4504e573..d8b6b19e 100644
--- a/tests/testthat/test_saemix_parent.R
+++ b/tests/testthat/test_saemix_parent.R
@@ -140,7 +140,7 @@ test_that("We can also use mkin solution methods for saem", {
expect_error(saem(mmkin_dfop_1, quiet = TRUE, transformations = "saemix", solution_type = "analytical"),
"saemix transformations is only supported if an analytical solution is implemented"
)
- skip_on_cran() # This still takes almost 2.5 minutes although we do not solve ODEs
+ skip("This still takes almost 2.5 minutes although we do not solve ODEs")
dfop_saemix_3 <- saem(mmkin_dfop_1, quiet = TRUE, transformations = "mkin",
solution_type = "analytical", no_random_effect = "parent_0")
distimes_dfop <- endpoints(dfop_saemix_1)$distimes

Contact - Imprint