Predicts the probability of a win and method of victory for a matchup between two fighters. It supports three statistical frameworks: a multinomial logistic regression, a Bradley-Terry (Logit) network model, and a Thurstone-Mosteller (Probit) network model.

model_fight_outcome(
  fighter1,
  fighter2,
  method_type = "multinomial",
  fights_data = ufc_fights,
  athletes_data = ufc_athletes,
  predictors = NULL,
  plot_chart = TRUE
)

Arguments

fighter1

A character string of length 1 naming the first athlete.

fighter2

A character string of length 1 naming the second athlete.

method_type

A character string specifying the model type. Options are: `"multinomial"`, `"bradley-terry"`, or `"thurstone-mosteller"`. Default is `"multinomial"`.

fights_data

A data frame containing historical fight records. Default is `ufc_fights`.

athletes_data

A data frame containing athlete statistics. Default is `ufc_athletes`.

predictors

A character vector of variables to use in the model formula. If `NULL`, a robust default set is used based on the `method_type`.

plot_chart

A logical indicating whether to draw the probability chart. Defaults to `TRUE`.

Value

Returns an object of class fight_prediction containing:

model

The fitted model object (`multinom` or `BTm`).

method_probs

A data frame of predicted probabilities for each fighter and method of victory.

plot

The generated ggplot2 object (if ggplot2 is available).

Examples

if (FALSE) { # \dontrun{
# Standard Execution
model_fight_outcome("Islam Makhachev", "Alexander Volkanovski", method_type = "multinomial")

# Assigned to a Variable (Hidden Output, can be printed later)
my_model <- model_fight_outcome(
  "Max Holloway", "Justin Gaethje",
  method_type = "multinomial",
  plot_chart = FALSE
)

print(my_model)
} # }