This loop looks up `self.model.param_names[i]` several times within the loop; might make sense to change this to

```
for idx, param_name in enumerate(self.model.param_names):
```