Package {cfbseedR}


Title: Simulate and Evaluate College Football Seasons
Version: 0.3.0
Description: Simulate college football seasons and compute standings, conference ranks, conference champions, and College Football Playoff (CFP) seeds. Implements the official season-scoped championship-game tiebreaker procedure of each Football Bowl Subdivision (FBS) conference and the CFP's season-keyed automatic-qualifier policies, including the 2026 formats. Seasons are simulated week by week with a pluggable results generator, and external tiebreaker inputs such as committee rankings or analytics composites can be supplied. Adapts the approach of the 'nflseedR' package by Sebastian Carl and Lee Sharpe to college football semantics.
License: MIT + file LICENSE
URL: https://cfbseedR.sportsdataverse.org, https://github.com/sportsdataverse/cfbseedR
BugReports: https://github.com/sportsdataverse/cfbseedR/issues
Depends: R (≥ 4.1.0)
Imports: cli, dplyr (≥ 1.1.0), furrr, future, progressr, purrr, rlang, stats, tibble, tidyr, utils
Suggests: gt (≥ 0.9.0), scales (≥ 1.2.0), testthat (≥ 3.0.0)
Encoding: UTF-8
Language: en-US
Config/Needs/website: cfbfastR, knitr, rmarkdown
Config/testthat/edition: 3
Config/roxygen2/version: 8.1.0
LazyData: true
NeedsCompilation: no
Packaged: 2026-11-30 15:17:45 UTC; saiem
Author: Saiem Gilani ORCID iD [cre, aut, cph], Sebastian Carl [aut, cph] (Author of nflseedR, from which cfbseedR is adapted), Lee Sharpe [aut, cph] (Author of nflseedR, from which cfbseedR is adapted)
Maintainer: Saiem Gilani <saiem.gilani@gmail.com>
Repository: CRAN
Date/Publication: 2026-11-30 16:40:18 UTC

cfbseedR: Simulate and Evaluate College Football Seasons

Description

logo

Simulate college football seasons and compute standings, conference ranks, conference champions, and College Football Playoff (CFP) seeds. Implements the official season-scoped championship-game tiebreaker procedure of each Football Bowl Subdivision (FBS) conference and the CFP's season-keyed automatic-qualifier policies, including the 2026 formats. Seasons are simulated week by week with a pluggable results generator, and external tiebreaker inputs such as committee rankings or analytics composites can be supplied. Adapts the approach of the 'nflseedR' package by Sebastian Carl and Lee Sharpe to college football semantics.

Author(s)

Maintainer: Saiem Gilani saiem.gilani@gmail.com (ORCID) [copyright holder]

Authors:

See Also

Useful links:


Example Games of a Toy College Football Season

Description

A nine-team, two-conference toy season (plus one independent) used throughout the examples, the vignettes, and as the default input of simulations_verify_fct(). It is the same data shipped in inst/extdata/toy_games.csv, so it needs no network access.

Usage

cfb_games_example

Format

A data frame with the columns cfb_standings() requires:

Column Type Description
season integer Season identifier.
game_type character "REG" or "CONF_CHAMP".
week integer Week number of the game.
home_team, away_team character Team names matching cfb_teams_example$team.
home_points, away_points integer Final scores (feed the SEC capped-margin rung).
result integer Home margin, i.e. home score minus away score.

See Also

cfb_teams_example, cfb_standings(), cfb_simulations()

Examples

head(cfb_games_example)

Build an Engine Games Table from a cfbfastR Schedule

Description

Maps the schedule shape returned by cfbfastR::load_cfb_schedules() to the games schema used by cfb_standings() and cfb_simulations(). cfbfastR is not required - any data frame with the expected columns works.

Usage

cfb_games_from_schedule(schedule)

Arguments

schedule

A data frame with at least season, week, season_type, home_team, away_team. Optional columns used when present: home_points/away_points (to compute result), neutral_site, conference_game (carried as conf_game, so a game between two members of one conference that the schedule marks as non-conference stays out of the conference standings), and notes (games whose notes mention "championship" are classified as "CONF_CHAMP").

Details

Game type mapping: season_type == "postseason" becomes "POST", games whose notes contain "championship" (case-insensitive) become "CONF_CHAMP", everything else "REG". This is a documented heuristic - CFBD marks conference championship games as regular-season games with a championship note.

Value

A tibble in the engine games schema, ready for cfb_standings() / cfb_simulations():

Column Type Description
season integer Season taken from the schedule.
week integer Week number of the game.
game_type character "REG", "CONF_CHAMP" (notes mention "championship"), or "POST" (season_type == "postseason").
home_team character Home team name.
away_team character Away team name.
result numeric Home margin (home minus away points); NA for unplayed games.
neutral integer Neutral-site flag (0/1).
home_points numeric Home team points; NA for unplayed games. Feeds the SEC capped_scoring_margin tiebreaker rung.
away_points numeric Away team points; NA for unplayed games.
conf_game logical The schedule's conference_game flag (NA when the schedule has none). An explicit FALSE keeps a same-conference game out of the conference standings.

