Parametric and non-parametric implementation of bootstrap estimates for MOBSTER fits. This computation is parallel and uses ?easypar.

mobster_bootstrap(
  x,
  n.resamples = 100,
  bootstrap = "nonparametric",
  cores.ratio = 0.8,
  cache = NULL,
  save_data = NULL,
  ...
)

Arguments

x

An object of class "dbpmm".

n.resamples

Number of boostrap resamples.

bootstrap

Type of boostrap: "parametric" or "nonparametric"

cores.ratio

Ratio of cores to use for the parallel; see ?easypar.

cache

Cache for the computation; see ?easypar.

...

fit parameters for mobster_fit

Value

Data from the fits, resamples and a plottable figure.

Examples

# Random small dataset dataset = random_dataset(N = 200, seed = 123, Beta_variance_scaling = 100) x = mobster_fit(dataset$data, auto_setup = 'FAST')
#> [ MOBSTER fit ] #>
#> Loaded input data, n = 200.
#> ❯ n = 200. Mixture with k = 1,2 Beta(s). Pareto tail: TRUE and FALSE. Output #> clusters with π > 0.02 and n > 10.
#> ! mobster automatic setup FAST for the analysis.
#> ❯ Scoring (without parallel) 2 x 2 x 2 = 8 models by reICL.
#>
#> [easypar] 2020-10-29 11:27:35 - Overriding parallel execution setup [FALSE] with global option : FALSE
#> #>
#> MOBSTER fits completed in 9.6s.
#>
#> ── [ MOBSTER ] My MOBSTER model n = 200 with k = 2 Beta(s) without tail ────────
#> ● Clusters: π = 52% [C1] and 48% [C2], with π > 0.
#> No tail fit.
#>
#> ● Beta C1 [n = 102, 52%] with mean = 0.58.
#> ● Beta C2 [n = 98, 48%] with mean = 0.11.
#> Score(s): NLL = -108.12; ICL = -182.58 (-182.58), H = 1.88 (1.88). Fit #> converged by MM in 66 steps.
# Just 5 resamples of a nonparametric bootstrap run, disabling the parallel engine options(easypar.parallel = FALSE) boot_results = mobster_bootstrap(x$best, n.resamples = 5, auto_setup = 'FAST')
#> [ MOBSTER bootstrap ~ 5 resamples from nonparametric bootstrap ] #>
#> ── [ MOBSTER ] My MOBSTER model n = 200 with k = 2 Beta(s) without tail ────────
#> ● Clusters: π = 52% [C1] and 48% [C2], with π > 0.
#> No tail fit.
#>
#> ● Beta C1 [n = 102, 52%] with mean = 0.58.
#> ● Beta C2 [n = 98, 48%] with mean = 0.11.
#> Score(s): NLL = -108.12; ICL = -182.58 (-182.58), H = 1.88 (1.88). Fit #> converged by MM in 66 steps.
#>
#> Creating nonparametric bootstrap resamples
#> Creating nonparametric bootstrap resamples ... done
#>
#>
#> ── Running fits ─────────────────────────────────── Might take some time ... ──
#> [easypar] 2020-10-29 11:27:45 - Overriding parallel execution setup [TRUE] with global option : FALSE
#> [ MOBSTER fit ] #>
#> Loaded input data, n = 200.
#> ❯ n = 200. Mixture with k = 1,2 Beta(s). Pareto tail: TRUE and FALSE. Output #> clusters with π > 0.02 and n > 10.
#> ! mobster automatic setup FAST for the analysis.
#> ❯ Scoring (without parallel) 2 x 2 x 2 = 8 models by reICL.
#>
#> [easypar] 2020-10-29 11:27:45 - Overriding parallel execution setup [FALSE] with global option : FALSE
#> #>
#> MOBSTER fits completed in 9.2s.
#>
#> ── [ MOBSTER ] My MOBSTER model n = 200 with k = 2 Beta(s) without tail ────────
#> ● Clusters: π = 51% [C1] and 49% [C2], with π > 0.
#> No tail fit.
#>
#> ● Beta C1 [n = 101, 51%] with mean = 0.58.
#> ● Beta C2 [n = 99, 49%] with mean = 0.11.
#> Score(s): NLL = -118.81; ICL = -204.17 (-204.17), H = 1.66 (1.66). Fit #> converged by MM in 61 steps.
#> [ MOBSTER fit ] #>
#> Loaded input data, n = 200.
#> ❯ n = 200. Mixture with k = 1,2 Beta(s). Pareto tail: TRUE and FALSE. Output #> clusters with π > 0.02 and n > 10.
#> ! mobster automatic setup FAST for the analysis.
#> ❯ Scoring (without parallel) 2 x 2 x 2 = 8 models by reICL.
#>
#> [easypar] 2020-10-29 11:27:54 - Overriding parallel execution setup [FALSE] with global option : FALSE
#> #>
#> MOBSTER fits completed in 7.8s.
#>
#> ── [ MOBSTER ] My MOBSTER model n = 200 with k = 2 Beta(s) without tail ────────
#> ● Clusters: π = 50% [C2] and 50% [C1], with π > 0.
#> No tail fit.
#>
#> ● Beta C1 [n = 99, 50%] with mean = 0.6.
#> ● Beta C2 [n = 101, 50%] with mean = 0.12.
#> Score(s): NLL = -110.86; ICL = -188.81 (-188.81), H = 1.12 (1.12). Fit #> converged by MM in 57 steps.
#> [ MOBSTER fit ] #>
#> Loaded input data, n = 200.
#> ❯ n = 200. Mixture with k = 1,2 Beta(s). Pareto tail: TRUE and FALSE. Output #> clusters with π > 0.02 and n > 10.
#> ! mobster automatic setup FAST for the analysis.
#> ❯ Scoring (without parallel) 2 x 2 x 2 = 8 models by reICL.
#>
#> [easypar] 2020-10-29 11:28:02 - Overriding parallel execution setup [FALSE] with global option : FALSE
#> #>
#> MOBSTER fits completed in 9.9s.
#>
#> ── [ MOBSTER ] My MOBSTER model n = 200 with k = 2 Beta(s) without tail ────────
#> ● Clusters: π = 53% [C1] and 47% [C2], with π > 0.
#> No tail fit.
#>
#> ● Beta C1 [n = 106, 53%] with mean = 0.59.
#> ● Beta C2 [n = 94, 47%] with mean = 0.11.
#> Score(s): NLL = -117.56; ICL = -201.98 (-201.98), H = 1.35 (1.35). Fit #> converged by MM in 76 steps.
#> [ MOBSTER fit ] #>
#> Loaded input data, n = 200.
#> ❯ n = 200. Mixture with k = 1,2 Beta(s). Pareto tail: TRUE and FALSE. Output #> clusters with π > 0.02 and n > 10.
#> ! mobster automatic setup FAST for the analysis.
#> ❯ Scoring (without parallel) 2 x 2 x 2 = 8 models by reICL.
#>
#> [easypar] 2020-10-29 11:28:12 - Overriding parallel execution setup [FALSE] with global option : FALSE
#> #>
#> MOBSTER fits completed in 10.6s.
#>
#> ── [ MOBSTER ] My MOBSTER model n = 200 with k = 2 Beta(s) without tail ────────
#> ● Clusters: π = 54% [C1] and 46% [C2], with π > 0.
#> No tail fit.
#>
#> ● Beta C1 [n = 108, 54%] with mean = 0.59.
#> ● Beta C2 [n = 92, 46%] with mean = 0.13.
#> Score(s): NLL = -101.74; ICL = -170.66 (-170.66), H = 1.02 (1.02). Fit #> converged by MM in 13 steps.
#> [ MOBSTER fit ] #>
#> Loaded input data, n = 200.
#> ❯ n = 200. Mixture with k = 1,2 Beta(s). Pareto tail: TRUE and FALSE. Output #> clusters with π > 0.02 and n > 10.
#> ! mobster automatic setup FAST for the analysis.
#> ❯ Scoring (without parallel) 2 x 2 x 2 = 8 models by reICL.
#>
#> [easypar] 2020-10-29 11:28:23 - Overriding parallel execution setup [FALSE] with global option : FALSE
#> #>
#> MOBSTER fits completed in 10.6s.
#>
#> ── [ MOBSTER ] My MOBSTER model n = 200 with k = 2 Beta(s) without tail ────────
#> ● Clusters: π = 58% [C1] and 42% [C2], with π > 0.
#> No tail fit.
#>
#> ● Beta C1 [n = 114, 58%] with mean = 0.57.
#> ● Beta C2 [n = 86, 42%] with mean = 0.11.
#> Score(s): NLL = -105.37; ICL = -177.17 (-177.17), H = 1.78 (1.78). Fit #> interrupted by MM in 100 steps.
# The resample data is available in a list print(boot_results$resamples[[1]])
#> [[1]] #> id VAF original.id #> 1 1 0.51796731 93 #> 2 2 0.10662581 189 #> 3 3 0.15346219 197 #> 4 4 0.71187995 13 #> 5 5 0.05902402 175 #> 6 6 0.05902402 175 #> 7 7 0.61440798 79 #> 8 8 0.12286390 187 #> 9 9 0.46164409 62 #> 10 10 0.05278961 161 #> 11 11 0.04328793 119 #> 12 12 0.23287406 190 #> 13 13 0.08668096 122 #> 14 14 0.15346219 197 #> 15 15 0.43401627 14 #> 16 16 0.67301958 195 #> 17 17 0.57466625 31 #> 18 18 0.08434598 136 #> 19 19 0.02979764 111 #> 20 20 0.29749078 174 #> 21 21 0.51683769 86 #> 22 22 0.72430352 60 #> 23 23 0.46164409 62 #> 24 24 0.53161319 66 #> 25 25 0.61513016 1 #> 26 26 0.07562712 113 #> 27 27 0.51683769 86 #> 28 28 0.67912870 38 #> 29 29 0.46627543 88 #> 30 30 0.71166697 56 #> 31 31 0.08810669 106 #> 32 32 0.13620251 143 #> 33 33 0.11612617 138 #> 34 34 0.49730321 82 #> 35 35 0.06208767 123 #> 36 36 0.70284180 94 #> 37 37 0.06208767 123 #> 38 38 0.42751004 81 #> 39 39 0.67862073 4 #> 40 40 0.08747705 168 #> 41 41 0.08668096 122 #> 42 42 0.65434252 34 #> 43 43 0.08415006 100 #> 44 44 0.67301958 195 #> 45 45 0.08391171 110 #> 46 46 0.57319452 63 #> 47 47 0.62264994 67 #> 48 48 0.58635506 59 #> 49 49 0.61645161 45 #> 50 50 0.06731439 185 #> 51 51 0.52103494 95 #> 52 52 0.20522784 140 #> 53 53 0.18409048 159 #> 54 54 0.45979987 40 #> 55 55 0.08434598 136 #> 56 56 0.44827642 24 #> 57 57 0.06010055 191 #> 58 58 0.05393297 137 #> 59 59 0.15942611 160 #> 60 60 0.71007760 15 #> 61 61 0.05310553 170 #> 62 62 0.53161319 66 #> 63 63 0.58228860 20 #> 64 64 0.18409048 159 #> 65 65 0.15346219 197 #> 66 66 0.14648825 154 #> 67 67 0.18847011 151 #> 68 68 0.58635506 59 #> 69 69 0.73371146 96 #> 70 70 0.04428176 148 #> 71 71 0.27925367 156 #> 72 72 0.47680339 16 #> 73 73 0.57466625 31 #> 74 74 0.11685164 125 #> 75 75 0.53161319 66 #> 76 76 0.59010680 83 #> 77 77 0.57617853 72 #> 78 78 0.16570645 165 #> 79 79 0.37909462 194 #> 80 80 0.06764590 171 #> 81 81 0.74760698 21 #> 82 82 0.11370181 164 #> 83 83 0.09192788 132 #> 84 84 0.04428176 148 #> 85 85 0.02233042 134 #> 86 86 0.02979764 111 #> 87 87 0.77219358 27 #> 88 88 0.62271368 65 #> 89 89 0.02120704 127 #> 90 90 0.52259202 78 #> 91 91 0.10144527 135 #> 92 92 0.47006049 92 #> 93 93 0.11370181 164 #> 94 94 0.50386312 17 #> 95 95 0.70079811 33 #> 96 96 0.11033293 177 #> 97 97 0.18152401 182 #> 98 98 0.52103494 95 #> 99 99 0.08554961 149 #> 100 100 0.67301958 195 #> 101 101 0.10144527 135 #> 102 102 0.48237613 54 #> 103 103 0.71007760 15 #> 104 104 0.08554961 149 #> 105 105 0.10144527 135 #> 106 106 0.67998213 73 #> 107 107 0.09462104 193 #> 108 108 0.55147229 58 #> 109 109 0.10749586 126 #> 110 110 0.05902402 175 #> 111 111 0.08077727 104 #> 112 112 0.17617266 146 #> 113 113 0.06968916 158 #> 114 114 0.49416918 89 #> 115 115 0.67804058 75 #> 116 116 0.63865136 85 #> 117 117 0.51683769 86 #> 118 118 0.12286390 187 #> 119 119 0.55147229 58 #> 120 120 0.55504012 70 #> 121 121 0.06208767 123 #> 122 122 0.59010680 83 #> 123 123 0.44827642 24 #> 124 124 0.44827642 24 #> 125 125 0.07266066 181 #> 126 126 0.08267471 162 #> 127 127 0.53021870 7 #> 128 128 0.68651983 77 #> 129 129 0.74474824 80 #> 130 130 0.59485405 39 #> 131 131 0.51683769 86 #> 132 132 0.63050350 53 #> 133 133 0.08267471 162 #> 134 134 0.05278961 161 #> 135 135 0.65437443 9 #> 136 136 0.15942611 160 #> 137 137 0.14138817 133 #> 138 138 0.08387673 150 #> 139 139 0.07533878 200 #> 140 140 0.65973718 52 #> 141 141 0.57617853 72 #> 142 142 0.53701189 68 #> 143 143 0.06764590 171 #> 144 144 0.71166697 56 #> 145 145 0.13101051 167 #> 146 146 0.06424984 186 #> 147 147 0.07180271 118 #> 148 148 0.57186352 2 #> 149 149 0.53788908 37 #> 150 150 0.60126291 10 #> 151 151 0.13456331 112 #> 152 152 0.47006049 92 #> 153 153 0.53161319 66 #> 154 154 0.59010680 83 #> 155 155 0.13645069 114 #> 156 156 0.10662581 189 #> 157 157 0.57474093 19 #> 158 158 0.05278961 161 #> 159 159 0.25434749 176 #> 160 160 0.47680339 16 #> 161 161 0.44827642 24 #> 162 162 0.06424984 186 #> 163 163 0.11612617 138 #> 164 164 0.07562712 113 #> 165 165 0.02795963 142 #> 166 166 0.14648825 154 #> 167 167 0.66659415 41 #> 168 168 0.51796731 93 #> 169 169 0.57723436 44 #> 170 170 0.47006049 92 #> 171 171 0.17370173 115 #> 172 172 0.51683769 86 #> 173 173 0.18409048 159 #> 174 174 0.65437443 9 #> 175 175 0.05714139 107 #> 176 176 0.58635506 59 #> 177 177 0.30370976 121 #> 178 178 0.07266066 181 #> 179 179 0.67998213 73 #> 180 180 0.04428176 148 #> 181 181 0.58635506 59 #> 182 182 0.63495385 51 #> 183 183 0.69144367 57 #> 184 184 0.60126291 10 #> 185 185 0.58179492 6 #> 186 186 0.10918947 169 #> 187 187 0.53245520 32 #> 188 188 0.18295084 184 #> 189 189 0.48903433 49 #> 190 190 0.64982215 23 #> 191 191 0.05278961 161 #> 192 192 0.11612617 138 #> 193 193 0.08810669 106 #> 194 194 0.07533878 200 #> 195 195 0.18847011 151 #> 196 196 0.57319452 63 #> 197 197 0.46164409 62 #> 198 198 0.08434598 136 #> 199 199 0.10144527 135 #> 200 200 0.61513016 1 #>
# The best fits are returned print(boot_results$fits)
#> $`1`
#> ── [ MOBSTER ] My MOBSTER model n = 200 with k = 2 Beta(s) without tail ────────
#> ● Clusters: π = 51% [C1] and 49% [C2], with π > 0.
#> No tail fit.
#>
#> ● Beta C1 [n = 101, 51%] with mean = 0.58.
#> ● Beta C2 [n = 99, 49%] with mean = 0.11.
#> Score(s): NLL = -118.81; ICL = -204.17 (-204.17), H = 1.66 (1.66). Fit #> converged by MM in 61 steps.
#> #> $`2`
#> ── [ MOBSTER ] My MOBSTER model n = 200 with k = 2 Beta(s) without tail ────────
#> ● Clusters: π = 50% [C2] and 50% [C1], with π > 0.
#> No tail fit.
#>
#> ● Beta C1 [n = 99, 50%] with mean = 0.6.
#> ● Beta C2 [n = 101, 50%] with mean = 0.12.
#> Score(s): NLL = -110.86; ICL = -188.81 (-188.81), H = 1.12 (1.12). Fit #> converged by MM in 57 steps.
#> #> $`3`
#> ── [ MOBSTER ] My MOBSTER model n = 200 with k = 2 Beta(s) without tail ────────
#> ● Clusters: π = 53% [C1] and 47% [C2], with π > 0.
#> No tail fit.
#>
#> ● Beta C1 [n = 106, 53%] with mean = 0.59.
#> ● Beta C2 [n = 94, 47%] with mean = 0.11.
#> Score(s): NLL = -117.56; ICL = -201.98 (-201.98), H = 1.35 (1.35). Fit #> converged by MM in 76 steps.
#> #> $`4`
#> ── [ MOBSTER ] My MOBSTER model n = 200 with k = 2 Beta(s) without tail ────────
#> ● Clusters: π = 54% [C1] and 46% [C2], with π > 0.
#> No tail fit.
#>
#> ● Beta C1 [n = 108, 54%] with mean = 0.59.
#> ● Beta C2 [n = 92, 46%] with mean = 0.13.
#> Score(s): NLL = -101.74; ICL = -170.66 (-170.66), H = 1.02 (1.02). Fit #> converged by MM in 13 steps.
#> #> $`5`
#> ── [ MOBSTER ] My MOBSTER model n = 200 with k = 2 Beta(s) without tail ────────
#> ● Clusters: π = 58% [C1] and 42% [C2], with π > 0.
#> No tail fit.
#>
#> ● Beta C1 [n = 114, 58%] with mean = 0.57.
#> ● Beta C2 [n = 86, 42%] with mean = 0.11.
#> Score(s): NLL = -105.37; ICL = -177.17 (-177.17), H = 1.78 (1.78). Fit #> interrupted by MM in 100 steps.
#>