I’m trying to model a problem where I have reason to believe that certain observations matter more than others (or, put another way, I consider some observations to be more important in the overall final fit than others). I found another post that recommended replacing:

```
for(i in 1:N_obs ){
pred[i] = a[i] + b[i] * x[i];
mean_y[i] ~ normal (pred[i], sigma[i]);
}
```

with

```
for(i in 1:N_obs){
pred[i] = a[i] + b[i] * x[i];
target += normal_lpdf(mean_y[i] | pred[i] , sigma[i]) * weight[i];
}
```

In my case, I’m using:

```
win ~ bernoulli_logit(win_chance_logit);
```

which suggests switching to

```
target += bernoulli_logit_lpdf(win | win_chance_logit) .* weight;
```

However, I’m also capturing log likelyhoods and generated data in order to use `arviz.loo`

:

```
generated quantities{
vector[NG] log_lik;
vector[NG] win_hat;
for (n in 1:NG) {
log_lik[n] = bernoulli_logit_lpmf(win[n] | win_chance_logit[n]);
win_hat[n] = bernoulli_logit_rng(win_chance_logit[n]);
}
}
```

What would the right way to weight those be in order for `arviz.loo`

to respect the importance of each observation? Should I just multiply the `bernoulli_logit_lpmf`

by the weight?

From a modelling perspective, I understand that maybe I shouldn’t be adding into my model manually. However, in this particular case, the parameter I’m focused on understanding is supposed to capture something about the dynamics of a game when it’s played optimally, so I want it to most-closely match the performance of the highest level players. If there’s a way to represent that in my model definition, then I’d love to hear about it, but I couldn’t figure out any way to do it except to weight the observations (the results of games played) based on knowledge of who the top players are.