This functions plots the score of each combination of parameters for this mixture.

plot_model_selection(x)

Arguments

x

An object of class bmix that represents a fit.

Value

A ggplot object.

Examples

# Simple dataset data = data.frame(successes = c(rbinom(30, 100, .4), rbinom(70, 100, .7)), trials = 100) # BMix fit x = bmixfit(data, K.Binomials = 1:3, K.BetaBinomials = 1:3)
#>
#> ── BMix fit ────────────────────────────────────────────────────────────────────
#>
#> Binomials k_B = 1, 2, and 3, Beta-Binomials k_BB = 1, 2, and 3; 12 fits to run.
#> Warning: start values do not satisfy constraints
#> Warning: start values do not satisfy constraints
#> Warning: NaNs produced
#> Warning: MLE error, forcing stop.
#> Warning: start values do not satisfy constraints
#> Warning: start values do not satisfy constraints
#> Warning: start values do not satisfy constraints
#> Warning: start values do not satisfy constraints
#> Warning: 60 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: iterations terminated because half-step sizes are very small
#> Warning: some quantities such as z, residuals, SEs may be inaccurate due to convergence at a half-step
#> Warning: start values do not satisfy constraints
#> Warning: start values do not satisfy constraints
#> Warning: start values do not satisfy constraints
#> Warning: 60 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: iterations terminated because half-step sizes are very small
#> Warning: some quantities such as z, residuals, SEs may be inaccurate due to convergence at a half-step
#> Warning: start values do not satisfy constraints
#> Warning: start values do not satisfy constraints
#> Warning: start values do not satisfy constraints
#>
#> Bmix best fit completed in 0.02 mins
#>
#> ── [ BMix ] My BMix model n = 100 with k = 2 component(s) (2 + 0) ──────────────
#> • Clusters: π = 70% [Bin 2] and 30% [Bin 1], with π > 0.
#> • Binomial Bin 1 with mean = 0.395619239688036.
#> • Binomial Bin 2 with mean = 0.691086760482976.
#> Score (model selection): ICL = 715.67.
plot_model_selection(x)