Revision e2adabe0ed1038568742fa7fa1af105f94524834 authored by Mitzi Morris on 04 May 2020, 00:15:30 UTC, committed by Mitzi Morris on 04 May 2020, 00:15:30 UTC
1 parent c26e0c2
Raw File
golf2.stan
data {
  int J;
  int n[J];
  vector[J] x;
  int y[J];
  real r;
  real R;
  real overshot;
  real distance_tolerance;
}
parameters {
  real<lower=0> sigma_theta;
  real<lower=0> sigma_distance;
}
model {
  vector[J] p_angle;
  vector[J] p_distance;
  vector[J] p;
  p_angle = 2*Phi(asin((R-r)./x) / sigma_theta) - 1;
  p_distance = Phi((distance_tolerance - overshot) ./ ((x + overshot)*sigma_distance)) -
               Phi((- overshot) ./ ((x + overshot)*sigma_distance));
  p = p_angle .* p_distance;
  y ~ binomial(n, p);
}
generated quantities {
  real sigma_degrees;
  sigma_degrees = (180/pi())*sigma_theta;
}

back to top