In my previous post, I showed a few plots representing the effect on movement and velocity only of applying a linear-operator-as-park-corrector to "correct" one game in Tampa to one game in Baltimore. This operator showed some improvement, but also created at least one more problem. Specifically, it overcorrected the horizontal movement of Jeremy Hellicksons curveball to be much less than it should have been. In that post, I went into almost no detail about how this operator was derived. That's what this post is for.
The details so far are as follows (and note that there are many here that may change in the future). The goal is to derive one operator that can be applied to positions, velocites and accelerations. At this point, I apply that operator somewhere along the pitch trajectory, then propagate the pitch backwards to 55 ft to get the initial velocity and release parameters. That's the plan for the use of this operator.
Recall in my first post the form I used to write down what we wind up seeing from PITCHf/x at any two given parks:
With p0 representing an identical pitch as it leaves the hand of a given player at either stadium S or stadium T. The GRG^-1 term represents the correction term that must be applied to account for a difference in air density, with the R operator being a diagonal matrix with rho/rho_0 on the diagonal elements that correspond to ax, ay, and az, and rho represents the air density at that particular park, and rho_0 our standard air density. T and S simply represent the operator that transforms an actual pitch that was thrown into the data we receive at their respective stadiums, and are unknown, and dt and ds are simply the data we receive.
Since the first toy experiment was designed to ignore the effects of air density, we can simplify to write:
dt = T p0
ds = S p0
If then we have a situation where the same pitch is recorded by our two different systems, T and S, then we can say:
p0 = T^-1 dt
ds = S T^-1 dt
Since both S and T are unknown, we can only solve for the combination S T^-1, or T S^-1 explicitly. We'll call S T^-1 = A. This A is the operator I am solving for in my toy experiment.
Now we simply assume that fastballs thrown by a given pitcher in one park are equivalent to fastballs he threw in the other park. And the same for changeups, curves, etc, etc. There are a few ways to approach this. For now, I simply went with the brute force approach. We "assume" that each pitch in a category thrown at one park maps exactly to each pitch in the same category thrown at the other park. (This actually works out to be nearly identical to using averages of the parameters, but with a weighting that prefers larger clusters, and although it seems like it should, it does not significantly add to computational complexity). Doing so gives a set of equations of the following form for each mapping defined
a11*xs + a12*ys + a13*zs = xt
a21*xs + a22*ys + a23*zs = yt
a31*xs + a32*ys + a33*zs = zt
where xs, ys, zs can represent acceleration components for pitches thrown in S and similar for pitches thrown in T. Note though: We could also use velocities. And release points. Also note, in the case of accelerations, it turns out that when we cannot ignore air density, there is a 4th translation term in those equations, and it is proportional to the difference in air density between the two parks...but since we are ignoring air density for the time being, that term has been dropped. You'll also note here that I have left out any scale factors. For the moment, I am limiting myself to affine transformations without translations.
Next we just rewrite this set of 3 equations for each pitch mapping in matrix form.
Xa = y
where X is a 3N x 9 matrix (N here represents the number of pitch mappings we have, not the number of pitches thrown in each park. In my toy model I have something like 5000 mappings) composed of pitch parameters for each pitch thrown in park T (Tampa in my previous post) and y is a 3N vector composed of pitch parameters for each pitch thrown in park S (Baltimore in my previous post), and a is a vector composed of the elements of A. This is the classic inverse problem with the well known least squares solution of:
a = (X^T X)^-1 X^T b
(although computing this without loss of precision can be a bit of a headache, but there are ways around that)
Now, my first rounds of doing this were remarkably unstable. So to stabilize things, I also included in X and y the initial velocity components of the pitch, and the results of that produced the movement plots you saw in the previous post. As it was late when I got around to making plots, I didn't check the release points, or I would have shown you how bad they got screwed up. The separation in release points got bigger. In my tests so far today, I included release point data, and that seemed to fix the release points, but also let a little bit of the original movement separation back in. However it's progress. I should also note that the matricies looked almost the way I thought they might look. More like a shear mapping than anything else. Imagine the x/y plane staying mostly fixed and the z axis falling over a little bit in some direction. Also, this was not a large tilt by any stretch of the imagination. About 6 degrees. It's hard to notice a picture frame thats off by 6 degrees.
So anyway, that's where all this is at right now. It's not as pretty as I hoped, and I'm not showing plots now because I don't feel like wasting space with them, but it's not a complete loss yet. (If you'd like to see more plots, just let me know. I may make a big plots post. I've got about a million of them now.) I may have to open things up and compare more than just two games. Two series maybe. We'll see. I may also need to open it up to the possibility of a projective transformation on the coordinate system. I hope not though. There's still more to try, and I'm encouraged that at least a few things are starting to converge.