# Golf as phase space

Hi all,

Let’s assume that you play golf on an uneven-green. There are multiple trajectories that can result in successful put.
A very fast put aimed directly at the hole would reach the hole, but would be too fast to fall into. On the other hand, if the ball is aimed at too high an angle the ball will come to a halt without reach the hole, regardless of the speed.

It is possible to display the angle- and speed choices as a phase space.

6 -2.5 -2.25 -2 -1.75 -1.5 -1.25 -1 -0.75 -0.5 -0.25 0 0.25 0.5 0.75 1 1.25 1.5 1.75 2 2.25 2.5
5.75 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
5.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
5.25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4.75 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4.25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3.75 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
3.5 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0
3.25 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0
2.75 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0
2.5 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0
2.25 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
1.75 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1.25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.75 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

On the x-axis, you see the angle where 0 is straight at the hole. On the y-axis, you see the (launch) speed of the ball in m/s. As you can see there are multiple combinations of speed and angle that result in a successful put (a 1).

I would like to write a model where I combine the case study of @andrewgelman and the answer of @js592. and slightly modify it. They assume that

``````y ∼ binomial(n,p)
``````

However, I also have data that shows where the ball eventually ended up. Logically this final position is also a set of combinations of speed and angle.
We don’t know exactly which combination in the phase space the golfer targeted and we also don’t know the exact path of the final put. Is it still possible to use Bayesian inference to calculate sigma_speed and sigma_angle from the latent variables?

Thanks

I strongly suspect that having two trajectories both ending in the hole is going to lead to a multi-modal posterior (one mode corresponding to the first case and one to the second).

Edit: When I tried to explicitly incorporate a “targeted speed” component to my model I found two modes that I think were related to “aiming” for the front or back lip of the hole. The only workaround I was able to come up with was to just assume the golfers always aim for the middle.

1 Like

I actually have an update to the golf case study! It’s in the in-progress Workflow book.

1 Like

@js592 Yes, but there could be more than 2 successful put trajectories. If you look at the phase space, all the 1s are pretty concentrated. If they are concentrated then I would assume that two (or more) local maxima in the pdf is unlikely right?

My main worry is that we don’t know exactly which combination (speed/angle) the golfer targeted and eventually executed. Can we still infer the players sigma_speed and sigma_angle?

Great, looking forward to it! What’s the expected publish date of the book?

Ahhhh, good question! I very much hope we finish by the end of 2022. The book will be available as a pdf as well as hardcover book, once it is done!
A

1 Like

I will definitely order it when its available. In the meanwhile can you shine your light on my question?
Do you expect problems if we want to obtain sigma_speed and sigma_speed as both the input and the output are latent variables?

If I understand what you’re saying, you want there to be a latent angle and speed for each putt in the data. Implicitly, our model is already doing that, but we’re assuming the green is flat, or equivalently we are assuming that the golfer is making an implicit calculation and aiming for the most direct angle given the slope. That is, we’re assuming the golfer has an optimal (angle, speed) in mind and that the actual (angle, speed) are just these plus random error. If you want to explicitly include these errors in your model, you can do so, but given that we’ve already implicitly integrated these out, I think that for computational reasons it would make sense to draw from the conditional posterior distribution of (angle,speed) for any given shot in the generated quantities block.

3 Likes

Thanks for the explanation! I will use the generated quantitates block to reproduce the phase space.
I have a final question regarding the dependent variable. In your model the put is a hit or a miss. I have data that shows where the ball stopped in the end. I would assume that I can learn more about sigma_angle and sigma_speed from this data than hit/miss. However, the binomial distribution disappears with this type of data. Any recommendation how to work with this data?

In this case, I’d recommend using the binomial likelihood as given, and then an additional term when you know where the ball stopped. Good luck!

1 Like