GithubHelp home page GithubHelp logo

opensourceecon / bootcamp2019 Goto Github PK

View Code? Open in Web Editor NEW
85.0 85.0 99.0 266.26 MB

Repository of syllabi, lecture notes, Jupyter notebooks, code, and problem sets for OSE Lab Boot Camp 2019

TeX 0.05% Jupyter Notebook 98.47% Python 1.48%

bootcamp2019's People

Contributors

azinoma avatar fkubler avatar janertl avatar jdebacker avatar kerkphil avatar rebekahanne avatar rickecon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bootcamp2019's Issues

Fixing the error when running main.py

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:

  1. when you are logged onto the cluster, go to your home directory using cd (normally you should be there already, but a cd doesn't hurt).
  2. type vim .bashrc so that you are able to edit the bashrc file
  3. press i so that you are in insert mode.
  4. paste
    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.

Linear Systems - Sparse matrices

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?

Draw random numbers in C++

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'"

Plotting points and function

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

Trouble reading Pickle file & the wayout

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.

Midway Alias (an easier way to access Midway, for Mac)

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.

  1. Open a terminal window.
  2. Type vim ~/.bash_profile so that you open .bash_profile with vim.
  3. Type i so that you are in insert mode in vim.
  4. Add alias midway="ssh [email protected]" to your .bash_profile, replacing XXXX with the last four digits of your yubikey.
  5. Press escape to exit the insert mode.
  6. Type :wq to save your changes and exit vim.
  7. Type 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!)

Cannot run Dynare in MatLab

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'.

(Possible) minor error

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?

Errors in running install_SG.sh

@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

Dynare Pset

Hi @rickecon ! Could you please upload the notes and the Dynare code for Thomas Winberry's lecture?

Thanks!

Structural estimation resources

@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.

Gauss-Seidel

I think there is a typo in equation (16.3) for the Gauss-Seidel method in IterativeSolvers.pdf. The x-values of the second term in the brackets should be from the (k+1)-th iteration.
image
The current expression is actually the Jacobi method and so is equation (16.4) too.

Rust (1987) Python code

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

Sublime Text [or other editor] button in Mac Finder

@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.
image

  1. Open the Automator app on your Mac.
  2. Choose "Application" as the type of Automator document to create.
  3. Choose "Run AppleScript" from the Actions menu.
  4. Paste the following code script into the AppleScript window.
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
  1. In the Automator menu, select File, then Save..., then name the application "SublimeFinderButton.app", save it to the /Applications/ folder, and choose the file format of "Application".
  2. Open a finder window, navigate to the /Applications/ folder, press command and click and drag the new SublimeFinderButton.app application to the Finder bar.
  3. Finally, change the icon to the Sublime Text icon by right clicking on the "Applications/Sublime Text.app" and selecting Get info option. Click on the Sublime Text icon in the upper left of the Get info window. A blue outline will appear around it. Press command-c to copy the icon to clipboard. Then right click on your new "Applications/SublimeFinderButton.app" application and click on the Get info option. Click on the Automator icon in the upper left of the Get info window. A blue outline will appear around it. Press command-v to paste the Sublime Text icon.

Enjoy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.