A few thoughts
- Consider making the arguments positional arguments rather than keyword arguments. You can use a docstring to tell the reader what the arguments mean. This also means you can change the internal API easier.
- Re-factor your code so it only takes one input. It’s not obvious why your
Q4function needs two arguments ifxis fully determined byj - Use structs. If you find yourself passing a lot of information around which uses the same parameters over and over again, consider putting everything you need for your model in a
structand passing that around instead.