See Also

cfb_standings(), cfb_simulations(), cfbfastR::load_cfb_schedules() from cfbfastR, the nflseedR original: https://nflseedr.com

Examples

schedule <- data.frame(
  season = 2024, week = c(1, 1, 15, 16),
  season_type = c("regular", "regular", "regular", "postseason"),
  home_team = c("A1", "B1", "A1", "A1"),
  away_team = c("A2", "B2", "A2", "B1"),
  home_points = c(21, 24, 17, NA), away_points = c(14, 20, 14, NA),
  neutral_site = c(FALSE, FALSE, TRUE, TRUE),
  notes = c(NA, NA, "Alpha Championship Game", NA)
)
cfb_games_from_schedule(schedule)


Compute College Football Playoff Seeds

Description

Implements 12-team CFP straight seeding with a season-keyed automatic-qualifier policy:

Under both policies seeds are assigned strictly in ranking order (champions are not bumped up; straight seeding, 2025+).

Usage

cfb_playoff_seeds(
  standings,
  rankings = NULL,
  playoff_seeds = 12L,
  autobid = c("2026", "2025")
)

Arguments

standings

A standings table as returned by cfb_standings() (requires at least team, conference, conf_champ, win_pct, sov, sos, pd, and a sim or season id column).

rankings

Optional data frame with columns team and rank (1 = best), e.g. the CFP committee rankings. Teams missing from rankings are treated as unranked and ordered behind all ranked teams. When NULL, a documented fallback ordering is used instead: teams are ordered by win percentage, then strength of victory, strength of schedule, point differential, and team name.

playoff_seeds

Number of playoff spots (default 12).

autobid

Automatic-qualifier policy, "2026" (default) or "2025" - see Description.

Details

Under autobid = "2025", if there are fewer than 5 conference champions all champions are guaranteed (capped at playoff_seeds). Under either policy a guaranteed team ranked outside the top playoff_seeds displaces the lowest-ranked at-large team and is seeded by its rank order within the field. Conference names are matched against both cfbd and short spellings (e.g. "American Athletic" / "American").

Value

The standings input (all its columns unchanged; see cfb_standings() for the column table) with one column added:

Column Type Description
seed integer CFP seed in straight-seeding order; NA for teams outside the playoff field.

See Also

cfb_standings(), cfb_simulations(), the nflseedR original: https://nflseedr.com

Examples

games <- cfb_games_example
teams <- cfb_teams_example
standings <- cfb_standings(games, teams, tiebreaker_depth = "POINTS",
                           verbosity = "NONE")
rankings <- data.frame(team = c("B1", "I1", "A1", "A3"), rank = 1:4)
seeded <- cfb_playoff_seeds(standings, rankings = rankings, playoff_seeds = 4)
seeded[!is.na(seeded$seed), c("team", "seed")]


Simulate a College Football Season

Description

Simulates college football seasons based on a games/schedule table that holds matchups with and without results. Missing results are computed week by week using the pluggable compute_results function (default: cfbseedR_compute_results(), an ELO-based generator adapted from nflseedR). After the scheduled games, standings, conference champions, and CFP seeds are computed, and - with sim_include = "POST" - the playoff bracket is simulated round by round.

Usage

cfb_simulations(
  games,
  teams,
  compute_results = cfbseedR_compute_results,
  ...,
  simulations = 10000L,
  playoff_seeds = 12L,
  tiebreaker_depth = c("SOS", "PRE-SOV", "POINTS", "RANDOM"),
  sim_include = c("POST", "REG"),
  rankings = NULL,
  autobid = c("2026", "2025"),
  tiebreaker_data = NULL,
  chunks = 8L,
  verbosity = c("MIN", "MAX", "NONE")
)

Arguments

games

A data frame of games of a single season, in the schema of cfb_standings() plus an optional neutral column (0/1). Games with result = NA are simulated. Must not contain game_type == "POST" rows - the playoff bracket is generated from the computed seeds.

teams

