Putting case study from different angle

Hi all,

I read the case study about putting and wanted to explore it from a different angle. R is the radius of the hole, r is the radius of the golf ball, x is the distance between the ball and the hole

The probability that the ball ends up in the hole is equal to:

which can be written as:

The author wrote the following code to estimate sigma_angle

data {
int J;
int n[J];
vector[J] x;
int y[J];
real r;
real R;
}
transformed data {
vector[J] threshold_angle = asin((R-r) ./ x);
}
parameters {
real<lower=0> sigma;
}
model {
vector[J] p = 2*Phi(threshold_angle / sigma) - 1;
y ~ binomial(n, p);
}
generated quantities {
real sigma_degrees = sigma * 180 / pi();
}


I want to say that the player is a pro and there is no sigma_angle. The only way the ball misses the hole is if the speed of the ball, v is too slow or too fast. I assume this can be written as

where z is a constant. If I alter the script with my method, I have the following

data {
int J;
int n[J];
vector[J] x;
int y[J];
real z;
}

parameters {
real<lower=0> v;
}
model {
vector[J] p =  ???;
y ~ binomial(n, p);
}


How do I define p in the script? In addition, I want to make sure v depends on mean_v and sigma_v, but before making it too complicated, I need to know how to calculate the likelihood that v is between the two extreme bounds. Thanks for your time

After thinking more about I understand that I first need to define the disitribution of v before I can calculate the log-likelihood. So, I want to assume that v follows a normal distribution, with parameters mu and sigma_speed. In theory, mu can only be positive.
My data will consists of observations of puts from multiple distances. The put can be successful if mu is correct and sigma_speed is zero. It can also be successful if the mu is wrong but sigma_speed is very large.
How do I write that mu depends (partially or fully) on distance x. This way the estimates of sigma_speed will be more accurate, correct?

1 Like

Rather than assume the angular error is zero, you could put a strong prior on the sd of angular error, if you’d like to do that.

1 Like

If you have a way of analytically calculating the maximum and minimum velocity for a given distance x, v_{max}, v_{min} required for the ball to fall into the hole you could think of a model where the golfer trys for a velocity v_{target} = f(x) but hits an actual velocity per v_{actual}\sim N(v_{target},\sigma_v). Then I think Pr(v_{min}<v_{actual}<v_{max})=\Phi(\frac{v_{max}-v_{target}}{\sigma_v})-\Phi(\frac{v_{min}-v_{target}}{\sigma_v})

So you could try adding something along the lines of

  vector[J] v_target = f(x);
vector[J] p = Phi((v_max-v_target) / sigma_v) - Phi((v_min-v_target) /
sigma_v);



to the model block and make sigma_v your parameter.

1 Like

I played around a bit with trying to model the targeted velocity. I ran into some identifiability issues that I couldn’t work around (might be related to the number of short vs long putts or accurate, less-precise and less-accurate, more-precise targeting models fitting the data equally well). I ended up using a simpler model that I briefly wrote up. The fit looks interesting, though I hope I didn’t accidentally end up demonstrating a 1 = 1 case.
golf.html (807.0 KB)

1 Like