opensourceecon / bootcamp2019 Goto Github PK
View Code? Open in Web Editor NEWRepository of syllabi, lecture notes, Jupyter notebooks, code, and problem sets for OSE Lab Boot Camp 2019
Repository of syllabi, lecture notes, Jupyter notebooks, code, and problem sets for OSE Lab Boot Camp 2019
Hi,
Simon and Bora figured out how to solve the error which appeared for most of us when running main.py.
A good way of solving it is:
cd
(normally you should be there already, but a cd
doesn't hurt).vim .bashrc
so that you are able to edit the bashrc filei
so that you are in insert mode.module load python
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
export IPOPT_DIR="/home/rccguest1410/OSE2019/day1/SparseGridCode/pyipopt_midway/Ipopt-3.12.5/build"
export LD_LIBRARY_PATH=$IPOPT_DIR/lib:$LD_LIBRARY_PATH
(you need to use ctrl + shift + v for pasting) and replace the four digits in rccguest1410
by the last four digits of your yubikey.
5. press escape to exit the insert mode
6. type :wq
to save the changes and exit vim.
Exit the terminal and log on again.
Now it should work.
Keep us posted if not.
scipy.optimize.broyden1 requires a parameter alpha representing the Jacobian of the function. What would be a good guess for it considering the asset pricing equations (5) and (7) from the script?
The Iterative Solver lab references a lab on linear systems that could be useful to solve problem 5. After looking for it in Bootcamp 2018, I could not find it. Is it in a specific folder?
I am having troubles using the "random" package in C++ to draw random numbers (for Monte Carlo). I get the following error message:
"error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options."
and "error: 'default_random_engine' is not a member of 'std'"
I've been timing functions so that I can easily play with the number of iterations to compute pi etc etc. On my laptop i use this implementation of the timer (https://www.geeksforgeeks.org/measure-execution-time-function-cpp/) but this does not work on the cluster. Thoughts?
I usually don't remember how to to write a symbol in LaTeX and I use this handwritten-symbol-recognition website:
http://detexify.kirelabs.org/classify.html
Maybe it'll be helpful to some of you!
I think there's a small typo in the specification of the Bellman equation in the heterogeneous agent problem set -- the interest rate should be multiplied with the current capital stock:
(Thanks to @mathyoufitzgerald for helping notice this).
Hi,
I found a shortcut to plotting gridpoints, we can use:
grid.plotPoints2D()
to plot the gridpoints and
grid.plotResponse2D()
to plot the response surface.
Best,
Marlon
While reading/loading the pickle files (for Kyle Orderbook problems), I was facing errors like:
UnpicklingError: the STRING opcode argument must be quoted
ValueError: could not convert string to float
After trying to debug that for a long time I finally got the solution. Apparently, I was getting the error because the files were saved in dos encoding which needed to be converted to unix encoding before the jupyter notebook could read the data.
The following code may be used to save the files in the required encoding/format:
original = "D:\Github\BootCamp2019\Econ\Wk5_Asset\data\THO"
destination = "D:\Github\BootCamp2019\ProblemSets\Econ\Data\THO"
content = ''
outsize = 0
with open(original, 'rb') as infile:
content = infile.read()
with open(destination, 'wb') as output:
for line in content.splitlines():
outsize += len(line) + 1
output.write(line + str.encode('\n'))
print("Done. Saved %s bytes." % (len(content)-outsize))
Here "original" is the filename with path of the original file & "destination" is the filename with path of the converted file.
I hope this would help those who are facing similar problems.
In some experiments Allen found out that a "-1" gives more reasonable behavior than "1".
Here are a few simple steps to edit your .bash_profile to create an alias to login into Midway2 more quickly. This is written for Mac, but these steps could be translated for Windows users as well.
vim ~/.bash_profile
so that you open .bash_profile with vim.i
so that you are in insert mode in vim.alias midway="ssh [email protected]"
to your .bash_profile, replacing XXXX with the last four digits of your yubikey.:wq
to save your changes and exit vim.source ~/.bash_profile
Now, you should just be able to type midway
into your terminal window, and you will be prompted to enter a password using your yubikey.
(Thanks @EricHuang49 for asking this question!)
I installed dynare, put the .mod file in a home directory but ML still doesn't recognize the command 'dynare'. Did anyone have similar issues?
>> dynare rbc_model --> Undefined function or variable 'dynare'.
Respond with your preference among Slack, Piazza, and GitHub issues for course questions and conversations.
In case you want a more interactive view, you can run jupyter notebook using the cluster. Instructions can be found:
https://rcc.uchicago.edu/docs/software/environments/python/index.html
Originally posted by @ozaltun in #21 (comment)
Hi everyone,
I thought Rick has talked about how to submit homeworks but I forgot it, do we just push them to our repos?
@rickecon
Many Thanks.
Hi,
I was looking at the function isvalid in the box.py file. There's a checking condition for roll:
if roll not in range(2, 13):
Shouldn't the range be range (1, 13) considering that eventually a single dice could be rolled in which case 1 is a legit roll number?
@rickecon @janertl @rebekahanne
While running ./install_SG.sh on the Midway cluster, the script terminates with the error below. As a result, I receive an error trying to run OSE2019/day1/SparseGridCode/analytical_examples/TASMANIAN_Python/OSE_example.py
Traceback (most recent call last):
File "setup.py", line 25, in
import numpy
ImportError: No module named numpy
Traceback (most recent call last):
File "setup.py", line 25, in
import numpy
ImportError: No module named numpy
Traceback (most recent call last):
File "hs071.py", line 6, in
import pyipopt
ImportError: No module named pyipopt
PYIPOPT is tested and installed
IPOPT and PYIPOPT is installed
I was working on Exercise 2 in the ? lab, and I forgot how to turn on Python. @azinoma
Hi @rickecon ! Could you please upload the notes and the Dynare code for Thomas Winberry's lecture?
Thanks!
@uta-bolt had a good question about structural estimation.
Estimation/Method of simulated moments: Are we only going to use models with calibrated parameters, or can we maybe have a problem set on estimating parameters with the method of simulated moments or so? I guess for one parameter it's not too hard, but for multiple parameters things seem more tricky.
In the past two years, we have had a one-week module on structural estimation, including notebooks and exercises on maximum likelihood estimation, generalized method of moments estimation, and simulated method of moments estimation. We took that module out this year because some of those topics will be covered in next week's Dynamic Structural Economics Summer School, mostly with regard to estimating dynamic discrete choice models.
I have some updated Jupyter notebooks on Maximum Likelihood Estimation, Generalized Method of Moments, and Simulated Method of Moments on my Notebooks GitHub repository. I also have some nice problem sets for these notebooks associated with my Structural Estimation class I teach at the University of Chicago.
What material do you have on machine learning?
Bertel Schjerning presented the Rust (1987) discrete choice dynamic programming problem of the Harold Zurcher bus engine replacement problem in his DSE Summer School lectures today (Monday, July 8). He was using MATLAB code. I found a nice notebook implementation of the Zurcher problem in this repository by Quentin Andre. Simply fork and clone the repository and open the notebook. I had to comment out the lines in the second cell setting the matplotlib
color parameters.
%matplotlib inline
figsize(12, 8)
pd.set_option("display.precision", 3)
np.set_printoptions(precision=4)
np.set_printoptions(suppress=True)
# s = json.load( open("./styles/bmh_matplotlibrc.json") )
# mpl.rcParams.update(s)
# def css_styling():
# styles = open("./styles/custom.css", "r").read()
# return HTML(styles)
# css_styling()
Everything works fine for me after commenting those last six lines.
@ani1231091 @AOzhegova @ashenk99 @azinoma @danielkdimitrov @ddhkim @EricHuang49 @isaacsantelli @JackShiqiLi @janertl @jeannesorin @joaopvalente @keertanavc @keiirizawa @kumar-ab @liu431 @lucamaria @MartinaFraschini @martinlibo @mathyoufitzgerald @ozaltun @rebekahanne @rmmomin @sofoniasalemu @terrytwu @tpellet @uta-bolt @Wouter-vdW @Xincheng-Qiu
@fediskhakov gave me a great Mac hack yesterday. This allows you to have a Sublime Text button in your Finder window on a Mac that you can either drag files to it to open them or click on it to open a blank file.
on run
set st2 to POSIX path of (path to application "Sublime Text")
set subl to st2 & "Contents/SharedSupport/bin/subl"
tell application "Finder"
copy selection to theSelected
set outputPathList to {}
repeat with anItem in theSelected
copy "'" & ((POSIX path of (anItem as alias)) as string) & "'" to end of outputPathList
end repeat
set AppleScript's text item delimiters to " "
set currentPath to outputPathList as string
set AppleScript's text item delimiters to ""
if currentPath is equal to "" then
set currentPath to "'" & (POSIX path of (target of front window as string)) & "'"
end if
end tell
tell current application to do shell script "'" & subl & "' -n " & currentPath
end run
/Applications/
folder, and choose the file format of "Application"./Applications/
folder, press command and click and drag the new SublimeFinderButton.app
application to the Finder bar.Enjoy
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.