A data frame with columns team and conference. Teams with conference "FBS Independents" or NA are treated as independents: they appear in overall standings but receive no conference rank. An optional division column (e.g. "FBS"/"FCS") feeds the Big 12 total_wins FCS cap; absent -> that cap degrades to uncapped win totals (noted, see tiebreak_notes below). An optional conf_division column (e.g. "East"/"West") turns on division-format ranking for a conference: each division is ranked separately (with that conference's registered procedure) and the division champions take conf_rank 1-2. Supplying divisions for a conference IS the opt-in - correct for the 2026 Sun Belt and equally for historical divisional seasons of any conference. An optional logical postseason_eligible column (explicit FALSE = ineligible) keeps a team out of the championship-game ranks while its games still count in every comparison (the ACC policy makes this explicit); with fewer than two eligible teams in a conference the remaining conf_rank 1-2 slots are necessarily filled by ineligible teams. teams need not list every team that appears in games - an unlisted opponent (e.g. an FCS-or-lower team) gets no standings row of its own, but its games still count toward its opponents' records and toward the Big 12 total_wins FCS cap (an unknown opponent counts as FCS-or-lower).

compute_results

A function computing results of games, with the required arguments teams, games, and week_num. See simulations_verify_fct() for the contract and cfbseedR_compute_results() for the default.

...

Additional parameters passed on to compute_results.

simulations

The number of times the season shall be simulated.

playoff_seeds

Number of CFP spots (default 12), passed to cfb_playoff_seeds().

tiebreaker_depth

One of "SOS" (default), "PRE-SOV", "POINTS", or "RANDOM". Controls how deep the tiebreaker cascade goes before falling back to a coin flip:

  • "RANDOM": coin flip immediately.

  • "PRE-SOV": head-to-head and common opponents only.

  • "SOS": adds strength of victory, then strength of schedule.

  • "POINTS": adds conference point differential.

This depth ladder gates ONLY the generic fallback cascade used by unregistered conferences; the registered official procedures below always run in full.

sim_include

One of "POST" (default) or "REG":

  • "REG": simulate the remaining schedule and compute standings, conference champions, and playoff seeds.

  • "POST": "REG" + simulate the playoff bracket.

rankings

Optional committee rankings (team, rank) used for CFP seeding, held static across simulations. When NULL, seeding falls back to the per-simulation standings ordering (see cfb_playoff_seeds()).

autobid

CFP automatic-qualifier policy passed to cfb_playoff_seeds(): "2026" (default, current rule) or "2025".

tiebreaker_data

Optional named list of external tiebreaker inputs (analytics_ratings, cfp_rankings, apr), held static across simulations - see cfb_standings(). Missing inputs skip their rungs (noted).

chunks

The number of chunks the simulations are split into (default 8, capped at simulations). Chunks are dispatched with furrr::future_map(), so they run in parallel as soon as you set a parallel plan, e.g. future::plan("multisession"); with the default sequential plan they simply run one after another. There is no universally best number - too many chunks can be as slow as too few.

verbosity

One of "MIN" (default), "MAX", or "NONE", as in cfb_standings(). "NONE" silences the progress messages entirely.

Details

The playoff bracket is a standard single-elimination bracket of size 2^ceiling(log2(playoff_seeds)) with byes for the top seeds - for 12 seeds this reproduces the CFP bracket (quarterfinals 1 vs 8/9 winner, 4 vs 5/12, 3 vs 6/11, 2 vs 7/10). First-round games are hosted by the higher seed; later rounds are neutral-site. There is no reseeding (fixed bracket, per the CFP format). Conference championship matchups are simulated as scheduled, not re-derived from simulated standings.

Simulations are split into chunks and dispatched with furrr, so a parallel future::plan() spreads them across cores. Progress can be reported by turning on progressr::handlers() before the call, or by piping the call into progressr::with_progress().

Set a seed with set.seed() for reproducibility: furrr generates parallel-safe RNG streams per chunk, so a given seed reproduces exactly - but the stream differs from a single sequential pass, so results for the same seed change if you change chunks.

Value

A list of class cfbseedR_simulation with these elements:

Element Type Description
standings tibble Per-simulation standings in the cfb_standings() schema (see its column table; sov/sos are conference-REG-scoped) plus seed and - with sim_include = "POST" - exit (integer: 0 = missed playoff, r = eliminated in round r, max round + 1 = national champion).
games tibble All games of all simulations (sim, game_type, week, home_team, away_team, result, neutral), incl. generated playoff games.
overall tibble Per-team means across simulations: wins (average), and probabilities conf_champ, playoff, seed1, won_natty.
team_wins tibble Per-team probability of clearing each half-win threshold (team, wins, over_prob, under_prob).
game_summary tibble Per-matchup aggregates: away_wins, home_wins, ties, mean result, games_played, away_percentage, home_percentage.
sim_params list The simulation parameters (number of simulations, seeds, depth, etc.).

See Also

cfb_standings(), cfb_playoff_seeds(), cfbseedR_compute_results(), simulations_verify_fct(), the nflseedR original: https://nflseedr.com

Examples

games <- cfb_games_example
teams <- cfb_teams_example
games$result[games$week >= 3] <- NA
set.seed(4)
sim <- cfb_simulations(games, teams, simulations = 4, playoff_seeds = 4)
sim$overall


Compute College Football Standings

Description

Computes overall and conference standings from a table of game results, including conference ranks (via a documented tiebreaker cascade), conference champions, and - optionally - College Football Playoff seeds.

Adapted from nflseedR's nfl_standings() with college football semantics: conferences instead of divisions, independents excluded from conference ranks, and conference championship games counting toward the overall record (and deciding the champion) but not the conference record.

Usage

cfb_standings(
  games,
  teams,
  ...,
  ranks = c("CONF", "NONE"),
  tiebreaker_depth = c("SOS", "PRE-SOV", "POINTS", "RANDOM"),
  playoff_seeds = NULL,
  rankings = NULL,
  autobid = NULL,
  tiebreaker_data = NULL,
  verbosity = c("MIN", "MAX", "NONE")
)

Arguments

games

A data frame of games. Required columns:

sim or season

A season or simulation ID.

game_type

One of "REG", "CONF_CHAMP", "POST".

week

Week number of the game.

home_team, away_team

Team names matching teams$team.

result

Home margin, i.e. home score minus away score. Must not be NA (play or simulate the games first).

Optional home_points/away_points columns (per-game scores) feed the official SEC capped_scoring_margin tiebreaker rung (see "Official per-conference tiebreakers" below); cfb_games_from_schedule() emits both. Absent -> that rung is skipped, not an error. An optional logical conf_game column (the schedule's conference-game flag, which cfb_games_from_schedule() carries over) keeps a game between two members of one conference out of the conference record and every conference-game tiebreaker (head-to-head, common opponents, SOV/SOS, the CFP final-week clause, div_pct) when it is explicitly FALSE - a non-conference game between conference members, or the Pac-12's 2026 Flex Week. It still counts in the overall record, and so in the Big 12 total_wins rung. NA or absent -> a REG game between two members of one conference counts.

teams

A data frame with columns team and conference. Teams with conference "FBS Independents" or NA are treated as independents: they appear in overall standings but receive no conference rank. An optional division column (e.g. "FBS"/"FCS") feeds the Big 12 total_wins FCS cap; absent -> that cap degrades to uncapped win totals (noted, see tiebreak_notes below). An optional conf_division column (e.g. "East"/"West") turns on division-format ranking for a conference: each division is ranked separately (with that conference's registered procedure) and the division champions take conf_rank 1-2. Supplying divisions for a conference IS the opt-in - correct for the 2026 Sun Belt and equally for historical divisional seasons of any conference. An optional logical postseason_eligible column (explicit FALSE = ineligible) keeps a team out of the championship-game ranks while its games still count in every comparison (the ACC policy makes this explicit); with fewer than two eligible teams in a conference the remaining conf_rank 1-2 slots are necessarily filled by ineligible teams. teams need not list every team that appears in games - an unlisted opponent (e.g. an FCS-or-lower team) gets no standings row of its own, but its games still count toward its opponents' records and toward the Big 12 total_wins FCS cap (an unknown opponent counts as FCS-or-lower).

...

Currently unused.

ranks

One of "CONF" (default) or "NONE". "NONE" returns the raw standings and skips the conference-rank tiebreaker walk entirely - and therefore also conf_champ and seed, which are derived from it. Useful when you only need records and the cascade would be wasted work.

tiebreaker_depth

One of "SOS" (default), "PRE-SOV", "POINTS", or "RANDOM". Controls how deep the tiebreaker cascade goes before falling back to a coin flip:

  • "RANDOM": coin flip immediately.

  • "PRE-SOV": head-to-head and common opponents only.

  • "SOS": adds strength of victory, then strength of schedule.

  • "POINTS": adds conference point differential.

This depth ladder gates ONLY the generic fallback cascade used by unregistered conferences; the registered official procedures below always run in full.

playoff_seeds

If not NULL, a seed column is added via cfb_playoff_seeds() with this number of playoff spots.

rankings

Optional committee-style rankings data frame with columns team and rank, passed to cfb_playoff_seeds(). Ignored when playoff_seeds is NULL.

autobid

CFP automatic-qualifier policy passed to cfb_playoff_seeds(), "2026" or "2025". The default, NULL, picks it by season: with a season id column, seasons before 2026 use "2025" and 2026 onwards "2026"; plain sim ids use the current rule, "2026". Ignored when playoff_seeds is NULL.

tiebreaker_data

Optional named list of external inputs for the official registry rungs. Supported: analytics_ratings, a data frame with columns team and rating (feeds the SportSource-style rating / metric-composite rungs used by the Big Ten, Big 12, ACC, MAC, American, CUSA, Mountain West, Sun Belt and Pac-12 - supply your own composite of the conference's published metrics), and cfp_rankings, a data frame with columns team and rank (feeds the cfp_ranked_final_week clause used by the American, CUSA, and Sun Belt, and the Pac-12's two-team cfp_ranking rung, which uses the CFP ranking released the Tuesday before week 13), and apr, a data frame with columns team and apr (multi-year Academic Progress Rate, the CUSA 2024 policy's late fallback). A missing input -> that rung is skipped (noted).

verbosity

One of "MIN" (default), "MAX", or "NONE". "MAX" logs every tied group as it's broken.

Details

Conference ranks are seeded by conference win percentage; ties within a tier are broken by a documented cascade. Registered conferences (SEC, Big Ten, Big 12, ACC, MAC, American, Conference USA, Mountain West, Sun Belt, and the re-formed Pac-12 from 2026) use their official procedures (see "Official per-conference tiebreakers" below); every other conference, and the Pac-12 before 2026, uses the generic fallback: head-to-head record among the tied teams, record vs. common conference opponents (minimum one), conference-scoped strength of victory, conference-scoped strength of schedule, conference point differential, and finally a coin flip, gated by tiebreaker_depth. All cascade quantities are computed over regular-season conference games so conference ranks depend only on conference play.

Official per-conference tiebreakers

CONFERENCE_TIEBREAKERS (internal) registers each conference's official procedure as a list of season-scoped epochs, so a policy change applies from its first season: with a season id column, the ACC's all-new 2026 policy (head-to-head, then SportSource Team Success Ranking, then a draw, with the alternate-game-count candidate-pool rule) applies from 2026 while earlier seasons keep the 2024 cascade. The MAC's 2025 order (SportSource right after common opponents, then order of finish, then opponents' win pct) and Conference USA's 2025 policy (common opponents, their top-down descent, average computer ranking, opponents' win pct) likewise apply from 2025, with their 2024 procedures before that. The re-formed Pac-12's 2026 procedure (published 2026-09-03) has separate two-team and multiple-team lists, and a tie reduced to two switches to the two-team list: multiple teams go head-to-head (only when every tied team played the others), common opponents, the standings descent, opponents' win pct, SportSource, coin toss; two teams go head-to-head, the standings descent, common opponents, the CFP ranking of the Tuesday before week 13, SportSource, coin toss. Plain sim ids resolve to the current rules. The SEC/Big Ten/Big 12 2024 procedures are ported from sdv-py's cfb_standings.py, and both engines return the same conference ranks (sdv-py 0.2.0 still advances to the next rung after a partial elimination; sdv-py releases after sportsdataverse/sportsdataverse-py#1130 restart at rung 1 as here). Rung primitives: h2h (multi-team combined head-to-head, applied only when every tied pair played; otherwise only "defeated-all" elimination - the symmetric "lost-to-all" elimination is intentionally not modeled, a documented simplification, see R/tiebreakers.R), record_vs_common, record_vs_common_desc (descend the standings from best to worst, comparing a tied GROUP of common opponents collectively - the Big 12 rule, adopted for every registry descent rung; the SEC, Big Ten, ACC, Big 12, MAC and CUSA rungs descend only over opponents every tied team played, as their policies require "common conference opponents played by all other teams involved in the tie", while the Sun Belt's "next highest position" rung does not), opp_conf_win_pct (pooled opponents' conference win pct - this reuses the existing sos column, which already computes the pooled sum-of-wins/sum-of-games formula), capped_scoring_margin (SEC: points scored capped at 42 / allowed capped at 48, per game, summed over conference games; needs home_points/away_points), total_wins (Big 12: overall wins with at most one win vs an FCS-or-lower opponent counted; needs teams$division), analytics_rating (external, via tiebreaker_data$analytics_ratings - stands in for each conference's published metric composite, e.g. Connelly SP+ / ESPN SOR / KPI / SportSource for the American, CUSA, and Mountain West), cfp_ranked_final_week (American/CUSA/Sun Belt: the best-ranked tied team advances if it won its final conference game, else the clause falls through; needs tiebreaker_data$cfp_rankings), cfp_ranking (Pac-12 two-team: the best-ranked tied team advances; needs tiebreaker_data$cfp_rankings), div_pct (Sun Belt: win pct vs same-division opponents; needs teams$conf_division), and coin_toss. After each team is seeded/eliminated the procedure restarts from the first rung with the remaining tied set; when a rung's required input is unavailable it is skipped deterministically and the skip is recorded once (per conference) in attr(result, "tiebreak_notes"). Under registry conferences, conf_rank 1-2 are the two teams that reach the conference championship game (the cascade only orders them - see the design brief).

Value

A tibble of standings, one row per (sim, team) (the id column is named season if the input used season), sorted by sim, conference, conference rank, and team. Note that sov and sos are conference-REG-scoped: they are computed over regular-season conference games only, sov over conference victories and sos over conference opponents; independents get 0.0 for both. The result also carries a character vector attr(result, "tiebreak_notes") recording any registry rungs skipped for lack of their optional input (see "Official per-conference tiebreakers" above); empty when nothing was skipped.

Column Type Description
sim / season integer Season or simulation ID (name follows the input).
team character Team name.
conference character Conference name ("FBS Independents" / NA = independent).
games integer Games played (REG + CONF_CHAMP).
wins integer True win count (ties not counted).
losses integer True loss count.
ties integer Tie count.
win_pct numeric Overall win percentage; a tie counts as half a win.
pd integer Overall point differential.
conf_games numeric Regular-season conference games played (0 for independents).
conf_wins numeric Wins over regular-season conference games.
conf_losses numeric Losses over regular-season conference games.
conf_ties numeric Ties over regular-season conference games.
conf_pct numeric Conference win percentage (CONF_CHAMP games excluded).
conf_pd numeric Point differential over regular-season conference games.
sov numeric Strength of victory, conference-REG-scoped: beaten conference opponents' conference wins divided by their conference games. Independents: 0.0.
sos numeric Strength of schedule, conference-REG-scoped: all conference opponents' conference wins divided by their conference games. Independents: 0.0.
conf_rank integer Rank within the conference via the tiebreaker cascade (NA for independents).
conf_champ logical Conference champion flag (decided by the CONF_CHAMP game).
seed integer CFP seed, only when playoff_seeds is not NULL (NA outside the field).

See Also

cfb_playoff_seeds(), cfb_simulations(), cfb_games_from_schedule(), the nflseedR original: https://nflseedr.com, and cfbfastR for real schedules

Examples

games <- cfb_games_example
teams <- cfb_teams_example
standings <- cfb_standings(games, teams, tiebreaker_depth = "POINTS",
                           verbosity = "NONE")
standings[, c("team", "conference", "conf_rank", "conf_champ")]

# An official-registry analytics rating input (used by Big Ten/Big
# 12/ACC/MAC when their cascade reaches the `analytics_rating` rung)
ratings <- data.frame(team = teams$team, rating = seq(90, 70, length.out = nrow(teams)))
standings2 <- cfb_standings(games, teams,
                            tiebreaker_data = list(analytics_ratings = ratings),
                            verbosity = "NONE")
attr(standings2, "tiebreak_notes")


Example Teams of a Toy College Football Season

Description

The team table that pairs with cfb_games_example: nine teams across two conferences plus one independent. Same data as inst/extdata/toy_teams.csv.

Usage

cfb_teams_example

Format

A data frame with the columns cfb_standings() requires:

Column Type Description
team character Team name, matching the game table.
conference character Conference name; "FBS Independents" marks an independent.

See Also

cfb_games_example, cfb_standings()

Examples

cfb_teams_example

Compute CFB Game Results in Season Simulations

Description

The default compute_results function used by cfb_simulations(). It is a faithful adaptation of nflseedR's nflseedR_compute_results() (a variant of 538's ELO model, originally coded by Lee Sharpe and rewritten by Sebastian Carl): a simple dynamic ELO carried through the teams table, updated each week from (real or simulated) results. The home-field bonus and the margin noise are fitted to FBS results (see home_field and margin_sd); the rest of the ELO machinery keeps nflseedR's constants.

