<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nonlinear | Zach Eisenstein</title><link>https://zscore.netlify.app/tag/nonlinear/</link><atom:link href="https://zscore.netlify.app/tag/nonlinear/index.xml" rel="self" type="application/rss+xml"/><description>nonlinear</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Wed, 31 Aug 2022 00:00:00 +0000</lastBuildDate><image><url>https://zscore.netlify.app/media/icon_hud9c82945b88ad05fb983663079bab794_4614_512x512_fill_lanczos_center_3.png</url><title>nonlinear</title><link>https://zscore.netlify.app/tag/nonlinear/</link></image><item><title>Football, Pythagoras and Bad Statistical Communication</title><link>https://zscore.netlify.app/post/nfl-pythagoras-part1/</link><pubDate>Wed, 31 Aug 2022 00:00:00 +0000</pubDate><guid>https://zscore.netlify.app/post/nfl-pythagoras-part1/</guid><description>&lt;p>I recently picked up the book &lt;a href="https://www.amazon.com/Mathletics-Gamblers-Managers-Mathematics-Sports-dp-0691177627/dp/0691177627/" target="_blank" rel="noopener">Mathletics&lt;/a> &amp;ldquo;How gamblers, managers, and fans use mathematics in sports.&amp;rdquo; by Wayne Winston after hearing a recommendation in an online R meetup.&lt;/p>
&lt;p>The first chapter &amp;ldquo;Baseball&amp;rsquo;s Pythagorean Theorem&amp;rdquo; describes a mathematical relationship attributed to Bill James. The idea is to estimate the percentage of games won in baseball based solely on the offensive and defensive production (runs scored, and runs allowed respectively).&lt;/p>
&lt;blockquote>
&lt;p>Bill James studied many years of Major League Baseball standing and found the percentage of games won by a baseball team can be well approximated by the formula&lt;/p>
&lt;/blockquote>
$$
\text{% games won} = \frac{\text{runs scored}^2} {\text{runs scored}^2 + \text{runs allowed }^2}
$$
&lt;p>My first thought was this doesn&amp;rsquo;t look very &amp;ldquo;pythagorean&amp;rdquo; at all but I continued. Later, the right hand side of the equation was divided through by $\text{runs scored}^2$ and by letting $R = \frac{\text{runs scored}} {\text{runs allowed}}$ you get the new expression:&lt;/p>
$$
\text{% games won} = \frac{R^2} {R^2 + 1}
$$
&lt;p>Now this &lt;strong>really&lt;/strong> isn&amp;rsquo;t looking pythagorean!&lt;/p>
&lt;p>The chapter continues touting the accuracy of the formula:&lt;/p>
&lt;blockquote>
&lt;p>For example, the 2016 LA Dodgers scored 725 runs and gave up 638 runs. Their scoring ratio was 1.136, with a predicted win percentage of .5636 and they actually won .5618.&lt;/p>
&lt;/blockquote>
&lt;p>To the authors&amp;rsquo; credit, they attempted to replicate Bill James expression using data from the 2005-2016 seasons (and excel&amp;rsquo;s data table). What they did was generalize the equation above to allow the exponent to vary ie $\text{% games won} = \frac{R^e} {R^e + 1}$. Ultimately excel found that an exponent of 1.8 minimized the error and that was relatively close to &lt;strong>the original&lt;/strong> pythagorean theorem.&lt;/p>
&lt;p>To this point, I was not too bothered (except for the use of excel). I was only mildly concerned about the lack of communication of uncertainty in the estimate. But where things started to not sit right with me was in the estimation of e for other sports.&lt;/p>
&lt;blockquote>
&lt;p>Daryl Morey, currently the GM for the Houston Rockets NBA team, has shown that for the NFL, e = 2.37 gives the most accurate prediction while for the NBA e = 13.91.&lt;/p>
&lt;/blockquote>
&lt;p>While it&amp;rsquo;s not entirely clear, the estimate of 2.37 appears to have been generated from a &lt;em>single&lt;/em> NFL season, 2015.
This is where I started to have issues:&lt;/p>
&lt;p>In no particular order:&lt;/p>
&lt;ul>
&lt;li>How uncertain is the estimate of this magic exponent?&lt;/li>
&lt;li>Why is it we&amp;rsquo;re assuming this particular functional form? Is there something special about the non-linear equation?&lt;/li>
&lt;li>Could you perhaps get better predictions using points for and points against separately?&lt;/li>
&lt;li>How good are predictions based on random chance alone? In the NFL, there are only 16 games (now 17) in a season.&lt;/li>
&lt;li>Rather than the focus being on the correct estimate, perhaps we should instead quantify the reduction in uncertainty based on the prediction?&lt;/li>
&lt;li>Predicting wins based on points scored seems a bit like predicting foot length by shoe size. It&amp;rsquo;s less a predictor and more intimately tied to the outcome itself.&lt;/li>
&lt;li>Why is the basketball GM opining on football analytics (half kidding)&lt;/li>
&lt;/ul>
&lt;p>I set off to investigate some of the above.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-r" data-lang="r">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">library&lt;/span>(tidyverse)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">library&lt;/span>(nflverse)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">library&lt;/span>(broom)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">library&lt;/span>(patchwork)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">theme_set&lt;/span>(&lt;span style="color:#a6e22e">theme_light&lt;/span>())
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Lets start by looking at the shape of this &amp;ldquo;pythagorean theorem&amp;rdquo;&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-r" data-lang="r">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">tibble&lt;/span>(R &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#a6e22e">seq&lt;/span>(&lt;span style="color:#ae81ff">0.5&lt;/span>, &lt;span style="color:#ae81ff">1.5&lt;/span>, &lt;span style="color:#ae81ff">0.1&lt;/span>)) &lt;span style="color:#f92672">%&amp;gt;%&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">crossing&lt;/span>(&lt;span style="color:#a6e22e">tibble&lt;/span>(e &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#a6e22e">c&lt;/span>(&lt;span style="color:#ae81ff">2&lt;/span>, &lt;span style="color:#ae81ff">1.8&lt;/span>, &lt;span style="color:#ae81ff">2.37&lt;/span>, &lt;span style="color:#ae81ff">13.91&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> label &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#a6e22e">c&lt;/span>(&lt;span style="color:#e6db74">&amp;#39;MLB (2)&amp;#39;&lt;/span>, &lt;span style="color:#e6db74">&amp;#39;MLB (1.8)&amp;#39;&lt;/span>, &lt;span style="color:#e6db74">&amp;#39;NFL (2.37)&amp;#39;&lt;/span>, &lt;span style="color:#e6db74">&amp;#39;NBA (13.91)&amp;#39;&lt;/span>))) &lt;span style="color:#f92672">%&amp;gt;%&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">mutate&lt;/span>(pred_win &lt;span style="color:#f92672">=&lt;/span> R^e &lt;span style="color:#f92672">/&lt;/span> (R^e &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#ae81ff">1&lt;/span>)) &lt;span style="color:#f92672">%&amp;gt;%&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">ggplot&lt;/span>(&lt;span style="color:#a6e22e">aes&lt;/span>(R, pred_win, color &lt;span style="color:#f92672">=&lt;/span> label)) &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">geom_line&lt;/span>()
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;img src="https://zscore.netlify.app/post/nfl-pythagoras-part1/index_files/figure-html/unnamed-chunk-1-1.png" width="672" />
It seems scoring ratio is strongly associated with win probability in the NBA, not so much in the other sports. My guess is this relates to the relative margin of victory in the NBA (and that there are more points scored in general). Also, as the exponent gets larger it looks very sigmoidal (logistic curve).
&lt;p>Now I&amp;rsquo;ll use NFL data gathered from the &lt;code>load_schedules&lt;/code> function from &lt;code>nflreadrr&lt;/code> to explore further.&lt;/p>
&lt;p>Start by getting wins and losses by team.&lt;/p>
&lt;pre tabindex="0">&lt;code>## # A tibble: 6 × 11
## season team w l t total_games win_pct pf pa pd r
## &amp;lt;int&amp;gt; &amp;lt;chr&amp;gt; &amp;lt;int&amp;gt; &amp;lt;int&amp;gt; &amp;lt;int&amp;gt; &amp;lt;int&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;int&amp;gt; &amp;lt;int&amp;gt; &amp;lt;int&amp;gt; &amp;lt;dbl&amp;gt;
## 1 1999 ARI 6 10 0 16 0.375 245 382 -137 0.641
## 2 1999 ATL 5 11 0 16 0.312 285 380 -95 0.75
## 3 1999 BAL 8 8 0 16 0.5 324 277 47 1.17
## 4 1999 BUF 11 5 0 16 0.688 320 229 91 1.40
## 5 1999 CAR 8 8 0 16 0.5 421 381 40 1.10
## 6 1999 CHI 6 10 0 16 0.375 272 341 -69 0.798
&lt;/code>&lt;/pre>&lt;p>The results table contains all team results from the 1999 through 2021 seasons&lt;/p>
&lt;p>Let&amp;rsquo;s take a look at the results of the 2015 season&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-r" data-lang="r">&lt;span style="display:flex;">&lt;span>nfl_results &lt;span style="color:#f92672">%&amp;gt;%&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">filter&lt;/span>(season &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#e6db74">&amp;#34;2015&amp;#34;&lt;/span>) &lt;span style="color:#f92672">%&amp;gt;%&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">ggplot&lt;/span>(&lt;span style="color:#a6e22e">aes&lt;/span>(r, win_pct)) &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">geom_nfl_logos&lt;/span>(&lt;span style="color:#a6e22e">aes&lt;/span>(team_abbr &lt;span style="color:#f92672">=&lt;/span> team), width &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#ae81ff">0.075&lt;/span>, alpha &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#ae81ff">0.6&lt;/span>) &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">scale_y_continuous&lt;/span>(labels &lt;span style="color:#f92672">=&lt;/span> scales&lt;span style="color:#f92672">::&lt;/span>&lt;span style="color:#a6e22e">percent_format&lt;/span>()) &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">labs&lt;/span>(x &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Scoring Ratio, R&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> y &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Win Percentage&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> title &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;2015 NFL Season&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;img src="https://zscore.netlify.app/post/nfl-pythagoras-part1/index_files/figure-html/unnamed-chunk-3-1.png" width="672" />
There's certainly a nice upward trend!
&lt;p>Now let&amp;rsquo;s fit a non-linear model for the 2015 season as described in the book using &lt;code>nls&lt;/code> and extract the results using the &lt;code>augment&lt;/code> and &lt;code>tidy&lt;/code> functions from the &lt;code>broom&lt;/code> package.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-r" data-lang="r">&lt;span style="display:flex;">&lt;span>fit_nls_2015 &lt;span style="color:#f92672">&amp;lt;-&lt;/span> &lt;span style="color:#a6e22e">nls&lt;/span>(win_pct &lt;span style="color:#f92672">~&lt;/span> r^e &lt;span style="color:#f92672">/&lt;/span> (&lt;span style="color:#ae81ff">1&lt;/span> &lt;span style="color:#f92672">+&lt;/span> r^e),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> data &lt;span style="color:#f92672">=&lt;/span> nfl_results &lt;span style="color:#f92672">%&amp;gt;%&lt;/span> &lt;span style="color:#a6e22e">filter&lt;/span>(season &lt;span style="color:#f92672">==&lt;/span> &lt;span style="color:#e6db74">&amp;#34;2015&amp;#34;&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> start &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#a6e22e">list&lt;/span>(e &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#ae81ff">2&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Extract coefficients&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>nls_coef_2015 &lt;span style="color:#f92672">&amp;lt;-&lt;/span> fit_nls_2015 &lt;span style="color:#f92672">%&amp;gt;%&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">tidy&lt;/span>(conf.int &lt;span style="color:#f92672">=&lt;/span> T)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>p1 &lt;span style="color:#f92672">&amp;lt;-&lt;/span> nls_coef_2015 &lt;span style="color:#f92672">%&amp;gt;%&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">ggplot&lt;/span>(&lt;span style="color:#a6e22e">aes&lt;/span>(estimate, term, xmin &lt;span style="color:#f92672">=&lt;/span> conf.low, xmax &lt;span style="color:#f92672">=&lt;/span> conf.high, height &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span>)) &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">geom_point&lt;/span>() &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">geom_vline&lt;/span>(xintercept &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#ae81ff">2.37&lt;/span>, lty &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#ae81ff">4&lt;/span>) &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">geom_errorbarh&lt;/span>() &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">theme&lt;/span>(plot.caption &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#a6e22e">element_text&lt;/span>(hjust &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span>)) &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#75715e"># set the left align here&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">labs&lt;/span>(title &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Estimate of exponent &amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> caption &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Dashed line represents Daryl Morey&amp;#39;s 2.37 figure&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>p2 &lt;span style="color:#f92672">&amp;lt;-&lt;/span> &lt;span style="color:#a6e22e">augment&lt;/span>(fit_nls_2015) &lt;span style="color:#f92672">%&amp;gt;%&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">mutate&lt;/span>(.fitted_low &lt;span style="color:#f92672">=&lt;/span> r^nls_coef_2015&lt;span style="color:#f92672">$&lt;/span>conf.low &lt;span style="color:#f92672">/&lt;/span> (&lt;span style="color:#ae81ff">1&lt;/span> &lt;span style="color:#f92672">+&lt;/span> r^nls_coef_2015&lt;span style="color:#f92672">$&lt;/span>conf.low)) &lt;span style="color:#f92672">%&amp;gt;%&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">mutate&lt;/span>(.fitted_high &lt;span style="color:#f92672">=&lt;/span> r^nls_coef_2015&lt;span style="color:#f92672">$&lt;/span>conf.high &lt;span style="color:#f92672">/&lt;/span> (&lt;span style="color:#ae81ff">1&lt;/span> &lt;span style="color:#f92672">+&lt;/span> r^nls_coef_2015&lt;span style="color:#f92672">$&lt;/span>conf.high)) &lt;span style="color:#f92672">%&amp;gt;%&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">ggplot&lt;/span>(&lt;span style="color:#a6e22e">aes&lt;/span>(r, win_pct)) &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">geom_point&lt;/span>() &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">geom_line&lt;/span>(&lt;span style="color:#a6e22e">aes&lt;/span>(r, .fitted)) &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">geom_ribbon&lt;/span>(&lt;span style="color:#a6e22e">aes&lt;/span>(ymin &lt;span style="color:#f92672">=&lt;/span> .fitted_low, ymax &lt;span style="color:#f92672">=&lt;/span> .fitted_high), alpha&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">0.2&lt;/span>) &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">scale_y_continuous&lt;/span>(labels &lt;span style="color:#f92672">=&lt;/span> scales&lt;span style="color:#f92672">::&lt;/span>&lt;span style="color:#a6e22e">percent_format&lt;/span>(), limits &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#a6e22e">c&lt;/span>(&lt;span style="color:#ae81ff">0&lt;/span>, &lt;span style="color:#ae81ff">1&lt;/span>)) &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">theme&lt;/span>(plot.caption &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#a6e22e">element_text&lt;/span>(hjust &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span>)) &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#75715e"># set the left align here&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">labs&lt;/span>(x &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Scoring Ratio, R&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> y &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Win Percentage&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> title &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Team Win % vs R&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> caption &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Shaded region represents 95% conf. int.&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>patchwork &lt;span style="color:#f92672">&amp;lt;-&lt;/span> p1 &lt;span style="color:#f92672">|&lt;/span> p2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>patchwork &lt;span style="color:#f92672">+&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">plot_annotation&lt;/span>(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> title &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#39;Estimating NFL wins using Scoring Ratio R&amp;#39;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> subtitle &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Based on 2015 NFL Season&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;img src="https://zscore.netlify.app/post/nfl-pythagoras-part1/index_files/figure-html/unnamed-chunk-4-1.png" width="672" />
&lt;p>The estimated exponent is 2.87 +/- .235. The Rockets GM estimate of 2.37 falls outside the range. Maybe because he used different data, maybe because he was minimizing MAE and not RMSE? Who knows, but that&amp;rsquo;s exactly the point.&lt;/p>
&lt;p>In upcoming posts I&amp;rsquo;d like to explore logistic regression, multilevel and bayesian models&lt;/p></description></item></channel></rss>