sbenthall / SHARKFin

Simulating Heterogeneous Agents with Finance
6 stars 5 forks source link

switch agent_pop #219

Closed alanlujan91 closed 1 year ago

alanlujan91 commented 1 year ago

@sbenthall the last error seems to be stochastically failing? locally I can get it to pass sometimes, but it also comes at the end of a simulation

sbenthall commented 1 year ago

@sbenthall to try to debug

sbenthall commented 1 year ago

I am able to replicate the Python 3.10 error locally:

ValueError: Warning: parameter CRRA is not a Distribution found in agent type <class 'HARK.ConsumptionSaving.ConsPortfolioModel.SequentialPortfolioConsumerType'>

https://github.com/econ-ark/HARK/blob/0b108f5c331c2f8168d8d8e0dc333ce4c5b3b487/HARK/core.py#L1551-L1554

It looks like this is happening with approx_distributions, and throwing an error based on a case that you are deliberately catching.

Note also that the SharkPopulation's repr() method appears to be broken.

self = <[AttributeError("'SharkPopulation' object has no attribute 'population_parameters'") raised in repr()] SharkPopulation object at 0x7fb569bbed10>

I ran the tests 3 times and got the failure each time, so that's 3 for 3. Seems quite consistent to me.

sbenthall commented 1 year ago

We got this working ! Hooray!