Usage

cfbseedR_compute_results(
  teams,
  games,
  week_num,
  ...,
  home_field = 59.4,
  margin_sd = 16.7
)

Arguments

teams

A data frame of teams by simulation with at least the columns sim and team. May carry an elo column between weeks.

games

A data frame of games with at least sim, game_type, week, home_team, away_team, result, and optionally neutral (0/1; the home_field ELO bonus applies when not neutral).

week_num

The (numeric) week to simulate. Only games with week == week_num & is.na(result) receive a simulated result.

...

Optionally pass elo, a named vector of initial ELO ratings (names = team names). If absent, teams start at random ratings drawn from rnorm(1500, 150).

home_field

Home-field advantage in ELO points, added to the home team's rating difference for games that are not neutral. The default, 59.4, is 2.38 points of margin (the generator divides ELO by 25), fitted on 8,551 FBS-vs-FBS games from 2014-2025 (2020 excluded). Before cfbseedR 0.3.0 this was nflseedR's NFL value, 20 (0.8 points).

margin_sd

Standard deviation, in points, of a simulated margin around its ELO estimate. The default, 16.7, is the spread of real FBS margins around a pregame-ELO estimate over the same games. Before cfbseedR 0.3.0 this was nflseedR's NFL value, 13.

Details

Mechanics: ELO difference is home - away plus home_field for true home games, multiplied by 1.2 in the postseason (game_type != "REG"). Win probability is 1 / (10^(-elo_diff / 400) + 1), the margin estimate is elo_diff / 25, and simulated margins are drawn from rnorm(mean = estimate, sd = margin_sd) and rounded away from zero. The 400 logistic scale, the 25 ELO points per point of margin, the 1.2 postseason multiplier and the K = 20 update are nflseedR's; the data support the 25 ELO-per-point scale for FBS (a free fit gives 23.6). Pass home_field and margin_sd through cfb_simulations()'s ... to override them, e.g. ⁠home_field = 20, margin_sd = 13⁠ reproduces the pre-0.3.0 (NFL) behavior. Ties are possible in the regular season only; a simulated postseason tie is re-decided by the win probability with a 1-point margin (3 points before cfbseedR 0.3.0). nflseedR's rest-day adjustment is dropped (no rest data in the CFB schema).

