Skip to contents

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

Usage

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: 27 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: 140 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: 140 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: 27 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> 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: 27 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: 78 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> 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: NaNs produced
#> Warning: MLE error, forcing stop.
#> Warning: start values do not satisfy constraints
#> Warning: start values do not satisfy constraints
#> Warning: 78 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: some quantities such as z, residuals, SEs may be inaccurate due to convergence at a half-step
#> 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: 27 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> 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.01 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.40368049358065.
#> • Binomial Bin 2 with mean = 0.709145115549286.
#> ℹ Score (model selection): ICL = 726.13.

plot_model_selection(x)
#> Warning: Ignoring unknown parameters: `size`