Git Product home page Git Product logo

nfl4th's Introduction

nfl4th

R-CMD-check CRAN status Lifecycle: stable Support Server Twitter Follow

This is the package that powers the fourth down calculator introduced in this piece on The Athletic.

The code that powers the Twitter fourth down bot is in this folder here and the code that runs the Shiny app is here.

Installation

The easiest way to get the released version of nfl4th is to install it from CRAN with:

install.packages("nfl4th")

To get a bug fix or to use a feature from the development version, you can install the development version of nfl4th from GitHub with:

if (!require("remotes")) install.packages("remotes")
remotes::install_github("nflverse/nfl4th")

Features

  • The go for it model gives probabilities for possibilities of yards gained and includes the possibility of earning a first down via defensive penalty
  • The punt model includes the possibility for getting blocked, returned for a touchdown, or fumbled on the return
  • The field goal model is a simple model of field goal % by distance and roof type

Current limitations

There are some edge cases that are not accounted for. These should only make a marginal difference to the recommendations as they are largely edge cases (e.g. the possibility for a field goal to be blocked and returned).

  • The go for it model does not allow for the possibility of a turnover return. However, long returns are extremely rare: For example, in 2018 and 2019 there were only four defensive touchdowns on plays where teams went for fourth downs out of 1,236 plays, and all of these happened when the game was well in hand for the other team.
  • The punt model doesn’t account for the punter or returner, ignores penalties on returns and ignores the potential for blocked punts to be returned for touchdowns
  • The field goal model doesn’t account for who the kicker is, what the weather is (only relevant for outdoor games), or the possibility of a kick being blocked and returned for a touchdown

Get Started

To get started with nfl4th please see this article. Some examples of 4th down research using the package can be found here.

nfl4th's People

Contributors

actions-user avatar guga31bb avatar mrcaseb avatar tanho63 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.