Value

A list with two elements, as required by the compute_results contract (see simulations_verify_fct()):

Element Type Description
teams data.frame The input teams table with the elo column added/updated from this week's results.
games data.frame The input games table with result filled for this week's previously missing results (home margin, integer).

See Also

cfbseedR_ratings_compute_results() for a generator driven by fixed team ratings, cfb_simulations(), simulations_verify_fct()

Examples

games <- cfb_games_example
teams <- cfb_teams_example
games$result[games$week >= 3] <- NA
teams$sim <- 1
games$sim <- 1
out <- cfbseedR_compute_results(teams, games, week_num = 3)
out$games[out$games$week == 3, ]


Compute CFB Game Results from Fixed Team Ratings

Description

An alternative compute_results function for cfb_simulations(): it draws each unplayed game's margin from fixed team ratings instead of the dynamic ELO of the default cfbseedR_compute_results(). Three kinds of rating are supported, each with defaults fitted on FBS results:

Use it through ... of cfb_simulations(): cfb_simulations(games, teams, compute_results = cfbseedR_ratings_compute_results, ratings = tbl, rating_type = "points").

Usage

cfbseedR_ratings_compute_results(
  teams,
  games,
  week_num,
  ...,
  ratings,
  rating_type = c("points", "adj_epa", "raw_epa"),
  scale = NULL,
  home_field = NULL,
  margin_sd = NULL
)

