MLB (Dodgers @ Braves): Will there be an EXTRA BASE HIT in the 4th Inning?
2:20PM
Yes: XBH in 4th Inning
No: No No Extra Base Hit
Inputs Needed to Solve
##### User Estimates #####
LAD_XBHperGame = float(231+17+217)/125
ATL_XBHperGame = float(214+23+199)/125
total_XBHs = LAD_XBHperGame + ATL_XBHperGame
print("The total expected XBHs for the Astros is %s" % round(LAD_XBHperGame,3))
print("The total expected XBHs for the Braves is %s" % round(ATL_XBHperGame,3))
print('')
print("The total expected XBHs for the game is %s" % round(total_XBHs,3))
The total expected XBHs for the Astros is 3.72
The total expected XBHs for the Braves is 3.488
The total expected XBHs for the game is 7.208
## Inputs Defined in the Problem
period_of_innings = 1
XBHs= 0
Method to Solve
- Estimate lambda as the expected XBHs per Inning
- Use the Poisson Distribution to compute the probability of zero XBHs (p_0) being hit in the 1st Inning.
lambda_ = total_XBHs * period_of_innings / 9
print("lambda = the total expected XBHs by both teams over %s innings" % period_of_innings)
print("lambda = %s * %s / %s" % (round(total_XBHs,2),period_of_innings,9))
print("lambda ~ %s" % (round(lambda_,2)))
lambda = the total expected XBHs by both teams over 1 innings
lambda = 7.21 * 1 / 9
lambda ~ 0.8
import math
p = math.exp(-lambda_)*(lambda_**XBHs)/(math.factorial(XBHs))
print("The probability of k events occuring in an Poisson interval = e^(-lambda) * ((lambda^k)/k!)")
print('where k = 0 and lambda = %s' % round(lambda_,2))
print('')
print("p = e^(-%s) * (%s^%s)/%s!" % (round(lambda_,2),round(lambda_,2),XBHs,XBHs))
The probability of k events occuring in an Poisson interval = e^(-lambda) * ((lambda^k)/k!)
where k = 0 and lambda = 0.8
p = e^(-0.8) * (0.8^0)/0!
Solution
print("The probability of zero XBHs being hit in the 4th Inning is %s" % (round(p,3)))
The probability of zero XBHs being hit in the 4th Inning is 0.449
Info
download markdown file
krellabsinc@gmail.com
@KRELLabs
import sys
print(sys.version)
2.7.12 |Anaconda 4.2.0 (64-bit)| (default, Jun 29 2016, 11:07:13) [MSC v.1500 64 bit (AMD64)]
Posted on 8/18/2019