Hi all,

This topic is a follow-up from this topic

My goal is to determine the throwing accuracy of a darts player. However, now we don’t know the xy coordinates of each thrown, we only know the observed score.

Let’s assume again that a darter aims for target region, *tr*, triple 20 / T20. We can divide the darts board into xy coordinates. The xy-coordinates of target *µ* T20 are

µ = [0, 104]

If we assume that the player is a professional, we can argue that the possible realized scores *z* are close to T20. Because the 5 and 1 segments of the dartboard are adjacent to the 20 segment, we say

z ∈ {T20, S20, T5, S5, T1, S1}

A visual representation of the data looks as follows:

We transpose the data, so that each row is in the form *(tr, z, n)*

example.csv (103 Bytes)

*h* represents the numerical score of the dart outcome and *n* represents the number of darts.

Taking the center of the dart board to be the origin (0,0), we can map each xy-coordinate to the dart score z, e.g. D16, SB, T20, S7 etc.

Next, we write the following model:

[x, y] ~ N(µ, Σ)

µ is known for each data-point but that only the result *z* was observed rather than the realized location (x, y) of each dart.

Σ is a covariance matrix and

According to the authors of this paper I need to solve the following loglikelihood function (Appendix, formula 16)

where *R(z,i)* is the region defined by the dart *z,i*, i.e

and *p* is the number of possible scores; 6.

’

Can someone help me write this likelihood function into my Stan code/attempt?

```
data {
int<lower=1> n_of_scores; // number of possible scores
matrix[n_of_scores, 2] scores; // actual scores and frequency
row_vector[2] mu; // [0,104]
}
parameters {
cov_matrix[2] sigma;
}
model {
for (p in in 1:n_of_scores)
scores[p][1] ~ multi_normal(mu, sigma);
}
```

In addition, can someone explain to me how we can go from a score (1-dimensional data) to calculating the covariance matrix which is two dimensional? I am struggling to see how this is achieved…

Thanks