Arguments

teams

A data frame of teams by simulation with at least the columns sim and team. May carry an elo column between weeks.

games

A data frame of games with at least sim, game_type, week, home_team, away_team, result, and optionally neutral (0/1; the home_field ELO bonus applies when not neutral).

week_num

The (numeric) week to simulate. Only games with week == week_num & is.na(result) receive a simulated result.

...

Ignored. Present so the function accepts the arguments cfb_simulations() passes to every compute_results function.

ratings

A data frame with one row per team: team (character, matching the team names in games), rating (numeric, no NA, on the scale of rating_type), and optionally games (non-negative number of games behind each rating; NA = unknown). Teams missing from ratings get a rating of 0 (league average).

rating_type

One of "points" (default), "adj_epa" or "raw_epa". Picks the default scale, home_field and margin_sd.

scale

Points of margin per unit of rating difference. Either one number or a named vector keyed by games-played buckets written "lo-hi" (for example c("0-3" = 32, "4-5" = 38, "6-7" = 45, "8-20" = 50)). NULL uses the default for rating_type.

home_field

Home-field advantage in points, added to the expected margin of games that are not neutral. NULL uses the default for rating_type.

margin_sd

Standard deviation, in points, of a simulated margin around its expected value (at least 0): one number or a named bucket vector, as for scale. NULL uses the default for rating_type.

