- What tutorial are you running?

Designing Adaptive Experiments to Study Working Memory

- What version of Pyro are you using?

1.8.2 - Please link or paste relevant code, and steps to reproduce.

I am attempting to build off the working memory tutorial, and my goal is to try this analysis with a logistic regression model with more features (i.e. more than just 1 as in the tutorial). I’m having a hard time understanding the model as implemented:

```
def model(l):
# Dimension -1 of `l` represents the number of rounds
# Other dimensions are batch dimensions: we indicate this with a plate_stack
with pyro.plate_stack("plate", l.shape[:-1]):
theta = pyro.sample("theta", dist.Normal(prior_mean, prior_sd))
# Share theta across the number of rounds of the experiment
# This represents repeatedly testing the same participant
theta = theta.unsqueeze(-1)
# This define a *logistic regression* model for y
logit_p = sensitivity * (theta - l)
# The event shape represents responses from the same participant
y = pyro.sample("y", dist.Bernoulli(logits=logit_p).to_event(1))
return y
```

Specifically, I’m confused about `logit_p = sensitivity * (theta - l)`

, since I’ve always seen the log odds written as `logit_p = beta_0 + beta_1 * x_1 + beta_2 * x_2 + ... beta_d * x_d`

. I tried to implement the model using that approach, like so

```
def model(l):
# Dimension -1 of `l` represents the number of rounds
# Other dimensions are batch dimensions: we indicate this with a plate_stack
with pyro.plate_stack("plate", l.shape[:-1]):
b_0 = pyro.sample("b_0", dist.Normal(prior_mean, prior_sd)).unsqueeze(-1)
b_1 = pyro.sample("b_1", dist.Normal(1, 1)).unsqueeze(-1)
logit_p = b_0 + b_1 * l
y = pyro.sample("y", dist.Bernoulli(logits=logit_p).to_event(1))
return y
```

but I cannot replicate the results from the tutorial. Any thoughts on what I’m doing wrong here?