THE BOOK cover
The Unwritten Book is Finally Written!
An in-depth analysis of: The sacrifice bunt, batter/pitcher matchups, the intentional base on balls, optimizing a batting lineup, hot and cold streaks, clutch performance, platooning strategies, and much more.
Read Excerpts & Customer Reviews

Buy The Book from Amazon


SABR101 required reading if you enter this site. Check out the Sabermetric Wiki. And interesting baseball books.
MOST RECENT ARTICLES
MAIL : You ask | We say

Advanced


THE BOOK--Playing The Percentages In Baseball

<< Back to main

Friday, June 05, 2009

Scaling PITCHf/x

Someone asked me how I scale a pitch from PITCHf/x to a common scale.  This is my response:


sz_top (operator-marked top of strike zone)
sz_bottom (operator-marked bottom of strike zone)
pz (location of pitch)
new_top (whatever constant you want to set for all players)
new_bottom (ditto)

How to scale a pitch

IF pz sz_top
    pz 
    
sz_top 
    
new_top

# we want to keep the relative position, with no stretching

IF pz sz_bottom
    
(pz 0
    / (
sz_bottom 0
    * (
new_bottom 0
    + 
0

# we want to stretch the position based on the bottom of the zone and the ground
# I realize the 0 is extraneous, but I wanted to show it so you can see the form and how it matches the next step

ELSE
    (
pz-sz_bottom
    / (
sz_top-sz_bottom
    * (
new_top-new_bottom
    + 
new_bottom

# we want to stretch the position within the zone itself being the universe, and then moving the whole zone up or down

Page 1 of 1 pages

<< Back to main