Details

The expected home margin of a game is scale * (rating_home - rating_away) + home_field (no home_field on a neutral site). The simulated margin is a draw from rnorm(mean = expected, sd = margin_sd) rounded away from zero: up to the next whole number when positive, down when negative. A draw of exactly 0 in a postseason game (in practice only with margin_sd = 0) is re-decided by the win probability pnorm(expected / margin_sd) with a 1-point margin. Ratings stay fixed through the season, so teams is returned unchanged.

Bucketed scale and margin_sd take the bucket of the less-observed team of a game: the smaller games value of the two (a team missing from ratings, or with NA games, does not count). A count takes the bucket with the largest lower bound at or below it, so a count between buckets takes the lower one, a count above every bucket the top one and a count below every bucket the bottom one. When neither team has a count (no games column, say) the game takes the top bucket, which treats the ratings as full-season ratings; early in a season that overstates how much the ratings are worth, so pass games.

Defaults by rating_type (buckets 0-3 / 4-5 / 6-7 / 8-20 games):

rating_type scale margin_sd home_field
"points" 1.093 / 0.923 / 1.031 / 1.063 16.97 / 16.64 / 16.23 / 16.45 2.376
"adj_epa" 31.88 / 37.89 / 45.18 / 49.61 17.04 2.763
"raw_epa" 28.58 / 34.32 / 45.10 / 52.02 17.93 / 17.24 / 16.98 / 17.39 2.376

