CausalPy icon indicating copy to clipboard operation
CausalPy copied to clipboard

Implement `summary` method for `cp.pymc_experiments.InstrumentalVariable`

Open drbenvincent opened this issue 1 year ago • 4 comments

At the moment cp.pymc_experiments.InstrumentalVariable does not have an implementation of the summary method. It would be good to add this, and to add test coverage (e.g. in test_iv_reg in test_integration_pymc_examples.py)

Tagging @NathanielF - feel free to assign yourself if you want to take it up :)

drbenvincent avatar Jun 19 '24 15:06 drbenvincent

@NathanielF have you made a start with this? I would also be happy to give it a crack.

HPCurtis avatar Mar 27 '25 16:03 HPCurtis

Hi @HPCurtis

I have not even made a start at it!

Feel free to do so! And thank you!

NathanielF avatar Mar 27 '25 16:03 NathanielF

@drbenvincent @NathanielF. When following how the summary method is implemented in the other experiments.py classes, we encounter an error related to how print_coefficients() is implemented in the PyMCModel class within pymc_models.py. This error arises because the method expects model beta parameters to be named exactly as "beta". However, in the InstrumentalVariable class, there needs to be a distinction between beta_t and beta_z. Advice on how to proceed would be helpful. For example, should I write an InstrumentalVariable-specific print_coefficients() method, or should I implement logic to handle the specific IV case within the existing method?

HPCurtis avatar Mar 27 '25 23:03 HPCurtis

Looking at the UML diagram, I would say it makes most sense to override the base print_coefficients method in the InstrumentalVariable class

Image

Reminder that this will affect the API docs, so remember to try to build the docs locally to check it's all as expected.

Thanks for taking it on 👍🏻

drbenvincent avatar Mar 28 '25 09:03 drbenvincent