Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] updates to cstwMPC for 0.10.6 #626

Closed
wants to merge 2 commits into from
Closed

Conversation

sbenthall
Copy link
Contributor

This PR attempts to update the cstwMPC code to bring it in line with recent changes to HARK core libraries.

I got hung up at around line 275 as I'm not sure what this code is doing:

https://github.com/econ-ark/HARK/blob/master/HARK/cstwMPC/cstwMPC.py#L270-L281

@sbenthall
Copy link
Contributor Author

Stack trace for this issue:

Traceback (most recent call last):
  File "cstwMPC.py", line 622, in <module>
    main()
  File "cstwMPC.py", line 604, in main
    center_estimate = brentq(paramPointObjective,param_range[0],param_range[1],xtol=1e-6)
  File "/home/sb/.virtualenvs/econ-ark/lib/python3.7/site-packages/scipy-1.3.1-py3.7-linux-x86_64.egg/scipy/optimize/zeros.py", line 775, in brentq
    r = _zeros._brentq(f, a, b, xtol, rtol, maxiter, args, full_output, disp)
  File "cstwMPC.py", line 602, in <lambda>
    dist_type = Params.dist_type)
  File "cstwMPC.py", line 412, in getKYratioDifference
    Economy.distributeParams(param_name,param_count,center,spread,dist_type) # Distribute parameters
  File "cstwMPC.py", line 277, in distributeParams
    self.agents[j](AgentCount = int(self.Population*param_dist[0][b]*self.TypeWeight[n]))
TypeError: 'DiscreteDistribution' object is not subscriptable

@sbenthall
Copy link
Contributor Author

Closing this. cstwMPC will be removed soon.

@sbenthall sbenthall closed this Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant