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

SciPy2019-NameError DemArk Notebooks #37

Closed
thedatalass opened this issue Jul 13, 2019 · 1 comment
Closed

SciPy2019-NameError DemArk Notebooks #37

thedatalass opened this issue Jul 13, 2019 · 1 comment
Assignees
Labels
bug Something isn't working priority:medium

Comments

@thedatalass
Copy link

thedatalass commented Jul 13, 2019

Alternative Combos of Parameter Values

for ThisType in log_progress(MyTypes, every=1):
    ThisType.solve()
    ThisType.initializeSim()
    ThisType.simulate()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-942bd40b6b01> in <module>
----> 1 for ThisType in log_progress(MyTypes, every=1):
      2     ThisType.solve()
      3     ThisType.initializeSim()
      4     ThisType.simulate()

NameError: name 'MyTypes' is not defined

Gentle Intro to HARK PerfForesightCRRA

# YOUR FIRST HANDS-ON EXERCISE!
# Fill in the value for "mPlotBottom" to plot the consumption function from the point where it is zero.
plotFuncs(PFexample.solution[0].cFunc,mPlotBottom,mPlotTop)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-9-3fb1a293d95e> in <module>
      1 # YOUR FIRST HANDS-ON EXERCISE!
      2 # Fill in the value for "mPlotBottom" to plot the consumption function from the point where it is zero.
----> 3 plotFuncs(PFexample.solution[0].cFunc,mPlotBottom,mPlotTop)

NameError: name 'mPlotBottom' is not defined

Gentle-Intro-To-HARK

# YOUR FIRST HANDS-ON EXERCISE!
# Fill in the value for "mPlotBottom" to plot the consumption function from the point where it is zero.
plotFuncs(PFexample.solution[0].cFunc,mPlotBottom,mPlotTop)

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-9-3fb1a293d95e> in <module>
      1 # YOUR FIRST HANDS-ON EXERCISE!
      2 # Fill in the value for "mPlotBottom" to plot the consumption function from the point where it is zero.
----> 3 plotFuncs(PFexample.solution[0].cFunc,mPlotBottom,mPlotTop)

NameError: name 'mPlotBottom' is not defined

Micro and Macro Implications of Very Impatient HHs

# Retrieve the MPC's
percentiles=np.linspace(0.1,0.9,9)
MPC_sim = np.concatenate([ThisType.MPCnow for ThisType in MyTypes])
MPCpercentiles_quarterly = getPercentiles(MPC_sim,percentiles=percentiles)
MPCpercentiles_annual = 1.0 - (1.0 - MPCpercentiles_quarterly)**4

print('The MPC at the 10th percentile of the distribution is '+str(decfmt2(MPCpercentiles_annual[0])))
print('The MPC at the 50th percentile of the distribution is '+str(decfmt2(MPCpercentiles_annual[4])))
print('The MPC at the 90th percentile of the distribution is '+str(decfmt2(MPCpercentiles_annual[-1])))
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-7-31e0bf7626bb> in <module>
      2 percentiles=np.linspace(0.1,0.9,9)
      3 MPC_sim = np.concatenate([ThisType.MPCnow for ThisType in MyTypes])
----> 4 MPCpercentiles_quarterly = getPercentiles(MPC_sim,percentiles=percentiles)
      5 MPCpercentiles_annual = 1.0 - (1.0 - MPCpercentiles_quarterly)**4
      6 

NameError: name 'getPercentiles' is not defined
@shaunagm
Copy link
Contributor

The first three errors appear to be due to the instructional nature of the notebooks. For instance, for the two errors where mplotbottom is undefined, a comment nearby says the user ought to fill in the variable with a value. I've created issue #47 to address this problem in presentation/documentation.

The final error is fixed by using version 0.10.1.dev1 from HARK on higher, so essentially a duplicate of #39.

Closing this now - thanks @thedatalass!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:medium
Projects
None yet
Development

No branches or pull requests

3 participants