TidyX 48: Monte Carlo Simulation for NBA Match Ups

Last week, we used an R optimizer to build a model for predicting game outcomes in the NHL. This week, Ellis Hughes and I continue on that work and build a Monte Carlo Simulation for forecasting NBA games. We use the model to obtain the probability that one team beats the other and then we extract the estimated margin of victory from our simulation and reflect the entire distribution of estimated values, rather than just a single point estimate.

To watch the screen cast, CLICK HERE.

To access our code, CLICK HERE.

TidyX 47: NHL Win Probability, R optimizer, & gt tables

This week, Ellis Hughes and I discuss using an optimization algorithm in R to find team strength ratings for the NHL 2019-2020 season. We show how to then use the results from these ratings to forecast the probability that one team wins over another while accounting for the home ice edge. Finally, we output the team strength ratings into a {gt} table.

To watch the screen cast, CLICK HERE.

To access our code, CLICK HERE.

TidyX 46: Network Graphics & NHL Salaries

This week, Ellis Hughes and I begin by working through the code that Natalie O’Shea created to show Kenyan Census data from this week’s TidyTuesday data set. It was an interesting plot because instead of the common network visual of lines and nodes, she plotted circles nested within circles.

After that, we continue working on NHL data by scraping the salaries of skaters and goalies and explore the relationship between team spending and wins using logistic regression (NOTE: we discussed a lot of the ins and outs of logistic regression in TidyX 29).

To watch the screen cast, CLICK HERE.

To access our code, CLICK HERE.

TidyX 44: plotly, maps, & NBA travel

This week, Ellis Hughes and I discuss building maps in {plotly}.

First, we go through the code of Martin Devaux, who made a cool looking plot showing the evolution of public transit expansion costs around the world (data courtesy of TidyTuesday Project). The plot was really interesting and actually threw us for a loop as we initially thought we were looking at a true map! It wasn’t until we got into the code that we realized what was going on and that it wasn’t an actual map at all.

We then move into {plotly} to build a map of NBA travel. The data comes from the Jose Fernandez, who created a cool R package called {airball}.

 

To watch our screen cast, CLICK HERE.

To access our code, CLICK HERE.