nflseedR_compute_results {nflseedR} | R Documentation |
Compute NFL Game Results in Season Simulations
Description
This is the default nflseedR function to compute game results in season simulations.
Usage
nflseedR_compute_results(teams, games, week_num, ...)
Arguments
teams |
A list of teams by simulation number. This is usually calculated automatically and not user facing. It can be used to "transport" team information like elo ratings from one simulated week to the next. Defaults to sims_teams_example. Please see this example to understand the required data structure. |
games |
An NFL schedule where some results are missing. |
week_num |
The week of a NFL season for which the function should compute results. |
... |
Additional parameters used in the function. It is possible to pass
the argument |
Details
This function implements a variant of 538's elo model initially coded by Lee Sharpe (in nflseedR 1.0) and for performance rewritten by Sebastian Carl (in nflseedR 2.0).
Value
A list of updated teams
and games
tables.
Examples
g <- nflseedR::sims_games_example
# The functions expects the variable "sim" instead of "season"
g$sim <- g$season
t <- nflseedR::sims_teams_example
out <- nflseedR_compute_results(
teams = t,
games = g,
week_num = 5L
)
str(out, max.level = 2)