Nhat Cao16.90 Project 3
Probabilistic Simulation of a Baseball Batter
I. Implementation of the Monte Carlo simulationTo implement the
Monte Carlo method, the given codes for random number generators of
different distributions were modified, using the definitions from
the Course Notes. The generators are fairly simple and only the
functions rand and randn were needed. For the main Monte Carlo
code, parameters of different distributions for the components of
bb_dyn the trajectory calculator, are input. Then, for a specified
number of iterations, parameters are drawn from their distribution
and the trajectory is calculated. The batted trajectory is then
categorized and recorded. The history of the input parameters,
range, and height is recorded for histogramsThe standard error in
estimating probabilities is also calculated, and the number of
iterations is adjusted upon this information. If the number of
iterations is not large enough, it will be increased such that the
error of the desired probability is smaller than 0.003, satisfying
the 0.01 envelope at 99% confidence.II. Test driveTo make sure the
sample schemes are working as intended, the following histograms
are generated from the input distributions
Fig 1. Normal Distribution of Wind Speed
Fig 2. Log normal distribution of Bat Speed
Fig 3. Triangular distribution of Spin
Fig 4. Triangular Distribution of Cda
III. ProbabilitiesThe following probabilities are generated for
all there pitch types. The iteration size is increased until all
probabilities meet the required confidence envelope, meaning the
calculated standard error of each is less than 0.0033.Pitch
typeHigh FastballSinking FastballCurveball
Ground Ball00.54090.1383
Line Drive00.29800.0663
Fly Ball0.71530.16050.3492
Home Run0.28470.00070.4462
Iterations200002200025000
IV. Histograms of Range and inputsCase 1: High Fastball with
20000 iterations
Case 2: Sinking Fastball with 22000 iterations
Case 3: Curveball with 25000 iterations
The histograms do not vary much for Vwind, Vbat, Cda, Cdb and Cm
because they are the same distributions for all three pitches. The
distributions for Vball are all log-normal, but the different
variance make the spread envelopes different between pitches. The
triangular distributions for theta and omega also have different
spreads and range of value.
V. IntepretationThe sinking fastball gives the highest
probability of ground ball hits, so I would recommend it to the
pitcher to create a double-play. On the other hand, the batters
should probably hit a curveball because it has the highest
probability of home run hits.
VI. Estimation of the Mean DistanceThe following estimations are
made for the different pitchesPitch TypeHigh FastballSinking
FastballCurveball
Mean357.968.6345.8
Variance5477376720473
Standard Error0.27390.17120.8189