Home Archives Search Feed Football Squares How To Use


MLB (Cubs @ Padres): How many STRIKEOUTS will Yu Darvish (CHC) record during Innings 1-3?


3:50PM
3 or Fewer
4 or More


Inputs To Solve

Darvish 2019 STRIKEOUT per OUT Rate

##### User Estimates #####

Yu_KperOut = 190/((157*3)+1)

print("Yu Darvish's 2019 K per Out rate is ~%s" % round(Yu_KperOut,3))
Yu Darvish's 2019 K per Out rate is ~0.403
## Inputs Defined in the Problem
period_of_innings = 3
Ks = 3

Method to Solve

## [1]

import numpy as np
import pandas as pd

# Yu Darvish K / no K probability
pK_Yu = Yu_KperOut
pnoK_Yu = 1 - pK_Yu
prob_Yu = (pK_Yu,pnoK_Yu)
K_grid = (1,0)

# Enumerate all possible combinations of K / no K for Yu D over 3 Innings 
# max 9 Total Ks - if all outs are STRIKEOUTS
y = np.array([(a,b,c,d,e,f,g,h,i) for a in K_grid for b in K_grid for c in K_grid
              for d in K_grid for e in K_grid for f in K_grid
              for g in K_grid for h in K_grid for i in K_grid])

K = pd.DataFrame(y)
K['total_Ks'] = K.sum(axis=1)


# Compute the probability of all possible combinations of K / no K for Yu D over 3 Innings
x = np.array([(a,b,c,d,e,f,g,h,i) for a in prob_Yu for b in prob_Yu for c in prob_Yu
              for d in prob_Yu for e in prob_Yu for f in prob_Yu
              for g in prob_Yu for h in prob_Yu for i in prob_Yu])

P = pd.DataFrame(x)
P['p'] = P.product(axis=1)
K.head()
0 1 2 3 4 5 6 7 8 total_Ks
0 1 1 1 1 1 1 1 1 1 9
1 1 1 1 1 1 1 1 1 0 8
2 1 1 1 1 1 1 1 0 1 8
3 1 1 1 1 1 1 1 0 0 7
4 1 1 1 1 1 1 0 1 1 8
P.head()
0 1 2 3 4 5 6 7 8 p
0 0.402542 0.402542 0.402542 0.402542 0.402542 0.402542 0.402542 0.402542 0.402542 0.000278
1 0.402542 0.402542 0.402542 0.402542 0.402542 0.402542 0.402542 0.402542 0.597458 0.000412
2 0.402542 0.402542 0.402542 0.402542 0.402542 0.402542 0.402542 0.597458 0.402542 0.000412
3 0.402542 0.402542 0.402542 0.402542 0.402542 0.402542 0.402542 0.597458 0.597458 0.000611
4 0.402542 0.402542 0.402542 0.402542 0.402542 0.402542 0.597458 0.402542 0.402542 0.000412
a = {}
for i in set(K.total_Ks):
    a[i] = round(P['p'][K['total_Ks']==i].sum(),2)
    
print("The possible outcomes of STRIKEOUTS for Yu Darvish in Innings 1-3 and their respective probabilities are: %s" % a)
The possible outcomes of STRIKEOUTS for Yu Darvish in Innings 1-3 and their respective probabilities are: {0: 0.01, 1: 0.06, 2: 0.16, 3: 0.25, 4: 0.25, 5: 0.17, 6: 0.08, 7: 0.02, 8: 0.0, 9: 0.0}
## [2]

p = P['p'][K['total_Ks']<=Ks].sum()

Solution

print("The probability that Yu Darvish records 3 or Fewer STRIKEOUTS in Innings 1-3 is ~%s" % round(p,3))
The probability that Yu Darvish records 3 or Fewer STRIKEOUTS in Innings 1-3 is ~0.476



Info

download md file
email: krellabsinc@gmail.com
twitter: @KRELLabs

import sys
print(sys.version)
3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
Posted on 9/12/2019






← Next post    ·    Previous post →