The "points" and "raw_epa" values are a walk-forward fit on FBS-vs-FBS games 2014-2025 (2020 excluded) of a current-season least-squares margin rating and of net EPA per play, with home_field fixed at the ELO generator's within-season estimate. The "adj_epa" values are sportsdataverse-py's modern-era pregame-prediction constants, fitted to that package's adj_net rating; a rating from another opponent adjustment may need its own scale and margin_sd. Fit record: https://github.com/sportsdataverse/cfbseedR/blob/main/data-raw/cfb_generator_constants.md.

In a walk-forward test over the same seasons, scoring each week from ratings built on earlier weeks, the ELO margin formula fed with CollegeFootballData's pregame ELO (carried over between seasons) had the smallest error overall: MAE 12.94 points, against 13.10 for the least-squares points rating and 13.38 / 13.70 for the fitting script's adjusted / raw EPA ratings. Its edge is early in the season, where the current-season ratings have little to go on. From about six games on the points rating is level with it (MAE 12.93 against 13.04 with 8 or more games), so a points rating is a reasonable input for a late-season or postseason simulation. To get ELO's early-season advantage from cfbseedR_compute_results(), pass carried-over starting ratings as elo; without them every team starts from a random rating.

Value

A list with two elements, as required by the compute_results contract (see simulations_verify_fct()):

Element Type Description
teams data.frame The input teams table, unchanged.
games data.frame The input games table with result filled for this week's previously missing results (home margin, integer).

See Also

cfbseedR_compute_results() (the default ELO generator), cfb_simulations(), simulations_verify_fct()

Examples

games <- cfb_games_example
teams <- cfb_teams_example
games$result[games$week >= 3] <- NA
teams$sim <- 1
games$sim <- 1
ratings <- data.frame(
  team = teams$team,
  rating = seq(10, -10, length.out = nrow(teams))
)
out <- cfbseedR_ratings_compute_results(
  teams, games, week_num = 3, ratings = ratings, rating_type = "points"
)
out$games[out$games$week == 3, ]


Format Probabilities for Display

Description

Formats a numeric vector of probabilities as percentage strings the way simulation summaries want them: values below 1% render as "<1%" and values above 99.9% as ">99.9%", so a long-shot never reads as a flat ⁠0%⁠ and a near-lock never reads as a certain ⁠100%⁠. Exact 0 and exact 1 are left as "0%" and "100%".

Adapted from nflseedR's fmt_pct_special().

Usage

fmt_pct_special(x)

Arguments

x

A numeric vector of probabilities, all between 0 and 1 (NA is allowed and returned as NA).

Value

A character vector the same length as x.

See Also

summary.cfbseedR_simulation()

Examples


fmt_pct_special(c(0, 0.0004, 0.123, 0.5, 0.9994, 1))


Verify a Custom CFB Result Simulation Function

Description

cfbseedR supports custom functions to compute results in season simulations through the compute_results argument of cfb_simulations(). This function verifies that a custom function behaves as the simulator expects, mirroring nflseedR's simulations_verify_fct(). It checks the output structure and whether game results are changed as expected, and errors with a hint at the first problem found.

Usage

simulations_verify_fct(compute_results, ..., games = NULL, teams = NULL)

Arguments

compute_results

A function to compute results of games. Required arguments: teams, games, week_num. It must return list(teams = teams, games = games) without removing rows or columns from games, must fill result for exactly the games with week == week_num & is.na(result), must not modify any other result, and must not produce ties (result == 0) outside the regular season.

...

Further arguments passed on to compute_results.

games

A schedule where some results are missing. Defaults to the bundled toy season with all results from week 3 onward blanked.

teams

A teams table (team, conference, optionally sim). Defaults to the bundled toy teams.

Value

Returns TRUE invisibly if no problems are found.

See Also

cfb_simulations(), cfbseedR_compute_results()

Examples

simulations_verify_fct(cfbseedR_compute_results)


Compute a Pretty Simulation Summary Table

Description

Renders the overall table of a cfb_simulations() result as a gt table, one row group per conference, sorted by average wins. Probabilities are formatted with fmt_pct_special() so long-shots and near-locks stay readable.

The CFB counterpart of nflseedR's summary.nflseedR_simulation(); the layout is conference-grouped rather than nflseedR's AFC/NFC pair of columns, because college conferences are neither two nor equally sized.

Usage

## S3 method for class 'cfbseedR_simulation'
summary(object, ...)

Arguments

object

A cfbseedR_simulation object, as returned by cfb_simulations().

...

Additional arguments (currently unused).

Value

A gt_tbl object.

See Also

cfb_simulations(), fmt_pct_special()

Examples


games <- cfb_games_example
games$result[games$week >= 3] <- NA
set.seed(4)
sim <- cfb_simulations(games, cfb_teams_example,
                       simulations = 4, playoff_seeds = 4, chunks = 1)
summary(sim)