├── .gitignore ├── .ipynb_checkpoints └── index-checkpoint.ipynb ├── LICENSE.txt ├── Readme.md ├── environment.yml ├── environment_full_working.yml ├── environment_small_working.yml ├── images ├── Depression.jpg ├── Ozak.jpg ├── QGIS │ ├── KEN-suit.tif │ ├── KEN-suit.tif.aux.xml │ ├── KEN-suit5.tif │ ├── KEN-suit5.tif.aux.xml │ ├── KEN-suit5cyl.tif │ ├── KEN-suit5cyl.tif.aux.xml │ ├── KEN.cpg │ ├── KEN.dbf │ ├── KEN.prj │ ├── KEN.qpj │ ├── KEN.shp │ ├── KEN.shx │ ├── KENcyl.cpg │ ├── KENcyl.dbf │ ├── KENcyl.prj │ ├── KENcyl.qpj │ ├── KENcyl.shp │ ├── KENcyl.shx │ └── QGIS-example.qgs ├── cropped-escher2-990x1804.jpg ├── favicomatic │ ├── code.txt │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ └── favicon.ico ├── favicomaticDepression │ ├── code.txt │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ └── favicon.ico ├── favicon.ico └── pics │ ├── GIS │ ├── .ipynb_checkpoints │ │ └── QGIS-Layer-menu-checkpoint.png │ ├── QGIS-Clipper.png │ ├── QGIS-Coordinates.png │ ├── QGIS-Cylindrical.png │ ├── QGIS-GADM.png │ ├── QGIS-KEN-Graduated-suit.png │ ├── QGIS-KEN-Raster.png │ ├── QGIS-KEN-Raster5.png │ ├── QGIS-Layer-menu.png │ ├── QGIS-MultiPart-SinglePart.png │ ├── QGIS-Query-KEN.png │ ├── QGIS-Query.png │ ├── QGIS-Raster-KEN.png │ ├── QGIS-SinglePart-MultiPart.png │ ├── QGIS-Style-Category.png │ ├── QGIS-Style-Field.png │ ├── QGIS-Style-Properties.png │ ├── QGIS-Zonal-Stats.png │ ├── QGIS-Zoom-Layer-Extent.png │ ├── QGIS-ZoomToCoordinates.png │ ├── QGIS-ZoomToCoordinatesPlugin.png │ ├── QGIS-add-raster-layer.png │ ├── QGIS-add-vector-layer.png │ ├── QGIS-attribute-table.png │ ├── QGIS-attribute-table2.png │ ├── QGIS-attribute-table3.png │ ├── QGIS-change-raster-size.png │ ├── QGIS-clip-KEN.png │ ├── QGIS-file-toolbar.png │ ├── QGIS-handtool.png │ ├── QGIS-identify-features.png │ ├── QGIS-main.png │ ├── QGIS-raster-color-scheme.png │ ├── QGIS-raster-with-color.png │ ├── QGIS-select-feature-attributes-button.png │ ├── QGIS-select-features-by-ISO.png │ ├── QGIS-select-features.png │ ├── QGIS-zoom-toolbar.png │ └── QGIS-zoomed-KEN.png │ ├── GRASS-logo.png │ ├── IPy_header.png │ ├── OSGEO-logo.png │ ├── QGis_Logo.png │ ├── fun │ ├── CalvinHobbesNew.jpg │ ├── CalvinHobbesProblem.png │ ├── Party.jpg │ ├── WhatShallWeDo.jpg │ └── homework.gif │ ├── marble-logo.png │ └── python-logo.png ├── index.ipynb ├── notebooks ├── .ipynb_checkpoints │ ├── DynamicProgramming-checkpoint.ipynb │ ├── Faster Computation with Numba-checkpoint.ipynb │ ├── GIS with Python 2-checkpoint.ipynb │ ├── GIS with Python 3-checkpoint.ipynb │ ├── GIS with Python-checkpoint.ipynb │ ├── GIS-checkpoint.ipynb │ ├── IntroPython-checkpoint.ipynb │ └── Penn World Table-checkpoint.ipynb ├── DynamicProgramming.ipynb ├── EconomicDataAnalysis.ipynb ├── Faster Computation with Numba.ipynb ├── Faster-Computation-with-Numba.ipynb ├── GIS with Python 2.ipynb ├── GIS with Python 3.ipynb ├── GIS with Python.ipynb ├── GIS-with-Python-2.ipynb ├── GIS-with-Python-3.ipynb ├── GIS-with-Python.ipynb ├── GIS.ipynb ├── IntroCGE.ipynb ├── IntroPython.ipynb ├── Penn World Table.ipynb ├── QGIS │ ├── KEN-suit.tif │ ├── KEN-suit.tif.aux.xml │ ├── KEN-suit5.tif │ ├── KEN-suit5.tif.aux.xml │ ├── KEN-suit5cyl.tif │ ├── KEN-suit5cyl.tif.aux.xml │ ├── KEN.cpg │ ├── KEN.dbf │ ├── KEN.prj │ ├── KEN.qpj │ ├── KEN.shp │ ├── KEN.shx │ ├── KENcyl.cpg │ ├── KENcyl.dbf │ ├── KENcyl.prj │ ├── KENcyl.qpj │ ├── KENcyl.shp │ ├── KENcyl.shx │ └── QGIS-example.qgs ├── Stata Notebook Example.ipynb ├── Stata in Python Notebook.ipynb ├── WDI │ ├── wdigdppc.csv │ └── wdimobile.xls ├── helloworld.py ├── ipympl.ipynb ├── optgrowthfuncs.py └── pics │ ├── GIS │ ├── QGIS-Clipper.png │ ├── QGIS-Coordinates.png │ ├── QGIS-Cylindrical.png │ ├── QGIS-GADM.png │ ├── QGIS-KEN-Graduated-suit.png │ ├── QGIS-KEN-Raster.png │ ├── QGIS-KEN-Raster5.png │ ├── QGIS-Layer-menu.png │ ├── QGIS-MultiPart-SinglePart.png │ ├── QGIS-Query-KEN.png │ ├── QGIS-Query.png │ ├── QGIS-Raster-KEN.png │ ├── QGIS-SinglePart-MultiPart.png │ ├── QGIS-Style-Category.png │ ├── QGIS-Style-Field.png │ ├── QGIS-Style-Properties.png │ ├── QGIS-Zonal-Stats.png │ ├── QGIS-Zoom-Layer-Extent.png │ ├── QGIS-ZoomToCoordinates.png │ ├── QGIS-ZoomToCoordinatesPlugin.png │ ├── QGIS-add-raster-layer.png │ ├── QGIS-add-vector-layer.png │ ├── QGIS-attribute-table.png │ ├── QGIS-attribute-table2.png │ ├── QGIS-attribute-table3.png │ ├── QGIS-change-raster-size.png │ ├── QGIS-clip-KEN.png │ ├── QGIS-file-toolbar.png │ ├── QGIS-handtool.png │ ├── QGIS-identify-features.png │ ├── QGIS-main.png │ ├── QGIS-raster-color-scheme.png │ ├── QGIS-raster-with-color.png │ ├── QGIS-select-feature-attributes-button.png │ ├── QGIS-select-features-by-ISO.png │ ├── QGIS-select-features.png │ ├── QGIS-zoom-toolbar.png │ └── QGIS-zoomed-KEN.png │ ├── GRASS-logo.png │ ├── IPy_header.png │ ├── OSGEO-logo.png │ ├── QGis_Logo.png │ ├── marble-logo.png │ └── python-logo.png ├── requirements.txt └── setup_GeoPython.sh /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .ipynb_checkpoints/index-checkpoint.ipynb 3 | -------------------------------------------------------------------------------- /.ipynb_checkpoints/index-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Computational Economics" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "## Binder startup notebook" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "From here you can open the other notebooks in this repository.\n", 22 | "\n", 23 | "# Notebooks\n", 24 | "\n", 25 | "* Notebook 1: [Introduction to Python](./notebooks/IntroPython.ipynb)\n", 26 | "* Notebook 1: [Introduction to CGE](./notebooks/IntroCGE.ipynb)\n", 27 | "* Notebook 3: [Dynamic Programming in Python](./notebooks/DynamicProgramming.ipynb)\n", 28 | "* Notebook 4: [Faster Dynamic Programming with Numba](\n", 29 | "./notebooks/Faster%20Computation%20with%20Numba.ipynb)\n", 30 | "* Notebook 5: [Economic Data Analysis](./notebooks/EconomicDataAnalysis.ipynb)\n", 31 | "* Notebook 6: [GIS with QGIS](./notebooks/GIS.ipynb)\n", 32 | "* Notebook 7: [GIS with Python (Geometries)](./notebooks/GIS%20with%20Python.ipynb)\n", 33 | "* Notebook 8: [GIS with Python 2 (Rasters)](./notebooks/GIS%20with%20Python%202.ipynb)\n", 34 | "* Notebook 9: [GIS with Python 3 (Data Munging)](./notebooks/GIS%20with%20Python%203.ipynb)\n", 35 | "* Notebook 10: [Stata Jupyter Notebooks (Stata kernel)](./notebooks/Stata%20Notebook%20Example.ipynb)\n", 36 | "* Notebook 11: [Stata in a Python Jupyter Notebook (ipystata)](/notebooks/Stata%20in%20a%20Python%20Notebook.ipynb)\n" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [] 45 | } 46 | ], 47 | "metadata": { 48 | "kernelspec": { 49 | "display_name": "Python 3 (ipykernel)", 50 | "language": "python", 51 | "name": "python3" 52 | }, 53 | "language_info": { 54 | "codemirror_mode": { 55 | "name": "ipython", 56 | "version": 3 57 | }, 58 | "file_extension": ".py", 59 | "mimetype": "text/x-python", 60 | "name": "python", 61 | "nbconvert_exporter": "python", 62 | "pygments_lexer": "ipython3", 63 | "version": "3.9.7" 64 | }, 65 | "nbTranslate": { 66 | "displayLangs": [ 67 | "*" 68 | ], 69 | "hotkey": "alt-t", 70 | "langInMainMenu": true, 71 | "sourceLang": "en", 72 | "targetLang": "fr", 73 | "useGoogleTranslate": true 74 | } 75 | }, 76 | "nbformat": 4, 77 | "nbformat_minor": 4 78 | } 79 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Basic Computational Economics using 2 | 3 | [![Binder](https://img.shields.io/badge/launch-JupyterLab-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJXWAAAAbXRSTlMAEBAQHx8gICAuLjAwMDw9PUBAQEpQUFBXV1hgYGBkcHBwcXl8gICAgoiIkJCQlJicnJ2goKCmqK+wsLC4usDAwMjP0NDQ1NbW3Nzg4ODi5+3v8PDw8/T09PX29vb39/f5+fr7+/z8/Pz9/v7+zczCxgAABC5JREFUeAHN1ul3k0UUBvCb1CTVpmpaitAGSLSpSuKCLWpbTKNJFGlcSMAFF63iUmRccNG6gLbuxkXU66JAUef/9LSpmXnyLr3T5AO/rzl5zj137p136BISy44fKJXuGN/d19PUfYeO67Znqtf2KH33Id1psXoFdW30sPZ1sMvs2D060AHqws4FHeJojLZqnw53cmfvg+XR8mC0OEjuxrXEkX5ydeVJLVIlV0e10PXk5k7dYeHu7Cj1j+49uKg7uLU61tGLw1lq27ugQYlclHC4bgv7VQ+TAyj5Zc/UjsPvs1sd5cWryWObtvWT2EPa4rtnWW3JkpjggEpbOsPr7F7EyNewtpBIslA7p43HCsnwooXTEc3UmPmCNn5lrqTJxy6nRmcavGZVt/3Da2pD5NHvsOHJCrdc1G2r3DITpU7yic7w/7Rxnjc0kt5GC4djiv2Sz3Fb2iEZg41/ddsFDoyuYrIkmFehz0HR2thPgQqMyQYb2OtB0WxsZ3BeG3+wpRb1vzl2UYBog8FfGhttFKjtAclnZYrRo9ryG9uG/FZQU4AEg8ZE9LjGMzTmqKXPLnlWVnIlQQTvxJf8ip7VgjZjyVPrjw1te5otM7RmP7xm+sK2Gv9I8Gi++BRbEkR9EBw8zRUcKxwp73xkaLiqQb+kGduJTNHG72zcW9LoJgqQxpP3/Tj//c3yB0tqzaml05/+orHLksVO+95kX7/7qgJvnjlrfr2Ggsyx0eoy9uPzN5SPd86aXggOsEKW2Prz7du3VID3/tzs/sSRs2w7ovVHKtjrX2pd7ZMlTxAYfBAL9jiDwfLkq55Tm7ifhMlTGPyCAs7RFRhn47JnlcB9RM5T97ASuZXIcVNuUDIndpDbdsfrqsOppeXl5Y+XVKdjFCTh+zGaVuj0d9zy05PPK3QzBamxdwtTCrzyg/2Rvf2EstUjordGwa/kx9mSJLr8mLLtCW8HHGJc2R5hS219IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/MsrQhltE7Ug0uFOzufJFE2PxBo/YAx8XPPdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC)](https://mybinder.org/v2/gh/ozak/CompEcon/master?urlpath=lab) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ozak/CompEcon/master) [![Binder](https://img.shields.io/badge/launch-notebook-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJXWAAAAbXRSTlMAEBAQHx8gICAuLjAwMDw9PUBAQEpQUFBXV1hgYGBkcHBwcXl8gICAgoiIkJCQlJicnJ2goKCmqK+wsLC4usDAwMjP0NDQ1NbW3Nzg4ODi5+3v8PDw8/T09PX29vb39/f5+fr7+/z8/Pz9/v7+zczCxgAABC5JREFUeAHN1ul3k0UUBvCb1CTVpmpaitAGSLSpSuKCLWpbTKNJFGlcSMAFF63iUmRccNG6gLbuxkXU66JAUef/9LSpmXnyLr3T5AO/rzl5zj137p136BISy44fKJXuGN/d19PUfYeO67Znqtf2KH33Id1psXoFdW30sPZ1sMvs2D060AHqws4FHeJojLZqnw53cmfvg+XR8mC0OEjuxrXEkX5ydeVJLVIlV0e10PXk5k7dYeHu7Cj1j+49uKg7uLU61tGLw1lq27ugQYlclHC4bgv7VQ+TAyj5Zc/UjsPvs1sd5cWryWObtvWT2EPa4rtnWW3JkpjggEpbOsPr7F7EyNewtpBIslA7p43HCsnwooXTEc3UmPmCNn5lrqTJxy6nRmcavGZVt/3Da2pD5NHvsOHJCrdc1G2r3DITpU7yic7w/7Rxnjc0kt5GC4djiv2Sz3Fb2iEZg41/ddsFDoyuYrIkmFehz0HR2thPgQqMyQYb2OtB0WxsZ3BeG3+wpRb1vzl2UYBog8FfGhttFKjtAclnZYrRo9ryG9uG/FZQU4AEg8ZE9LjGMzTmqKXPLnlWVnIlQQTvxJf8ip7VgjZjyVPrjw1te5otM7RmP7xm+sK2Gv9I8Gi++BRbEkR9EBw8zRUcKxwp73xkaLiqQb+kGduJTNHG72zcW9LoJgqQxpP3/Tj//c3yB0tqzaml05/+orHLksVO+95kX7/7qgJvnjlrfr2Ggsyx0eoy9uPzN5SPd86aXggOsEKW2Prz7du3VID3/tzs/sSRs2w7ovVHKtjrX2pd7ZMlTxAYfBAL9jiDwfLkq55Tm7ifhMlTGPyCAs7RFRhn47JnlcB9RM5T97ASuZXIcVNuUDIndpDbdsfrqsOppeXl5Y+XVKdjFCTh+zGaVuj0d9zy05PPK3QzBamxdwtTCrzyg/2Rvf2EstUjordGwa/kx9mSJLr8mLLtCW8HHGJc2R5hS219IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/MsrQhltE7Ug0uFOzufJFE2PxBo/YAx8XPPdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC 4 | )](https://mybinder.org/v2/gh/ozak/CompEcon/master?filepath=index.ipynb) 5 | 6 | by 7 | 8 | ### [Ömer Özak](http://omerozak.com) 9 | 10 | 11 | This repository contains notebooks I have written to help my first and second year Ph.D. students get started using Jupyter/IPython for doing Computational Economics, Economic Growth, Comparative Development, and Dynamic Macroeconomics in general. I highly recommend students to also check out [John Stachurski's website](http://johnstachurski.net/personal/edtc.html) and his book. 12 | 13 | These lectures are work in progress (and replicate the ones from my website [Economic Growth and Comparative Development Website](https://econgrowth.github.io)). Comments are welcome. 14 | 15 | --- 16 | # Basics 17 | 18 | In order to work with them on your computer, you need to: 19 | 20 | 1. Download the zipped file and extract its contents into a directory (preferably a subdirectory in your home directory). 21 | 2. Use your computer's terminal (OSX's terminal or [iterm2](http://www.iterm2.com/), Windows `cmd`) to go to the `notebooks` subdirectory in the directory where you extracted the files. E.g. if you extracted into `$HOME/CompEcon` then at the terminal prompt execute `cd ~/CompEcon/notebooks` 22 | 3. At the terminal prompt execute `jupyter notebook` 23 | 24 | Then a webpage should open with the notebooks. Click on the one you want to work with. 25 | 26 | It is obviously presupposed you have IPython installed. If that is not the case, then head over to my [Economic Growth and Comparative Development Website](https://econgrowth.github.io) and follow the [instructions](https://econgrowth.github.io/pages/Computation.html). 27 | 28 | --- 29 | # Try it out online 30 | 31 | If you want to try out some of the tools and play around without installing or if installation fails, use this [Jupyter Notebook binder](https://mybinder.org/v2/gh/ozak/CompEcon/master) or the [JupyterLab binder](https://mybinder.org/v2/gh/ozak/CompEcon/master?urlpath=lab/tree/). 32 | 33 | -> Enjoy! <- 34 | 35 | -------------------------------------------------------------------------------- /environment.yml: -------------------------------------------------------------------------------- 1 | # Full working 2 | name: GeoPython38env 3 | channels: 4 | - conda-forge 5 | # - numba 6 | # - rapidsai 7 | # - mro 8 | # - r 9 | # # - conda-forge/label/broken 10 | # - defaults 11 | dependencies: 12 | - coverage 13 | - docopt 14 | - fiona 15 | - gdal 16 | - matplotlib-base 17 | - matplotlib 18 | - numpy 19 | - pandas 20 | - python==3.8 21 | - pip 22 | - pyproj 23 | - scikit-image 24 | - geopandas 25 | - descartes 26 | - pysal 27 | - affine 28 | - rasterstats>=0.12 29 | - statsmodels 30 | - seaborn 31 | - geoplot 32 | - cython 33 | - datashader 34 | - datashape 35 | - georasters 36 | - pandas-datareader 37 | - pandana 38 | - pycountry 39 | - urbanaccess 40 | - r 41 | - r-base 42 | #- rstudio 43 | - r-irkernel 44 | - sympy 45 | - rpy2 46 | - r-tidyr 47 | - r-tibble 48 | - r-dplyr 49 | - scikit-learn 50 | - scipy 51 | - unidecode 52 | - urllib3 53 | - wikipedia 54 | - xlrd 55 | - jupyter_contrib_nbextensions 56 | - geopy 57 | - geographiclib 58 | # - geotiff 59 | # - imageio 60 | # - imagesize 61 | - ipykernel 62 | - ipyparallel 63 | - ipython 64 | - ipython_genutils 65 | - ipywidgets 66 | - jupyter 67 | - jupyterlab 68 | - kiwisolver 69 | - markdown 70 | - networkx 71 | - nose 72 | - numba 73 | - numpy 74 | - openpyxl 75 | # - pandasql 76 | # - rstudio 77 | - r-irkernel 78 | - sympy 79 | - rpy2 80 | - rasterio 81 | - r-tidyr 82 | - r-tibble 83 | - r-dplyr 84 | # - rise 85 | - scikit-allel 86 | - scikit-bio 87 | - scikit-image 88 | - scikit-learn 89 | - scipy 90 | - swifter 91 | - unidecode 92 | - urllib3 93 | - wikipedia 94 | - xlrd 95 | - asciitree 96 | - autopep8 97 | - babel 98 | - basemap 99 | - beautifulsoup4 100 | - blas 101 | # - blaze 102 | - bokeh 103 | - bzip2 104 | - cartopy 105 | - colorcet 106 | - curl 107 | - cytoolz 108 | - dask 109 | - dask-core 110 | - dill 111 | - docutils 112 | - earthengine-api 113 | - gensim 114 | - geotiff 115 | - google-api-python-client 116 | - google-auth 117 | - google-auth-httplib2 118 | - imageio 119 | - imagesize 120 | - pandoc 121 | - pandocfilters 122 | - pelican 123 | - pymc3 124 | - theano 125 | - camelot-py 126 | - html5lib 127 | - ghostscript 128 | - pip: 129 | - linearmodels 130 | - git+https://github.com/jeetsukumaran/DendroPy.git 131 | - git+https://github.com/dmsul/econtools 132 | - ecopy 133 | - facebook-business 134 | - facebook-sdk 135 | - fontawesome-markdown 136 | - geocoder 137 | - geonamescache 138 | - googledrivedownloader 139 | - googletrans 140 | - ipystata 141 | - isodate 142 | - isounidecode 143 | - latexcodec 144 | - ldpred 145 | - linearmodels 146 | - lingpy 147 | - mccabe 148 | - ordered-set 149 | - plinkio 150 | - pyarrow 151 | - pybtex 152 | - pycldf 153 | - pycountry 154 | - pydocstyle 155 | - pyface 156 | - pyflakes 157 | - pylatex 158 | - pyparsing 159 | - pyreadstat 160 | - pytest-cov 161 | - python-jsonrpc-server 162 | - python-language-server 163 | - pytrends 164 | - quilt 165 | - ratelim 166 | - readme-renderer 167 | - rfc3986 168 | - rope 169 | - simpledbf 170 | - simplejson 171 | - smartypants 172 | - snowballstemmer 173 | - snuggs 174 | - stata-kernel 175 | - tabulate 176 | - tex2ipy 177 | - texsoup 178 | - toolz 179 | - traits 180 | - traitsui 181 | - twine 182 | - typogrify 183 | - uritemplate 184 | - w3lib 185 | - webencodings 186 | - wrapt 187 | - xlwt 188 | - yapf 189 | - modin 190 | - stargazer 191 | - covid 192 | - COVID19Py 193 | - git+https://github.com/ozak/camelot 194 | -------------------------------------------------------------------------------- /environment_full_working.yml: -------------------------------------------------------------------------------- 1 | name: GeoPython38env 2 | channels: 3 | - conda-forge 4 | # - numba 5 | # - rapidsai 6 | # - mro 7 | - r 8 | # # - conda-forge/label/broken 9 | # - defaults 10 | dependencies: 11 | - coverage 12 | - docopt 13 | - fiona 14 | - gdal 15 | - matplotlib-base 16 | - matplotlib 17 | - numpy 18 | - pandas 19 | - python==3.8 20 | - pip 21 | - pyproj 22 | - scikit-image 23 | - geopandas 24 | - descartes 25 | - pysal 26 | - affine 27 | - rasterstats>=0.12 28 | - statsmodels 29 | - seaborn 30 | - geoplot 31 | - cython 32 | - datashader 33 | - datashape 34 | - georasters 35 | - pandas-datareader 36 | - pandana 37 | - pycountry 38 | - urbanaccess 39 | - r 40 | - r-base 41 | #- rstudio 42 | - r-irkernel 43 | - sympy 44 | - rpy2 45 | - r-tidyr 46 | - r-tibble 47 | - r-dplyr 48 | - scikit-learn 49 | - scipy 50 | - unidecode 51 | - urllib3 52 | - wikipedia 53 | - xlrd 54 | - jupyter_contrib_nbextensions 55 | - geopy 56 | - geographiclib 57 | # - geotiff 58 | # - imageio 59 | # - imagesize 60 | - ipykernel 61 | - ipyparallel 62 | - ipython 63 | - ipython_genutils 64 | - ipywidgets 65 | - jupyter 66 | - jupyterlab 67 | - kiwisolver 68 | - markdown 69 | - networkx 70 | - nose 71 | - numba 72 | - numpy 73 | - openpyxl 74 | # - pandasql 75 | - rstudio 76 | - r-irkernel 77 | - sympy 78 | - rpy2 79 | - rasterio 80 | - r-tidyr 81 | - r-tibble 82 | - r-dplyr 83 | - rise 84 | - scikit-allel 85 | - scikit-bio 86 | - scikit-image 87 | - scikit-learn 88 | - scipy 89 | - swifter 90 | - unidecode 91 | - urllib3 92 | - wikipedia 93 | - xlrd 94 | - asciitree 95 | - autopep8 96 | - babel 97 | - basemap 98 | - beautifulsoup4 99 | - blas 100 | # - blaze 101 | - bokeh 102 | - bzip2 103 | - cartopy 104 | - colorcet 105 | - curl 106 | - cytoolz 107 | - dask 108 | - dask-core 109 | - dill 110 | - docutils 111 | - earthengine-api 112 | - gensim 113 | - geotiff 114 | - google-api-python-client 115 | - google-auth 116 | - google-auth-httplib2 117 | - imageio 118 | - imagesize 119 | - pandoc 120 | - pandocfilters 121 | - pelican 122 | - pymc3 123 | - theano 124 | - camelot-py 125 | - html5lib 126 | - pip: 127 | - linearmodels 128 | - git+https://github.com/jeetsukumaran/DendroPy.git 129 | - git+https://github.com/dmsul/econtools 130 | - ecopy 131 | - facebook-business 132 | - facebook-sdk 133 | - fontawesome-markdown 134 | - geocoder 135 | - geonamescache 136 | - googledrivedownloader 137 | - googletrans 138 | - ipystata 139 | - isodate 140 | - isounidecode 141 | - latexcodec 142 | - ldpred 143 | - linearmodels 144 | - lingpy 145 | - mccabe 146 | - ordered-set 147 | - plinkio 148 | - pyarrow 149 | - pybtex 150 | - pycldf 151 | - pycountry 152 | - pydocstyle 153 | - pyface 154 | - pyflakes 155 | - pylatex 156 | - pyparsing 157 | - pyreadstat 158 | - pytest-cov 159 | - python-jsonrpc-server 160 | - python-language-server 161 | - pytrends 162 | - quilt 163 | - ratelim 164 | - readme-renderer 165 | - rfc3986 166 | - rope 167 | - simpledbf 168 | - simplejson 169 | - smartypants 170 | - snowballstemmer 171 | - snuggs 172 | - stata-kernel 173 | - tabulate 174 | - tex2ipy 175 | - texsoup 176 | - toolz 177 | - traits 178 | - traitsui 179 | - twine 180 | - typogrify 181 | - uritemplate 182 | - w3lib 183 | - webencodings 184 | - wrapt 185 | - xlwt 186 | - yapf 187 | - modin 188 | - stargazer 189 | - covid 190 | - COVID19Py 191 | -------------------------------------------------------------------------------- /environment_small_working.yml: -------------------------------------------------------------------------------- 1 | name: GeoPython38env 2 | channels: 3 | - conda-forge 4 | # - numba 5 | # - rapidsai 6 | # - mro 7 | # - r 8 | # - conda-forge/label/broken 9 | # - defaults 10 | dependencies: 11 | - python==3.8 12 | - pip 13 | - gdal 14 | - numpy 15 | - pandas 16 | - docopt 17 | - pyproj 18 | - scikit-image 19 | - matplotlib-base 20 | - coverage 21 | - fiona 22 | - geopandas 23 | - descartes 24 | - pysal 25 | - affine 26 | - rasterstats>=0.12 27 | - statsmodels 28 | - seaborn 29 | - geoplot 30 | - cython 31 | - datashader 32 | - datashape 33 | - georasters 34 | - pandas 35 | - pandas-datareader 36 | - pandana 37 | - pycountry 38 | - urbanaccess 39 | - r 40 | - r-base 41 | #- rstudio 42 | - r-irkernel 43 | - sympy 44 | - rpy2 45 | - r-tidyr 46 | - r-tibble 47 | - r-dplyr 48 | - seaborn 49 | - scikit-learn 50 | - scipy 51 | - unidecode 52 | - urllib3 53 | - wikipedia 54 | - xlrd 55 | - jupyter_contrib_nbextensions 56 | - pip: 57 | - linearmodels 58 | - isounidecode 59 | - geonamescache 60 | - geocoder 61 | - git+https://github.com/dmsul/econtools 62 | - ecopy 63 | - geonamescache 64 | - googledrivedownloader 65 | - googletrans 66 | - ipystata 67 | - isodate 68 | - isounidecode 69 | - ldpred 70 | - linearmodels 71 | - pyreadstat 72 | - pytrends 73 | - simpledbf 74 | - simplejson 75 | - smartypants 76 | - stata-kernel 77 | - tabulate 78 | -------------------------------------------------------------------------------- /images/Depression.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/Depression.jpg -------------------------------------------------------------------------------- /images/Ozak.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/Ozak.jpg -------------------------------------------------------------------------------- /images/QGIS/KEN-suit.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/QGIS/KEN-suit.tif -------------------------------------------------------------------------------- /images/QGIS/KEN-suit.tif.aux.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -0.001593749970197678 6 | 0.9705937318503857 7 | 304 8 | 0 9 | 0 10 | 112|0|1|8|9|3|3|1|7|4|3|3|2|1|1|6|3|4|1|2|0|3|2|2|3|2|3|2|2|2|2|0|0|2|0|2|2|0|1|2|0|0|2|5|0|2|0|1|2|1|0|0|1|1|0|0|0|3|0|1|1|0|1|1|0|1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|1|2|2|1|0|0|1|0|1|0|0|0|2|0|1|0|0|1|0|0|1|0|1|1|0|0|0|0|0|1|1|1|1|0|0|1|1|1|0|0|0|1|2|0|1|1|1|0|0|0|0|1|0|1|0|1|0|0|0|1|0|0|0|1|0|0|0|0|0|0|1|0|1|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|1|0|0|0|3|0|1|0|0|2|0|0|2|0|0|0|0|1|0|1|1|0|0|1|0|1|0|1|1|0|0|0|0|0|0|0|1|0|0|0|0|0|1|0|0|1|0|0|0|0|1|1|0|0|1|0|0|0|0|0|0|0|0|1|0|0|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|0|0|1|1|0|2|0|0|0|0|1|1|1|1|0|2|0|0|0|0|0|0|0|0|0|0|0|1 11 | 12 | 13 | 14 | 0.96899998188019 15 | 0.16194078946596 16 | 0 17 | 0.24824412913286 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /images/QGIS/KEN-suit5.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/QGIS/KEN-suit5.tif -------------------------------------------------------------------------------- /images/QGIS/KEN-suit5.tif.aux.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -0.0004914999902248383 6 | 0.9834914804399013 7 | 1000 8 | 0 9 | 0 10 | 4045|0|0|0|0|0|0|36|0|138|72|72|96|72|144|0|66|36|35|36|36|16|36|0|36|108|36|73|36|0|103|0|72|0|36|0|30|66|0|36|36|0|36|0|0|0|27|0|108|15|73|36|36|36|0|108|36|0|0|0|30|36|36|0|9|0|0|36|0|58|36|17|36|4|36|0|36|0|36|72|0|35|36|0|72|36|0|30|36|0|0|36|36|36|0|0|36|36|36|0|0|0|0|0|0|0|0|36|36|0|0|0|0|0|36|37|36|36|0|0|0|0|47|0|0|0|36|0|43|0|0|0|0|0|0|0|0|36|33|0|33|108|0|0|0|36|0|36|0|0|0|0|41|0|36|0|0|0|36|0|0|36|12|0|0|0|0|0|0|36|0|0|0|36|0|0|0|0|0|0|19|0|0|0|0|72|0|0|5|0|0|0|0|36|36|0|0|0|0|0|0|0|34|0|24|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|36|0|0|0|0|36|0|36|36|0|0|0|36|0|0|0|0|0|0|0|0|32|0|0|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|36|2|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|29|0|0|0|0|0|0|0|0|0|33|0|0|0|0|0|36|0|36|0|0|0|6|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|36|36|0|0|36|0|0|0|0|0|0|0|0|0|0|30|0|0|34|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|36|0|36|0|0|0|0|0|30|0|0|0|42|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|0|0|36|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|4|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|8|0|0|0|0|0|28|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|2|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|15|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|4|0|0|0|0|0|0|0|36|36|0|36|0|0|0|36|0|0|0|0|0|0|0|0|0|0|36|36|0|0|0|0|0|0|0|36|36|0|0|10|0|0|0|0|0|0|0|0|0|21|0|3|36|0|0|0|0|0|0|36|0|0|0|36|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|36|0|0|0|0|36|0|24|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|9|0|0|0|0|0|29|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|24|0|0|0|0|19|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0|34|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|36|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|36|0|0|0|36|0|0|36|0|0|0|0|0|0|22|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|32|0|0|0|0|0|0|0|0|0|0|0|4|0|13 11 | 12 | 13 | 14 | 0.98299998044968 15 | 0.15792968758441 16 | 0 17 | 0.24395116033584 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /images/QGIS/KEN-suit5cyl.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/QGIS/KEN-suit5cyl.tif -------------------------------------------------------------------------------- /images/QGIS/KEN-suit5cyl.tif.aux.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -0.0004914999902248383 6 | 0.9834914804399013 7 | 1000 8 | 0 9 | 0 10 | 4053|0|0|0|0|0|0|36|0|138|72|66|96|72|156|0|66|30|35|36|30|15|30|0|36|114|36|73|36|0|91|0|72|0|36|0|30|60|0|30|36|0|36|0|0|0|33|0|108|18|72|36|36|42|0|108|36|0|0|0|30|42|42|0|9|0|0|36|0|52|36|18|25|4|42|0|30|0|36|78|0|28|30|0|66|36|0|30|36|0|0|36|30|36|0|0|42|42|36|0|0|0|0|0|0|0|0|42|42|0|0|0|0|0|36|37|36|30|0|0|0|0|51|0|0|0|36|0|43|0|0|0|0|0|0|0|0|36|33|0|39|108|0|0|0|30|0|36|0|0|0|0|45|0|36|0|0|0|42|0|0|36|8|0|0|0|0|0|0|36|0|0|0|36|0|0|0|0|0|0|19|0|0|0|0|66|0|0|2|0|0|0|0|30|42|0|0|0|0|0|0|0|34|0|24|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|42|0|0|0|0|36|0|42|35|0|0|0|42|0|0|0|0|0|0|0|0|35|0|0|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|36|2|0|0|0|0|0|0|0|42|0|0|0|0|0|0|0|0|22|0|0|0|0|0|0|0|0|0|33|0|0|0|0|0|36|0|30|0|0|0|7|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|36|42|0|0|42|0|0|0|0|0|0|0|0|0|0|30|0|0|47|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|42|0|30|0|36|0|0|0|0|0|25|0|0|0|46|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|0|0|30|0|0|0|0|0|0|49|0|0|0|0|0|0|0|0|0|0|0|0|35|0|0|5|0|0|0|0|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|7|0|0|0|0|0|27|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|2|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|12|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|30|0|4|0|0|0|0|0|0|0|30|36|0|42|0|0|0|36|0|0|0|0|0|0|0|0|0|0|30|35|0|0|0|0|0|0|0|36|36|0|0|8|0|0|0|0|0|0|0|0|0|28|0|3|36|0|0|0|0|0|0|25|0|0|0|42|0|0|0|0|0|0|0|0|30|0|0|0|0|0|0|42|0|0|0|0|36|0|25|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|8|0|0|0|0|0|34|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|35|0|0|0|0|24|0|0|0|0|13|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|42|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|28|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|36|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|42|0|42|0|0|0|42|0|0|42|0|0|0|0|0|0|21|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|35|0|0|0|0|0|0|0|0|0|0|0|4|0|12 11 | 12 | 13 | 14 | 0.98299998044968 15 | 0.15792829250114 16 | 0 17 | 0.24391559512603 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /images/QGIS/KEN.cpg: -------------------------------------------------------------------------------- 1 | UTF-8 -------------------------------------------------------------------------------- /images/QGIS/KEN.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/QGIS/KEN.dbf -------------------------------------------------------------------------------- /images/QGIS/KEN.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] -------------------------------------------------------------------------------- /images/QGIS/KEN.qpj: -------------------------------------------------------------------------------- 1 | GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]] 2 | -------------------------------------------------------------------------------- /images/QGIS/KEN.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/QGIS/KEN.shp -------------------------------------------------------------------------------- /images/QGIS/KEN.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/QGIS/KEN.shx -------------------------------------------------------------------------------- /images/QGIS/KENcyl.cpg: -------------------------------------------------------------------------------- 1 | UTF-8 -------------------------------------------------------------------------------- /images/QGIS/KENcyl.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/QGIS/KENcyl.dbf -------------------------------------------------------------------------------- /images/QGIS/KENcyl.prj: -------------------------------------------------------------------------------- 1 | PROJCS["Cylindrical_Equal_Area",GEOGCS["GCS_WGS_1984",DATUM["D_unknown",SPHEROID["WGS84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Cylindrical_Equal_Area"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] -------------------------------------------------------------------------------- /images/QGIS/KENcyl.qpj: -------------------------------------------------------------------------------- 1 | PROJCS["unnamed",GEOGCS["WGS 84",DATUM["unknown",SPHEROID["WGS84",6378137,298.257223563],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Cylindrical_Equal_Area"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] 2 | -------------------------------------------------------------------------------- /images/QGIS/KENcyl.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/QGIS/KENcyl.shp -------------------------------------------------------------------------------- /images/QGIS/KENcyl.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/QGIS/KENcyl.shx -------------------------------------------------------------------------------- /images/cropped-escher2-990x1804.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/cropped-escher2-990x1804.jpg -------------------------------------------------------------------------------- /images/favicomatic/code.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /images/favicomatic/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/favicomatic/favicon-16x16.png -------------------------------------------------------------------------------- /images/favicomatic/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/favicomatic/favicon-32x32.png -------------------------------------------------------------------------------- /images/favicomatic/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/favicomatic/favicon.ico -------------------------------------------------------------------------------- /images/favicomaticDepression/code.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /images/favicomaticDepression/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/favicomaticDepression/favicon-16x16.png -------------------------------------------------------------------------------- /images/favicomaticDepression/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/favicomaticDepression/favicon-32x32.png -------------------------------------------------------------------------------- /images/favicomaticDepression/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/favicomaticDepression/favicon.ico -------------------------------------------------------------------------------- /images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/favicon.ico -------------------------------------------------------------------------------- /images/pics/GIS/.ipynb_checkpoints/QGIS-Layer-menu-checkpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/.ipynb_checkpoints/QGIS-Layer-menu-checkpoint.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-Clipper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-Clipper.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-Coordinates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-Coordinates.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-Cylindrical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-Cylindrical.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-GADM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-GADM.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-KEN-Graduated-suit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-KEN-Graduated-suit.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-KEN-Raster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-KEN-Raster.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-KEN-Raster5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-KEN-Raster5.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-Layer-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-Layer-menu.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-MultiPart-SinglePart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-MultiPart-SinglePart.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-Query-KEN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-Query-KEN.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-Query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-Query.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-Raster-KEN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-Raster-KEN.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-SinglePart-MultiPart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-SinglePart-MultiPart.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-Style-Category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-Style-Category.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-Style-Field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-Style-Field.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-Style-Properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-Style-Properties.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-Zonal-Stats.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-Zonal-Stats.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-Zoom-Layer-Extent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-Zoom-Layer-Extent.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-ZoomToCoordinates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-ZoomToCoordinates.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-ZoomToCoordinatesPlugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-ZoomToCoordinatesPlugin.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-add-raster-layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-add-raster-layer.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-add-vector-layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-add-vector-layer.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-attribute-table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-attribute-table.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-attribute-table2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-attribute-table2.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-attribute-table3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-attribute-table3.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-change-raster-size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-change-raster-size.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-clip-KEN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-clip-KEN.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-file-toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-file-toolbar.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-handtool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-handtool.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-identify-features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-identify-features.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-main.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-raster-color-scheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-raster-color-scheme.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-raster-with-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-raster-with-color.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-select-feature-attributes-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-select-feature-attributes-button.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-select-features-by-ISO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-select-features-by-ISO.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-select-features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-select-features.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-zoom-toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-zoom-toolbar.png -------------------------------------------------------------------------------- /images/pics/GIS/QGIS-zoomed-KEN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GIS/QGIS-zoomed-KEN.png -------------------------------------------------------------------------------- /images/pics/GRASS-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/GRASS-logo.png -------------------------------------------------------------------------------- /images/pics/IPy_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/IPy_header.png -------------------------------------------------------------------------------- /images/pics/OSGEO-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/OSGEO-logo.png -------------------------------------------------------------------------------- /images/pics/QGis_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/QGis_Logo.png -------------------------------------------------------------------------------- /images/pics/fun/CalvinHobbesNew.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/fun/CalvinHobbesNew.jpg -------------------------------------------------------------------------------- /images/pics/fun/CalvinHobbesProblem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/fun/CalvinHobbesProblem.png -------------------------------------------------------------------------------- /images/pics/fun/Party.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/fun/Party.jpg -------------------------------------------------------------------------------- /images/pics/fun/WhatShallWeDo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/fun/WhatShallWeDo.jpg -------------------------------------------------------------------------------- /images/pics/fun/homework.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/fun/homework.gif -------------------------------------------------------------------------------- /images/pics/marble-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/marble-logo.png -------------------------------------------------------------------------------- /images/pics/python-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/images/pics/python-logo.png -------------------------------------------------------------------------------- /index.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Computational Economics" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "## Binder startup notebook" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "From here you can open the other notebooks in this repository.\n", 22 | "\n", 23 | "# Notebooks\n", 24 | "\n", 25 | "* Notebook 1: [Introduction to Python](./notebooks/IntroPython.ipynb)\n", 26 | "* Notebook 1: [Introduction to CGE](./notebooks/IntroCGE.ipynb)\n", 27 | "* Notebook 3: [Dynamic Programming in Python](./notebooks/DynamicProgramming.ipynb)\n", 28 | "* Notebook 4: [Faster Dynamic Programming with Numba](\n", 29 | "./notebooks/Faster%20Computation%20with%20Numba.ipynb)\n", 30 | "* Notebook 5: [Economic Data Analysis](./notebooks/EconomicDataAnalysis.ipynb)\n", 31 | "* Notebook 6: [GIS with QGIS](./notebooks/GIS.ipynb)\n", 32 | "* Notebook 7: [GIS with Python (Geometries)](./notebooks/GIS%20with%20Python.ipynb)\n", 33 | "* Notebook 8: [GIS with Python 2 (Rasters)](./notebooks/GIS%20with%20Python%202.ipynb)\n", 34 | "* Notebook 9: [GIS with Python 3 (Data Munging)](./notebooks/GIS%20with%20Python%203.ipynb)\n", 35 | "* Notebook 10: [Stata Jupyter Notebooks (Stata kernel)](./notebooks/Stata%20Notebook%20Example.ipynb)\n", 36 | "* Notebook 11: [Stata in a Python Jupyter Notebook (ipystata)](/notebooks/Stata%20in%20a%20Python%20Notebook.ipynb)\n" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [] 45 | } 46 | ], 47 | "metadata": { 48 | "kernelspec": { 49 | "display_name": "Python 3 (ipykernel)", 50 | "language": "python", 51 | "name": "python3" 52 | }, 53 | "language_info": { 54 | "codemirror_mode": { 55 | "name": "ipython", 56 | "version": 3 57 | }, 58 | "file_extension": ".py", 59 | "mimetype": "text/x-python", 60 | "name": "python", 61 | "nbconvert_exporter": "python", 62 | "pygments_lexer": "ipython3", 63 | "version": "3.9.7" 64 | }, 65 | "nbTranslate": { 66 | "displayLangs": [ 67 | "*" 68 | ], 69 | "hotkey": "alt-t", 70 | "langInMainMenu": true, 71 | "sourceLang": "en", 72 | "targetLang": "fr", 73 | "useGoogleTranslate": true 74 | } 75 | }, 76 | "nbformat": 4, 77 | "nbformat_minor": 4 78 | } 79 | -------------------------------------------------------------------------------- /notebooks/.ipynb_checkpoints/DynamicProgramming-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Introduction to Dynamic Programming" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "We have studied the theory of dynamic programming in discrete time under certainty. Let's review what we know so far, so that we can start thinking about how to take to the computer." 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "## The Problem" 22 | ] 23 | }, 24 | { 25 | "cell_type": "markdown", 26 | "metadata": {}, 27 | "source": [ 28 | "We want to find a sequence $\\{x_t\\}_{t=0}^\\infty$ and a function $V^*:X\\to\\mathbb{R}$ such that \n", 29 | "\n", 30 | "$$V^{\\ast}\\left(x_{0}\\right)=\\sup\\limits _{\\left\\{ x_{t}\\right\\} _{t=0}^{\\infty}}\\sum\\limits _{t=0}^{\\infty}\\beta^{t}U(x_{t},x_{t+1})$$ \n", 31 | "\n", 32 | "subject to $x_{t+1}\\in G(x_{t})\\subseteq X\\subseteq\\mathbb{R}^K$, for all $t\\geq0$ and $x_0\\in\\mathbb{R}$ given. We assume $\\beta\\in(0,1)$.\n", 33 | "\n", 34 | "We have seen that we can analyze this problem by solving instead the related problem \n", 35 | "\n", 36 | "$$V(x)=\\sup\\limits _{y\\in G(x)}\\left\\{ U(x,y)+\\beta V(y)\\right\\} ,\\text{ for all }x\\in X.$$" 37 | ] 38 | }, 39 | { 40 | "cell_type": "markdown", 41 | "metadata": {}, 42 | "source": [ 43 | "## Basic Results" 44 | ] 45 | }, 46 | { 47 | "cell_type": "markdown", 48 | "metadata": {}, 49 | "source": [ 50 | "### Assumptions" 51 | ] 52 | }, 53 | { 54 | "cell_type": "markdown", 55 | "metadata": {}, 56 | "source": [ 57 | "1. $G\\left(x\\right)$ is nonempty for all $x\\in X$ ; and for all $x_{0}\\in X$ and $\\mathbf{x}\\in \\Phi (x_{0})$, $\\lim\\nolimits_{n\\rightarrow\\infty}\\sum_{t=0}^{n}\\beta^{t}U(x_{t},x_{t+1})$ exists and is finite.\n", 58 | "\n", 59 | "2. $X$ is a compact subset of $\\mathbb{R}^{K}$, $G$ is nonempty, compact-valued and continuous. Moreover, $U:\\mathbf{X}_{G}\\rightarrow\\mathbb{R}$ is continuous, where $\\mathbf{X}_{G}=\\left\\{ (x,y)\\in X\\times X:y\\in G(x)\\right\\}$\n", 60 | "\n", 61 | "3. $U$ is strictly concave and $G$ is convex\n", 62 | "\n", 63 | "4. For each $y\\in X$, $U(\\cdot,y)$ is strictly increasing in each of its first $K$ arguments, and $G$ is monotone in the sense that $x\\leq x^{\\prime}$ implies $G(x)\\subset G(x^{\\prime})$.\n", 64 | "\n", 65 | "5. $U$ is continuously differentiable on the interior of its domain $\\mathbf{X}_{G}$.\n", 66 | "\n", 67 | "6. Let $\\Phi (x_{t})=\\{\\{x_{s}\\}_{s=t}^{\\infty}:x_{s+1}\\in G(x_{s})\\text{, for }s=t,t+1,...\\}$ and assume that $\\lim_{t\\rightarrow\\infty}\\beta^{t}V\\left(x_{t}\\right)=0$ for all $\\left(x,x_{1},x_{2},...\\right)\\in \\Phi (x)$.\n", 68 | "\n", 69 | "If all of these conditions are satisfied, then we have the following" 70 | ] 71 | }, 72 | { 73 | "cell_type": "markdown", 74 | "metadata": {}, 75 | "source": [ 76 | "### Theorem" 77 | ] 78 | }, 79 | { 80 | "cell_type": "markdown", 81 | "metadata": {}, 82 | "source": [ 83 | "*There exists a unique (value) function $V^*(x_0)=V(x_0)$, which is continuous, strictly increasing, strictly concave, and differentiable. Also, there exists a unique path $\\{x^*_t\\}_{t=0}^\\infty$, which starting from the given $x_0$ attains the value $V^*(x_0)$. The path can be found through a unique continuous policy function $\\pi: X\\to X$ such that $x^*_{t+1}=\\pi(x^*_t)$. *" 84 | ] 85 | }, 86 | { 87 | "cell_type": "markdown", 88 | "metadata": {}, 89 | "source": [ 90 | "## Taking it to the computer" 91 | ] 92 | }, 93 | { 94 | "cell_type": "markdown", 95 | "metadata": {}, 96 | "source": [ 97 | "Ok. Now that we know the conditions for the existence and uniqueness (plus other characteristics) of our problem, how do we go about solving it?\n", 98 | "\n", 99 | "The idea is going to be simple and is based on what we saw when we proved the contraction mapping theorem and the proof of the previous theorem (Yes I know...we split this in various steps and intermediate results, which might have confused you). \n", 100 | "\n", 101 | "Remember that our Bellman Operator $T: C(X)\\to C(X)$ defined as \n", 102 | "\n", 103 | "$$T(V(x))\\equiv\\sup\\limits _{y\\in G(x)}\\left\\{ U(x,y)+\\beta V(y)\\right\\}$$\n", 104 | "\n", 105 | "assigns a continuous, strictly increasing, strictly concave function $T(V)$ to each continuous, increasing, and concave function $V$ defined on $X$. Since $T(V)$ is a contraction mapping, we know that if $V_0$ is any initial continuous, increasing, and concave function defined on $X$, then $T^n(V_0)\\to V^*$. This is precisely what we are going to do using the computer (well we will also do it by hand for a couple of examples)." 106 | ] 107 | }, 108 | { 109 | "cell_type": "markdown", 110 | "metadata": {}, 111 | "source": [ 112 | "### A first example" 113 | ] 114 | }, 115 | { 116 | "cell_type": "markdown", 117 | "metadata": {}, 118 | "source": [ 119 | "Assume we want to solve the following finite dimensional problem. \n", 120 | "\n", 121 | "An apple farmer wants to maximize her discounted sum of utilities from consuming special non-peroshable apples. She owns only one tree which each period produces $y_t\\in\\{0,1,\\ldots,ymax\\}=\\{y^i\\}_{i=0}^N$ apples, where $y_t=y^i$ with probability $p^i$. Each period she has to decide how many apples to pick and consume. If \n", 122 | "\n", 123 | "two choices, it can leave the market and make zero profits that period or stay and get a profit $\\pi$. If the firm stays in the market it must take the same decision next period. If it exits in one period it can never return." 124 | ] 125 | }, 126 | { 127 | "cell_type": "markdown", 128 | "metadata": {}, 129 | "source": [ 130 | "### Value function iteration" 131 | ] 132 | }, 133 | { 134 | "cell_type": "markdown", 135 | "metadata": {}, 136 | "source": [ 137 | "So, now that we have a strategy to tackle the problem, and you have learned some basic Python at [Code Academy](http://codeacademy.com) and IPython in our other [notebook](https://github.com/ozak/CompEcon/blob/master/notebooks/IntroPython.ipynb), we are ready to write some code and do some dynamic economic analysis.\n", 138 | "\n", 139 | "But before we start, there is one issue I want to highlight. Notice that our state space $X$ is not assumed to be finite, and clearly the fact that our functions are continuous imply that we cannot be in a finite problem. So how do we represent such an infinite object in a computer, which only has finite memory? The solution is to take an approximation to the function, what Stachurski (2009) calls a fitted function. There are various methods to approximate functions (see Judd (1998) for an excellent presentation). The simplest method is a linear interpolation, which is what we will use here. \n", 140 | "\n", 141 | "The idea behind linear interpolation is quite simple. Assume we want to approximate the function $V: X\\to X$, $X\\subseteq\\mathbb{R}$. The only thing we need is a finite set $\\{x_i\\}_{i=0}^N\\subseteq X$ for which we compute the value under $V$, i.e. we create the finite set of values $\\{V_i=V(x_i)\\}_{i=0}^N$. Then our approximate function $V$, $\\hat V$, will be defined as\n", 142 | "\n", 143 | "$$\\hat V(x)=V_{i-1}+\\frac{V_i-V_{i-1}}{x_i-x_{i-1}}(x-x_{i-1}) \\quad\\text{ if } x_{i-1}\\le x < x_i.$$\n", 144 | "\n", 145 | "In principle we could construct our own interpolation function, but [Scipy](http://www.scipy.org/) has already [optimized approximation algorithms](http://docs.scipy.org/doc/scipy/reference/interpolate.html), so let's use that package instead. Let's see what a linear interpolation of $\\sin(x)$ would look like." 146 | ] 147 | }, 148 | { 149 | "cell_type": "code", 150 | "execution_count": null, 151 | "metadata": { 152 | "collapsed": false 153 | }, 154 | "outputs": [], 155 | "source": [ 156 | "from __future__ import division\n", 157 | "%pylab --no-import-all\n", 158 | "%matplotlib inline\n", 159 | "from scipy import interp" 160 | ] 161 | }, 162 | { 163 | "cell_type": "code", 164 | "execution_count": null, 165 | "metadata": { 166 | "collapsed": false 167 | }, 168 | "outputs": [], 169 | "source": [ 170 | "interp?" 171 | ] 172 | }, 173 | { 174 | "cell_type": "code", 175 | "execution_count": null, 176 | "metadata": { 177 | "collapsed": false 178 | }, 179 | "outputs": [], 180 | "source": [ 181 | "x=np.linspace(0,np.pi,100)\n", 182 | "plt.figure(1)\n", 183 | "plt.plot(x,np.sin(x),label='Actual Function')\n", 184 | "for i in np.arange(3,11,2):\n", 185 | " plt.figure(1)\n", 186 | " xp=np.linspace(0,np.pi,i)\n", 187 | " yp=np.sin(xp)\n", 188 | " y=interp(x,xp,yp)\n", 189 | " plt.plot(x,y,label='Interpolation '+str(i))\n", 190 | " plt.figure(2)\n", 191 | " plt.title('Error with up to '+str(i)+' points in interpolation')\n", 192 | " plt.ylabel('Error')\n", 193 | " plt.plot(y-np.sin(x),label=str(i))\n", 194 | " plt.legend(loc=8)\n", 195 | "plt.figure(1)\n", 196 | "plt.legend(loc=8)\n", 197 | "plt.show()" 198 | ] 199 | }, 200 | { 201 | "cell_type": "markdown", 202 | "metadata": {}, 203 | "source": [ 204 | "Clearly the more points we have the better our approximation. But, more points means more computations and more time to get those approximations. Since we will be iterating over approximations, we might not want to use too many points, but be smart about the choice of points or we might want to use less points for a start and then increase the number of points once we have a good candidate solution to our fixed point problem.\n", 205 | "\n", 206 | "In order to make it easy to define interpolated functions, we define a new class of Python object" 207 | ] 208 | }, 209 | { 210 | "cell_type": "code", 211 | "execution_count": null, 212 | "metadata": { 213 | "collapsed": false 214 | }, 215 | "outputs": [], 216 | "source": [ 217 | "class LinInterp:\n", 218 | " \"Provides linear interpolation in one dimension.\"\n", 219 | "\n", 220 | " def __init__(self, X, Y):\n", 221 | " \"\"\"Parameters: X and Y are sequences or arrays\n", 222 | " containing the (x,y) interpolation points.\n", 223 | " \"\"\"\n", 224 | " self.X, self.Y = X, Y\n", 225 | "\n", 226 | " def __call__(self, z):\n", 227 | " \"\"\"Parameters: z is a number, sequence or array.\n", 228 | " This method makes an instance f of LinInterp callable,\n", 229 | " so f(z) returns the interpolation value(s) at z.\n", 230 | " \"\"\"\n", 231 | " if isinstance(z, int) or isinstance(z, float):\n", 232 | " return interp ([z], self.X, self.Y)[0]\n", 233 | " else:\n", 234 | " return interp(z, self.X, self.Y)" 235 | ] 236 | }, 237 | { 238 | "cell_type": "markdown", 239 | "metadata": {}, 240 | "source": [ 241 | "We can now define our interpolated sinus function as follows" 242 | ] 243 | }, 244 | { 245 | "cell_type": "code", 246 | "execution_count": null, 247 | "metadata": { 248 | "collapsed": false 249 | }, 250 | "outputs": [], 251 | "source": [ 252 | "xp=np.linspace(0,np.pi,10)\n", 253 | "yp=np.sin(xp)\n", 254 | "oursin = LinInterp(xp,yp)\n", 255 | "plt.plot(oursin(x));" 256 | ] 257 | }, 258 | { 259 | "cell_type": "markdown", 260 | "metadata": {}, 261 | "source": [ 262 | "### Optimal Growth" 263 | ] 264 | }, 265 | { 266 | "cell_type": "markdown", 267 | "metadata": {}, 268 | "source": [ 269 | "Let's start by computing the solution to an optimal growth problem, in which a social planner seeks to find paths $\\{c_t,k_t\\}$ such that\n", 270 | "\n", 271 | "\\begin{align}\n", 272 | "\\max_{\\{c_t,k_t\\}}&\\sum_{t=0}^{\\infty}\\beta^{t}u(c_{t})\\\\[.2cm]\n", 273 | "\\text{s.t.}&k_{t+1}\\leq f(k_{t})+(1-\\delta)k_{t}-c_{t}\\\\[.2cm]\n", 274 | "c_{t}\\geq0,&\\ k_{t}\\geq0,\\ k_{0}\\text{ is given}.\n", 275 | "\\end{align}\n", 276 | "\n", 277 | "As usual we assume that our utility function $u(\\cdot)$ and production function $f(\\cdot)$ are Neoclassical. Under these conditions we have seen that our problem satisfies the conditions of our previous theorem and thus we _know_ a unique solution exists." 278 | ] 279 | }, 280 | { 281 | "cell_type": "markdown", 282 | "metadata": {}, 283 | "source": [ 284 | "#### An example with analytical solution" 285 | ] 286 | }, 287 | { 288 | "cell_type": "markdown", 289 | "metadata": {}, 290 | "source": [ 291 | "Let's assume that $u(c)=\\ln(c)$, $f(k)=k^\\alpha$, and $\\delta=1$. For this case we have seen that the solution implies\n", 292 | "\n", 293 | "\\begin{align}\n", 294 | "&\\text{Value Function: } & V(k)=&\\frac{\\ln(1-\\alpha\\beta)}{1-\\beta}+\\frac{\\alpha\\beta\\ln(\\alpha\\beta)}{(1-\\alpha\\beta)(1-\\beta)}+\\frac{\\alpha}{1-\\alpha\\beta}\\ln(k)\\\\[.2cm]\n", 295 | "&\\text{Optimal Policy: } & \\pi\\left(k\\right)=&\\beta\\alpha k^{\\alpha} \\\\[.2cm]\n", 296 | "&\\text{Optimal Consumption Function: } & c=&\\left(1-\\beta\\alpha\\right)k^{\\alpha}\\\\[.2cm]\n", 297 | "\\end{align}\n", 298 | "\n", 299 | "We will use these to compare the solution found by iteration of the Value function described above. Copy the Python functions you had defined in the previous notebook into the cell below and define Python functions for the actual optimal solutions given above." 300 | ] 301 | }, 302 | { 303 | "cell_type": "code", 304 | "execution_count": null, 305 | "metadata": { 306 | "collapsed": false 307 | }, 308 | "outputs": [], 309 | "source": [ 310 | "%%file optgrowthfuncs.py\n", 311 | "def U(c,sigma=1):\n", 312 | " '''This function returns the value of utility when the CRRA\n", 313 | " coefficient is sigma. I.e. \n", 314 | " u(c,sigma)=(c**(1-sigma)-1)/(1-sigma) if sigma!=1 \n", 315 | " and \n", 316 | " u(c,sigma)=ln(c) if sigma==1\n", 317 | " Usage: u(c,sigma)\n", 318 | " '''\n", 319 | " if sigma!=1:\n", 320 | " u=(c**(1-sigma)-1)/(1-sigma)\n", 321 | " else:\n", 322 | " u=np.log(c)\n", 323 | " return u\n", 324 | "\n", 325 | "def F(K,L=1,alpha=.3,A=1):\n", 326 | " '''\n", 327 | " Cobb-Douglas production function\n", 328 | " F(K,L)=K^alpha L^(1-alpha)\n", 329 | " '''\n", 330 | " return K**alpha * L**(1-alpha)\n", 331 | "\n", 332 | "def Va(k,alpha=.3,beta=.9):\n", 333 | " ab=alpha*beta\n", 334 | " return np.log(1-ab)/(1-beta)+ab*np.log(ab)/((1-beta)*(1-ab))+alpha*np.log(k)/(1-ab)\n", 335 | "\n", 336 | "def opk(k,alpha=.3,beta=.9):\n", 337 | " return alpha*beta*k**alpha\n", 338 | "\n", 339 | "def opc(k,alpha=.3,beta=.9):\n", 340 | " return (1-alpha*beta)*k**alpha" 341 | ] 342 | }, 343 | { 344 | "cell_type": "code", 345 | "execution_count": null, 346 | "metadata": { 347 | "collapsed": false 348 | }, 349 | "outputs": [], 350 | "source": [ 351 | "%load optgrowthfuncs.py" 352 | ] 353 | }, 354 | { 355 | "cell_type": "code", 356 | "execution_count": null, 357 | "metadata": { 358 | "collapsed": false 359 | }, 360 | "outputs": [], 361 | "source": [ 362 | "def U(c,sigma=1):\n", 363 | " '''This function returns the value of utility when the CRRA\n", 364 | " coefficient is sigma. I.e. \n", 365 | " u(c,sigma)=(c**(1-sigma)-1)/(1-sigma) if sigma!=1 \n", 366 | " and \n", 367 | " u(c,sigma)=ln(c) if sigma==1\n", 368 | " Usage: u(c,sigma)\n", 369 | " '''\n", 370 | " if sigma!=1:\n", 371 | " u=(c**(1-sigma)-1)/(1-sigma)\n", 372 | " else:\n", 373 | " u=np.log(c)\n", 374 | " return u\n", 375 | "\n", 376 | "def F(K,L=1,alpha=.3,A=1):\n", 377 | " '''\n", 378 | " Cobb-Douglas production function\n", 379 | " F(K,L)=K^alpha L^(1-alpha)\n", 380 | " '''\n", 381 | " return K**alpha * L**(1-alpha)\n", 382 | "\n", 383 | "def Va(k,alpha=.3,beta=.9):\n", 384 | " ab=alpha*beta\n", 385 | " return np.log(1-ab)/(1-beta)+ab*np.log(ab)/((1-beta)*(1-ab))+alpha*np.log(k)/(1-ab)\n", 386 | "\n", 387 | "def opk(k,alpha=.3,beta=.9):\n", 388 | " return alpha*beta*k**alpha\n", 389 | "\n", 390 | "def opc(k,alpha=.3,beta=.9):\n", 391 | " return (1-alpha*beta)*k**alpha" 392 | ] 393 | }, 394 | { 395 | "cell_type": "markdown", 396 | "metadata": {}, 397 | "source": [ 398 | "Let's fix the value of the fundamental parameters so we can realize computations" 399 | ] 400 | }, 401 | { 402 | "cell_type": "code", 403 | "execution_count": null, 404 | "metadata": { 405 | "collapsed": false 406 | }, 407 | "outputs": [], 408 | "source": [ 409 | "alpha=.3\n", 410 | "beta=.9\n", 411 | "sigma=1\n", 412 | "delta=1" 413 | ] 414 | }, 415 | { 416 | "cell_type": "markdown", 417 | "metadata": {}, 418 | "source": [ 419 | "Now let's focus on the Value function iteration:" 420 | ] 421 | }, 422 | { 423 | "cell_type": "code", 424 | "execution_count": null, 425 | "metadata": { 426 | "collapsed": false 427 | }, 428 | "outputs": [], 429 | "source": [ 430 | "# Grid of values for state variable over which function will be approximated\n", 431 | "gridmin, gridmax, gridsize = 0.1, 5, 300\n", 432 | "grid = np.linspace(gridmin, gridmax**1e-1, gridsize)**10" 433 | ] 434 | }, 435 | { 436 | "cell_type": "markdown", 437 | "metadata": {}, 438 | "source": [ 439 | "Here we have created a grid on $[gridmin,gridmax]$ that has a number of points given by `gridsize`. Since we know that the Value functions is stricly concave, our grid has more points closer to zero than farther away" 440 | ] 441 | }, 442 | { 443 | "cell_type": "code", 444 | "execution_count": null, 445 | "metadata": { 446 | "collapsed": false 447 | }, 448 | "outputs": [], 449 | "source": [ 450 | "plt.hist(grid,bins=50);\n", 451 | "plt.xlabel('State Space');\n", 452 | "plt.ylabel('Number of Points');" 453 | ] 454 | }, 455 | { 456 | "cell_type": "code", 457 | "execution_count": null, 458 | "metadata": { 459 | "collapsed": false 460 | }, 461 | "outputs": [], 462 | "source": [ 463 | "plt.plot(grid,grid,'r.');\n", 464 | "plt.title('State Space Grid');" 465 | ] 466 | }, 467 | { 468 | "cell_type": "markdown", 469 | "metadata": {}, 470 | "source": [ 471 | "Now we need a function, which for given $V_0$ solves \n", 472 | "\n", 473 | "$$\\sup\\limits _{y\\in G(x)}\\left\\{ U(x,y)+\\beta V(y)\\right\\}.$$\n", 474 | "\n", 475 | "Let's use one of Scipy's optimizing routines" 476 | ] 477 | }, 478 | { 479 | "cell_type": "code", 480 | "execution_count": null, 481 | "metadata": { 482 | "collapsed": false 483 | }, 484 | "outputs": [], 485 | "source": [ 486 | "from scipy.optimize import fminbound\n", 487 | "fminbound?" 488 | ] 489 | }, 490 | { 491 | "cell_type": "markdown", 492 | "metadata": {}, 493 | "source": [ 494 | "Since `fminbound` returns \n", 495 | "\n", 496 | "$$\\arg\\min\\limits _{y\\in [\\underline x,\\bar x]}\\left\\{ U(x,y)+\\beta V(y)\\right\\}$$\n", 497 | "\n", 498 | "we have to either replace our objective function for its negative or, better yet, define a function that uses `fminbound` and returns the maximum and the maximizer" 499 | ] 500 | }, 501 | { 502 | "cell_type": "code", 503 | "execution_count": null, 504 | "metadata": { 505 | "collapsed": false 506 | }, 507 | "outputs": [], 508 | "source": [ 509 | "# Maximize function V on interval [a,b]\n", 510 | "def maximum(V, a, b):\n", 511 | " return float(V(fminbound(lambda x: -V(x), a, b)))\n", 512 | "# Return Maximizer of function V on interval [a,b]\n", 513 | "def maximizer(V, a, b):\n", 514 | " return float(fminbound(lambda x: -V(x), a, b))" 515 | ] 516 | }, 517 | { 518 | "cell_type": "markdown", 519 | "metadata": {}, 520 | "source": [ 521 | "#### Note\n", 522 | "\n", 523 | "We could have included other parameters to pass to our `maximizer` and `maximum` functions, e.g. to allow us to manipulate the options of `fminbound`" 524 | ] 525 | }, 526 | { 527 | "cell_type": "markdown", 528 | "metadata": {}, 529 | "source": [ 530 | "#### The Bellman Operator" 531 | ] 532 | }, 533 | { 534 | "cell_type": "code", 535 | "execution_count": null, 536 | "metadata": { 537 | "collapsed": false 538 | }, 539 | "outputs": [], 540 | "source": [ 541 | "# The following two functions are used to find the optimal policy and value functions using value function iteration\n", 542 | "# Bellman Operator\n", 543 | "def bellman(w):\n", 544 | " \"\"\"The approximate Bellman operator.\n", 545 | " Parameters: w is a LinInterp object (i.e., a \n", 546 | " callable object which acts pointwise on arrays).\n", 547 | " Returns: An instance of LinInterp that represents the optimal operator.\n", 548 | " w is a function defined on the state space.\n", 549 | " \"\"\"\n", 550 | " vals = []\n", 551 | " for k in grid:\n", 552 | " kmax=F(k,alpha=alpha)\n", 553 | " h = lambda kp: U(kmax + (1-delta) * k - kp,sigma) + beta * w(kp)\n", 554 | " vals.append(maximum(h, 0, kmax))\n", 555 | " return LinInterp(grid, vals)\n", 556 | "\n", 557 | "# Optimal policy\n", 558 | "def policy(w):\n", 559 | " \"\"\"\n", 560 | " For each function w, policy(w) returns the function that maximizes the \n", 561 | " RHS of the Bellman operator.\n", 562 | " Replace w for the Value function to get optimal policy.\n", 563 | " The approximate optimal policy operator w-greedy (See Stachurski (2009)). \n", 564 | " Parameters: w is a LinInterp object (i.e., a \n", 565 | " callable object which acts pointwise on arrays).\n", 566 | " Returns: An instance of LinInterp that captures the optimal policy.\n", 567 | " \"\"\"\n", 568 | " vals = []\n", 569 | " for k in grid:\n", 570 | " kmax=F(k,alpha=alpha)\n", 571 | " h = lambda kp: U(kmax + (1-delta) * k - kp,sigma) + beta * w(kp)\n", 572 | " vals.append(maximizer(h, 0, kmax))\n", 573 | " return LinInterp(grid, vals)\n" 574 | ] 575 | }, 576 | { 577 | "cell_type": "markdown", 578 | "metadata": {}, 579 | "source": [ 580 | "Given a linear interpolation of our guess for the Value function, $V_0=w$, the first function returns a `LinInterp` object, which is the linear interpolation of the function generated by the Bellman Operator on the finite set of points on the grid. The second function returns what Stachurski (2009) calls a _w-greedy_ policy, i.e. the function that maximizes the RHS of the Bellman Operator.\n", 581 | "\n", 582 | "Now we are ready to work on the iteration" 583 | ] 584 | }, 585 | { 586 | "cell_type": "code", 587 | "execution_count": null, 588 | "metadata": { 589 | "collapsed": false 590 | }, 591 | "outputs": [], 592 | "source": [ 593 | "# Parameters for the optimization procedures\n", 594 | "count=0\n", 595 | "maxiter=1000\n", 596 | "tol=1e-6\n", 597 | "print 'tol=%f' % tol" 598 | ] 599 | }, 600 | { 601 | "cell_type": "markdown", 602 | "metadata": {}, 603 | "source": [ 604 | "Our initial guess $V_0$" 605 | ] 606 | }, 607 | { 608 | "cell_type": "code", 609 | "execution_count": null, 610 | "metadata": { 611 | "collapsed": false 612 | }, 613 | "outputs": [], 614 | "source": [ 615 | "V0=LinInterp(grid,U(grid))\n", 616 | "plt.figure(1)\n", 617 | "plt.plot(grid,V0(grid), label='V'+str(count));\n", 618 | "plt.plot(grid,Va(grid), label='Actual');\n", 619 | "plt.legend(loc=6);" 620 | ] 621 | }, 622 | { 623 | "cell_type": "markdown", 624 | "metadata": {}, 625 | "source": [ 626 | "After one interation" 627 | ] 628 | }, 629 | { 630 | "cell_type": "code", 631 | "execution_count": null, 632 | "metadata": { 633 | "collapsed": false 634 | }, 635 | "outputs": [], 636 | "source": [ 637 | "plt.plot(grid,V0(grid), label='V'+str(count));\n", 638 | "count+=1\n", 639 | "V0=bellman(V0)\n", 640 | "plt.figure(1)\n", 641 | "plt.plot(grid,V0(grid), label='V'+str(count));\n", 642 | "plt.plot(grid,Va(grid), label='Actual');\n", 643 | "plt.legend(loc=6);\n", 644 | "plt.show();" 645 | ] 646 | }, 647 | { 648 | "cell_type": "markdown", 649 | "metadata": {}, 650 | "source": [ 651 | "Doing it by hand is too slow..let's automate this process" 652 | ] 653 | }, 654 | { 655 | "cell_type": "code", 656 | "execution_count": null, 657 | "metadata": { 658 | "collapsed": false 659 | }, 660 | "outputs": [], 661 | "source": [ 662 | "fig, ax = plt.subplots()\n", 663 | "ax.set_xlim(grid.min(), grid.max())\n", 664 | "ax.plot(grid,Va(grid), label='Actual', color='k', lw=2, alpha=0.6);\n", 665 | "\n", 666 | "count=0\n", 667 | "maxiter=200\n", 668 | "tol=1e-6\n", 669 | "while count\n", 49 | "\n", 50 | " \n", 51 | " \n", 52 | " \n", 53 | " \n", 54 | " \n", 55 | " \n", 56 | " \n", 57 | " \n", 58 | " \n", 59 | " \n", 60 | " \n", 61 | " \n", 62 | " \n", 63 | " \n", 64 | " \n", 65 | " \n", 66 | " \n", 67 | " \n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | " \n", 218 | " \n", 219 | " \n", 220 | " \n", 221 | " \n", 222 | " \n", 223 | " \n", 224 | " \n", 225 | " \n", 226 | " \n", 227 | " \n", 228 | " \n", 229 | " \n", 230 | " \n", 231 | " \n", 232 | " \n", 233 | " \n", 234 | " \n", 235 | " \n", 236 | " \n", 237 | " \n", 238 | " \n", 239 | " \n", 240 | " \n", 241 | " \n", 242 | " \n", 243 | " \n", 244 | " \n", 245 | " \n", 246 | " \n", 247 | " \n", 248 | " \n", 249 | " \n", 250 | " \n", 251 | " \n", 252 | " \n", 253 | " \n", 254 | " \n", 255 | " \n", 256 | " \n", 257 | " \n", 258 | " \n", 259 | " \n", 260 | " \n", 261 | " \n", 262 | " \n", 263 | " \n", 264 | " \n", 265 | " \n", 266 | " \n", 267 | " \n", 268 | " \n", 269 | " \n", 270 | " \n", 271 | " \n", 272 | " \n", 273 | " \n", 274 | " \n", 275 | " \n", 276 | " \n", 277 | " \n", 278 | " \n", 279 | " \n", 280 | " \n", 281 | " \n", 282 | " \n", 283 | " \n", 284 | " \n", 285 | " \n", 286 | " \n", 287 | " \n", 288 | " \n", 289 | " \n", 290 | " \n", 291 | " \n", 292 | " \n", 293 | " \n", 294 | " \n", 295 | " \n", 296 | " \n", 297 | " \n", 298 | " \n", 299 | " \n", 300 | " \n", 301 | " \n", 302 | " \n", 303 | " \n", 304 | " \n", 305 | " \n", 306 | " \n", 307 | " \n", 308 | " \n", 309 | " \n", 310 | " \n", 311 | " \n", 312 | " \n", 313 | " \n", 314 | " \n", 315 | " \n", 316 | " \n", 317 | " \n", 318 | " \n", 319 | " \n", 320 | " \n", 321 | " \n", 322 | " \n", 323 | " \n", 324 | " \n", 325 | " \n", 326 | " \n", 327 | " \n", 328 | " \n", 329 | "
Variable nameVariable definition
0 Identifier variables NaN
1 countrycode 3-letter ISO country code
2 country Country name
3 currency_unit Currency unit
4 year Year
5 NaN NaN
6 Real GDP, employment and population levels NaN
7 rgdpe Expenditure-side real GDP at chained PPPs (in ...
8 rgdpo Output-side real GDP at chained PPPs (in mil. ...
9 pop Population (in millions)
10 emp Number of persons engaged (in millions)
11 avh Average annual hours worked by persons engaged
12 hc Index of human capital per person, based on ye...
13 NaN NaN
14 Current price GDP, capital and TFP NaN
15 cgdpe Expenditure-side real GDP at current PPPs (in ...
16 cgdpo Output-side real GDP at current PPPs (in mil. ...
17 ck Capital stock at current PPPs (in mil. 2005US$)
18 ctfp TFP level at current PPPs (USA=1)
19 NaN NaN
20 National accounts-based variables NaN
21 rgdpna Real GDP at constant 2005 national prices (in ...
22 rkna Capital stock at constant 2005 national prices...
23 rtfpna TFP at constant national prices (2005=1)
24 labsh Share of labour compensation in GDP at current...
25 NaN NaN
26 Exchange rates and GDP price levels NaN
27 xr Exchange rate, national currency/USD (market+e...
28 pl_gdpe Price level of CGDPe (PPP/XR), price level of ...
29 pl_gdpo Price level of CGDPo (PPP/XR), price level of...
30 NaN NaN
31 Data information variables NaN
32 i_cig 0/1/2: relative price data for consumption, in...
33 i_xm 0/1/2: relative price data for exports and imp...
34 i_xr 0/1: the exchange rate is market-based (0) or ...
35 i_outlier 0/1: the observation on pl_gdpe or pl_gdpo is ...
36 cor_exp Correlation between expenditure shares of the ...
37 statcap Statistical capacity indicator (source: World ...
38 NaN NaN
39 Shares in CGDPo NaN
40 csh_c Share of household consumption at current PPPs
41 csh_i Share of gross capital formation at current PPPs
42 csh_g Share of government consumption at current PPPs
43 csh_x Share of merchandise exports at current PPPs
44 csh_m Share of merchandise imports at current PPPs
45 csh_r Share of residual trade and GDP statistical di...
46 NaN NaN
47 Price levels, expenditure categories and capital NaN
48 pl_c Price level of household consumption, price l...
49 pl_i Price level of capital formation, price level...
50 pl_g Price level of government consumption, price ...
51 pl_x Price level of exports, price level of USA GDP...
52 pl_m Price level of imports, price level of USA GDP...
53 pl_k Price level of the capital stock, price level ...
\n", 330 | "" 331 | ], 332 | "text/plain": [ 333 | " Variable name \\\n", 334 | "0 Identifier variables \n", 335 | "1 countrycode \n", 336 | "2 country \n", 337 | "3 currency_unit \n", 338 | "4 year \n", 339 | "5 NaN \n", 340 | "6 Real GDP, employment and population levels \n", 341 | "7 rgdpe \n", 342 | "8 rgdpo \n", 343 | "9 pop \n", 344 | "10 emp \n", 345 | "11 avh \n", 346 | "12 hc \n", 347 | "13 NaN \n", 348 | "14 Current price GDP, capital and TFP \n", 349 | "15 cgdpe \n", 350 | "16 cgdpo \n", 351 | "17 ck \n", 352 | "18 ctfp \n", 353 | "19 NaN \n", 354 | "20 National accounts-based variables \n", 355 | "21 rgdpna \n", 356 | "22 rkna \n", 357 | "23 rtfpna \n", 358 | "24 labsh \n", 359 | "25 NaN \n", 360 | "26 Exchange rates and GDP price levels \n", 361 | "27 xr \n", 362 | "28 pl_gdpe \n", 363 | "29 pl_gdpo \n", 364 | "30 NaN \n", 365 | "31 Data information variables \n", 366 | "32 i_cig \n", 367 | "33 i_xm \n", 368 | "34 i_xr \n", 369 | "35 i_outlier \n", 370 | "36 cor_exp \n", 371 | "37 statcap \n", 372 | "38 NaN \n", 373 | "39 Shares in CGDPo \n", 374 | "40 csh_c \n", 375 | "41 csh_i \n", 376 | "42 csh_g \n", 377 | "43 csh_x \n", 378 | "44 csh_m \n", 379 | "45 csh_r \n", 380 | "46 NaN \n", 381 | "47 Price levels, expenditure categories and capital \n", 382 | "48 pl_c \n", 383 | "49 pl_i \n", 384 | "50 pl_g \n", 385 | "51 pl_x \n", 386 | "52 pl_m \n", 387 | "53 pl_k \n", 388 | "\n", 389 | " Variable definition \n", 390 | "0 NaN \n", 391 | "1 3-letter ISO country code \n", 392 | "2 Country name \n", 393 | "3 Currency unit \n", 394 | "4 Year \n", 395 | "5 NaN \n", 396 | "6 NaN \n", 397 | "7 Expenditure-side real GDP at chained PPPs (in ... \n", 398 | "8 Output-side real GDP at chained PPPs (in mil. ... \n", 399 | "9 Population (in millions) \n", 400 | "10 Number of persons engaged (in millions) \n", 401 | "11 Average annual hours worked by persons engaged \n", 402 | "12 Index of human capital per person, based on ye... \n", 403 | "13 NaN \n", 404 | "14 NaN \n", 405 | "15 Expenditure-side real GDP at current PPPs (in ... \n", 406 | "16 Output-side real GDP at current PPPs (in mil. ... \n", 407 | "17 Capital stock at current PPPs (in mil. 2005US$) \n", 408 | "18 TFP level at current PPPs (USA=1) \n", 409 | "19 NaN \n", 410 | "20 NaN \n", 411 | "21 Real GDP at constant 2005 national prices (in ... \n", 412 | "22 Capital stock at constant 2005 national prices... \n", 413 | "23 TFP at constant national prices (2005=1) \n", 414 | "24 Share of labour compensation in GDP at current... \n", 415 | "25 NaN \n", 416 | "26 NaN \n", 417 | "27 Exchange rate, national currency/USD (market+e... \n", 418 | "28 Price level of CGDPe (PPP/XR), price level of ... \n", 419 | "29 Price level of CGDPo (PPP/XR), price level of... \n", 420 | "30 NaN \n", 421 | "31 NaN \n", 422 | "32 0/1/2: relative price data for consumption, in... \n", 423 | "33 0/1/2: relative price data for exports and imp... \n", 424 | "34 0/1: the exchange rate is market-based (0) or ... \n", 425 | "35 0/1: the observation on pl_gdpe or pl_gdpo is ... \n", 426 | "36 Correlation between expenditure shares of the ... \n", 427 | "37 Statistical capacity indicator (source: World ... \n", 428 | "38 NaN \n", 429 | "39 NaN \n", 430 | "40 Share of household consumption at current PPPs \n", 431 | "41 Share of gross capital formation at current PPPs \n", 432 | "42 Share of government consumption at current PPPs \n", 433 | "43 Share of merchandise exports at current PPPs \n", 434 | "44 Share of merchandise imports at current PPPs \n", 435 | "45 Share of residual trade and GDP statistical di... \n", 436 | "46 NaN \n", 437 | "47 NaN \n", 438 | "48 Price level of household consumption, price l... \n", 439 | "49 Price level of capital formation, price level... \n", 440 | "50 Price level of government consumption, price ... \n", 441 | "51 Price level of exports, price level of USA GDP... \n", 442 | "52 Price level of imports, price level of USA GDP... \n", 443 | "53 Price level of the capital stock, price level ... " 444 | ] 445 | }, 446 | "execution_count": 4, 447 | "metadata": {}, 448 | "output_type": "execute_result" 449 | } 450 | ], 451 | "source": [ 452 | "df" 453 | ] 454 | } 455 | ], 456 | "metadata": { 457 | "kernelspec": { 458 | "display_name": "Python 2", 459 | "language": "python", 460 | "name": "python2" 461 | } 462 | }, 463 | "nbformat": 4, 464 | "nbformat_minor": 0 465 | } 466 | -------------------------------------------------------------------------------- /notebooks/IntroPython.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "user_expressions": [] 7 | }, 8 | "source": [ 9 | "# Introduction to \"Python\" and \"IPython\" using \"Jupyter\"" 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "metadata": { 15 | "user_expressions": [] 16 | }, 17 | "source": [ 18 | "**Python** is a powerful and easy to use programming language. It has a large community of developers and given its open source nature, you can find many solutions, scripts, and help all over the web. It is easy to learn and code, and faster than other high-level programming languages...and did I mention it is _free_ because it is **open-source** \n", 19 | "\n", 20 | "**IPython** is a very powerful extension to Python that provides:\n", 21 | "Powerful interactive shells (terminal, Qt-based and Notebooks based on [Jupyter](http://jupyter.org/)).\n", 22 | "\n", 23 | "* A browser-based notebook with support for code, text, mathematical expressions, inline plots and other rich media.\n", 24 | "* Support for interactive data visualization and use of GUI toolkits.\n", 25 | "* Flexible, embeddable interpreters to load into your own projects.\n", 26 | "* Easy to use, high performance tools for parallel computing.\n", 27 | "\n", 28 | "**Jupyter** is an open-source project that provides open-standards, and services for interactive computing across dozens of programming languages, including ``Python``, ``R``, ``Stata`` and many others used by economists." 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "metadata": { 34 | "user_expressions": [] 35 | }, 36 | "source": [ 37 | "# Getting Python, IPython, R, and Jupyter" 38 | ] 39 | }, 40 | { 41 | "cell_type": "markdown", 42 | "metadata": { 43 | "tags": [], 44 | "user_expressions": [] 45 | }, 46 | "source": [ 47 | "You can download and install ``Python`` and its packages for free for your computer from [Python.org](http:www.python.org). While this is the official site, which offers the basic installer and you can try do add any packages you require yourself, a much easier approach, which is almost foolproof is to use [Continuum Anaconda](https://www.continuum.io/downloads) or [Enthought Canopy](https://www.enthought.com/products/canopy). Both of these distributions offer academic licenses ([Canopy](https://www.enthought.com/products/canopy/academic/)), which allow you to use a larger set of packages. Similarly, you can download ``R`` from the [r-project](https://www.r-project.org/) website. \n", 48 | "\n", 49 | "I personally have switched to using [Continuum Anaconda](https://www.continuum.io/downloads) since it make installing all the packages and software I use much easier. You can follow the instructions below or better yet follow the instructions on the [Computation Page](https://econgrowth.github.io/pages/Computation.html) of my [Economic Growth and Comparative Development Course](https://econgrowth.github.io/).\n", 50 | "\n", 51 | "\n", 52 | "## Installing (I)Python & Jupyter\n", 53 | "The easiest and most convenient way to install a working version of IPython with all the required packages and tools is using [Continuum's Anaconda Distribution](https://www.anaconda.com/distribution/). You can install following the instructions in that website, or if you can just run [this script (Mac/Linux)](https://www.dropbox.com/s/6st528ethbkmvv2/CondaInstall.sh?dl=0). After installing the latest version of Anaconda, add the ``Anaconda/bin`` directory to your ``PATH`` variable. \n", 54 | "\n", 55 | "To create an environment useful for these notebooks, in your terminal execute\n", 56 | "\n", 57 | "```bash\n", 58 | "conda create --name GeoPython3env -c conda-forge -c r -c mro --override-channels python=3.9 georasters geopandas pandas spatialpandas statsmodels xlrd networkx ipykernel ipyparallel ipython ipython_genutils ipywidgets jupyter jupyterlab kiwisolver matplotlib-base matplotlib scikit-image scikit-learn scipy seaborn geoplot geopy geotiff pycountry nb_conda_kernels stata_kernel nltk\n", 59 | "```\n", 60 | "\n", 61 | "This should create an environment with most of the packages we need. We can always install others down the road.\n", 62 | "\n", 63 | "To start using one of the environment you will need to exectute the following command\n", 64 | "\n", 65 | "```bash\n", 66 | "source activate GeoPython3env\n", 67 | "```\n" 68 | ] 69 | }, 70 | { 71 | "cell_type": "markdown", 72 | "metadata": { 73 | "user_expressions": [] 74 | }, 75 | "source": [ 76 | "#### Note\n", 77 | "\n", 78 | "I assume you have followed the steps above and have installed ``Anaconda``. Everything that is done should work on any distribution that has the required packages, since the Python scripts should run (in principle) on any of these distributions. \n", 79 | "\n", 80 | "We will use IPython as our computing environment." 81 | ] 82 | }, 83 | { 84 | "cell_type": "markdown", 85 | "metadata": { 86 | "user_expressions": [] 87 | }, 88 | "source": [ 89 | "## Let's get started" 90 | ] 91 | }, 92 | { 93 | "cell_type": "markdown", 94 | "metadata": { 95 | "user_expressions": [] 96 | }, 97 | "source": [ 98 | "Once you have your Python distribution installed you'll be ready to start working. You have various options:\n", 99 | "\n", 100 | "* Open the ``Canopy`` program and work there\n", 101 | "* Open ``Anaconda Navigator`` and open one of the apps from there (`python`, `ipython`, `jupyter console`, `jupyter notebook`, `jupyter lab`, ``R``, `Stata` \n", 102 | "* From the Terminal prompt (command-line in Windows) execute one of the following commands:\n", 103 | " - `ipython`\n", 104 | " - `jupyter console`\n", 105 | " - `jupyter qtconsole`\n", 106 | " - `jupyter notebook`\n", 107 | " - `jupyter lab`\n", 108 | "\n", 109 | "While theses last are all using IPython, each has its advantages and disadvantages. You should play with them to get a better feeling of which you want to use for which purpose. In my own research I usually use a text editor ([TextMate](http://macromates.com/), [Atom](https://atom.io/), [Sublime](http://www.sublimetext.com/)) and the `jupyter qtconsole` or the ``jupyter notebook``. To see the power of ``Jupter notebooks`` (see this excellent and in-depth [presentation](http://youtu.be/xe_ATRmw0KM) by its creators). As you will see, this might prove an excellent environment to do research, homework, replicate papers, etc." 110 | ] 111 | }, 112 | { 113 | "cell_type": "markdown", 114 | "metadata": { 115 | "user_expressions": [] 116 | }, 117 | "source": [ 118 | "#### Note\n", 119 | "\n", 120 | "You can pass some additional commands to `ipython` in order to change colors and rendering of plots. I usually use `jupyter qtconsole --color=linux --pylab=inline`. You can create profiles to manage many options within `IPython` and `JuPyter`." 121 | ] 122 | }, 123 | { 124 | "cell_type": "markdown", 125 | "metadata": { 126 | "user_expressions": [] 127 | }, 128 | "source": [ 129 | "# First steps" 130 | ] 131 | }, 132 | { 133 | "cell_type": "markdown", 134 | "metadata": { 135 | "user_expressions": [] 136 | }, 137 | "source": [ 138 | "Let's start by running some simple commands at the prompt to do some simple computations." 139 | ] 140 | }, 141 | { 142 | "cell_type": "code", 143 | "execution_count": null, 144 | "metadata": {}, 145 | "outputs": [], 146 | "source": [ 147 | "1+1-2" 148 | ] 149 | }, 150 | { 151 | "cell_type": "code", 152 | "execution_count": null, 153 | "metadata": {}, 154 | "outputs": [], 155 | "source": [ 156 | "3*2" 157 | ] 158 | }, 159 | { 160 | "cell_type": "code", 161 | "execution_count": null, 162 | "metadata": {}, 163 | "outputs": [], 164 | "source": [ 165 | "3**2" 166 | ] 167 | }, 168 | { 169 | "cell_type": "code", 170 | "execution_count": null, 171 | "metadata": {}, 172 | "outputs": [], 173 | "source": [ 174 | "-1**2" 175 | ] 176 | }, 177 | { 178 | "cell_type": "code", 179 | "execution_count": null, 180 | "metadata": {}, 181 | "outputs": [], 182 | "source": [ 183 | "3*(3-2)" 184 | ] 185 | }, 186 | { 187 | "cell_type": "code", 188 | "execution_count": null, 189 | "metadata": {}, 190 | "outputs": [], 191 | "source": [ 192 | "3*3-2" 193 | ] 194 | }, 195 | { 196 | "cell_type": "markdown", 197 | "metadata": { 198 | "user_expressions": [] 199 | }, 200 | "source": [ 201 | "Notice that Python obeys the usual orders for operators, so exponentiation before multiplication/division, etc." 202 | ] 203 | }, 204 | { 205 | "cell_type": "code", 206 | "execution_count": null, 207 | "metadata": {}, 208 | "outputs": [], 209 | "source": [ 210 | "1/2" 211 | ] 212 | }, 213 | { 214 | "cell_type": "markdown", 215 | "metadata": { 216 | "user_expressions": [] 217 | }, 218 | "source": [ 219 | "If you are in `Python 2.7` you will notice that this answer is wrong if $1,2\\in\\mathbb{R}$, but Python thinks they are integers, so it forces and integer. In order to have a more natural behavior of division we need" 220 | ] 221 | }, 222 | { 223 | "cell_type": "code", 224 | "execution_count": null, 225 | "metadata": {}, 226 | "outputs": [], 227 | "source": [ 228 | "from __future__ import division\n", 229 | "1/2" 230 | ] 231 | }, 232 | { 233 | "cell_type": "markdown", 234 | "metadata": { 235 | "user_expressions": [] 236 | }, 237 | "source": [ 238 | "#### Note\n", 239 | "It is a good idea to include this among the packages to be imported by default" 240 | ] 241 | }, 242 | { 243 | "cell_type": "markdown", 244 | "metadata": { 245 | "user_expressions": [] 246 | }, 247 | "source": [ 248 | "### Getting help" 249 | ] 250 | }, 251 | { 252 | "cell_type": "markdown", 253 | "metadata": { 254 | "user_expressions": [] 255 | }, 256 | "source": [ 257 | "So what else can we do? Where do we start if we are new? You can use `?` or `help()` to get help." 258 | ] 259 | }, 260 | { 261 | "cell_type": "code", 262 | "execution_count": null, 263 | "metadata": {}, 264 | "outputs": [], 265 | "source": [ 266 | "?" 267 | ] 268 | }, 269 | { 270 | "cell_type": "code", 271 | "execution_count": null, 272 | "metadata": {}, 273 | "outputs": [], 274 | "source": [ 275 | "help()" 276 | ] 277 | }, 278 | { 279 | "cell_type": "markdown", 280 | "metadata": {}, 281 | "source": [ 282 | "If you want information about a command, say `mycommand` you can use `help(mycommand)`, `mycommand?` or `mycommand??` to get information about how it is used or even see its code." 283 | ] 284 | }, 285 | { 286 | "cell_type": "code", 287 | "execution_count": null, 288 | "metadata": {}, 289 | "outputs": [], 290 | "source": [ 291 | "help(sum)" 292 | ] 293 | }, 294 | { 295 | "cell_type": "code", 296 | "execution_count": null, 297 | "metadata": {}, 298 | "outputs": [], 299 | "source": [ 300 | "sum?" 301 | ] 302 | }, 303 | { 304 | "cell_type": "code", 305 | "execution_count": null, 306 | "metadata": {}, 307 | "outputs": [], 308 | "source": [ 309 | "sum??" 310 | ] 311 | }, 312 | { 313 | "cell_type": "markdown", 314 | "metadata": { 315 | "user_expressions": [] 316 | }, 317 | "source": [ 318 | "#### Variables, strings, and other objects" 319 | ] 320 | }, 321 | { 322 | "cell_type": "markdown", 323 | "metadata": { 324 | "user_expressions": [] 325 | }, 326 | "source": [ 327 | "We can print information" 328 | ] 329 | }, 330 | { 331 | "cell_type": "code", 332 | "execution_count": null, 333 | "metadata": {}, 334 | "outputs": [], 335 | "source": [ 336 | "print('Hello World!')" 337 | ] 338 | }, 339 | { 340 | "cell_type": "markdown", 341 | "metadata": { 342 | "user_expressions": [] 343 | }, 344 | "source": [ 345 | "We can also create variables, which can be of various types" 346 | ] 347 | }, 348 | { 349 | "cell_type": "code", 350 | "execution_count": null, 351 | "metadata": {}, 352 | "outputs": [], 353 | "source": [ 354 | "a = 1\n", 355 | "b = 2\n", 356 | "a+b" 357 | ] 358 | }, 359 | { 360 | "cell_type": "markdown", 361 | "metadata": { 362 | "user_expressions": [] 363 | }, 364 | "source": [ 365 | "`a` and `b` now hold numerical values we can use for computing" 366 | ] 367 | }, 368 | { 369 | "cell_type": "code", 370 | "execution_count": null, 371 | "metadata": {}, 372 | "outputs": [], 373 | "source": [ 374 | "c = [1, 2]\n", 375 | "d = [[1, 2], [3, 4]]\n", 376 | "print('c=%s' % c)\n", 377 | "print('d=%s' % d)" 378 | ] 379 | }, 380 | { 381 | "cell_type": "markdown", 382 | "metadata": { 383 | "user_expressions": [] 384 | }, 385 | "source": [ 386 | "Notice that we have used `%s` and `%` to let Python know we are passing a string to the print function.\n", 387 | "\n", 388 | "What kind of variables are `c` and `d`? They look like vectors and matrices, but..." 389 | ] 390 | }, 391 | { 392 | "cell_type": "code", 393 | "execution_count": null, 394 | "metadata": {}, 395 | "outputs": [], 396 | "source": [ 397 | "print(' a * c = %s' % (a * c))\n", 398 | "print(' b * d = %s' % (b * d))" 399 | ] 400 | }, 401 | { 402 | "cell_type": "code", 403 | "execution_count": null, 404 | "metadata": {}, 405 | "outputs": [], 406 | "source": [ 407 | "c*d" 408 | ] 409 | }, 410 | { 411 | "cell_type": "markdown", 412 | "metadata": {}, 413 | "source": [ 414 | "Actually, Python does not have vectors or matrices directly available. Instead it has lists, sets, arrays, etc., each with its own set of operations. We defined `c` and `d` as list objects" 415 | ] 416 | }, 417 | { 418 | "cell_type": "code", 419 | "execution_count": null, 420 | "metadata": {}, 421 | "outputs": [], 422 | "source": [ 423 | "type(c)" 424 | ] 425 | }, 426 | { 427 | "cell_type": "code", 428 | "execution_count": null, 429 | "metadata": {}, 430 | "outputs": [], 431 | "source": [ 432 | "type(d)" 433 | ] 434 | }, 435 | { 436 | "cell_type": "code", 437 | "execution_count": null, 438 | "metadata": {}, 439 | "outputs": [], 440 | "source": [ 441 | "type(a)" 442 | ] 443 | }, 444 | { 445 | "cell_type": "markdown", 446 | "metadata": { 447 | "user_expressions": [] 448 | }, 449 | "source": [ 450 | "Luckily Python has a powerful package for numerical computing called [Numpy](http://www.numpy.org/). " 451 | ] 452 | }, 453 | { 454 | "cell_type": "markdown", 455 | "metadata": { 456 | "user_expressions": [] 457 | }, 458 | "source": [ 459 | "### Extending Python's Functionality with Packages" 460 | ] 461 | }, 462 | { 463 | "cell_type": "markdown", 464 | "metadata": { 465 | "tags": [], 466 | "user_expressions": [] 467 | }, 468 | "source": [ 469 | "In order to use a package in Python or IPython, say `mypackage`, you need to import it, by executing \n", 470 | " \n", 471 | " import mypackage\n", 472 | "\n", 473 | "After executing this command, you will have access to the functions and objects defined in `mypackage`. For example, if `mypackage` has a function `squared` that takes a real number `x` and computes its square, we can use this function by calling `mypackage.squared(x)`. Since the name of some packages might be too long, your can give them a nickname by importing them instead as\n", 474 | " \n", 475 | " import mypackage as myp\n", 476 | "\n", 477 | "so now we could compute the square of `x` by calling `myp.squared(x)`.\n", 478 | "\n", 479 | "We will see various packages that will be useful to do computations, statistics, plots, etc.\n", 480 | "\n", 481 | "IPython has a command that imports Numpy and Matplotlib (Python's main plotting package). Numpy is imported as `np` and Matplotlib as `plt`. One could import these by hand by executing\n", 482 | "\n", 483 | " import numpy as np\n", 484 | " import matplotlib as plt\n", 485 | " \n", 486 | "but the creators of IPython have optimized the interaction between these packages by running the following command:\n", 487 | "\n", 488 | " %pylab" 489 | ] 490 | }, 491 | { 492 | "cell_type": "code", 493 | "execution_count": null, 494 | "metadata": {}, 495 | "outputs": [], 496 | "source": [ 497 | "%pylab?" 498 | ] 499 | }, 500 | { 501 | "cell_type": "markdown", 502 | "metadata": { 503 | "tags": [], 504 | "user_expressions": [] 505 | }, 506 | "source": [ 507 | "I do recommend using the `--no-import-all` option in order to ensure you do not contaminate the namespace. Instead it might be best to use\n", 508 | " \n", 509 | " %pylab --no-import-all\n", 510 | " %matplotlib" 511 | ] 512 | }, 513 | { 514 | "cell_type": "code", 515 | "execution_count": null, 516 | "metadata": {}, 517 | "outputs": [], 518 | "source": [ 519 | "%matplotlib?" 520 | ] 521 | }, 522 | { 523 | "cell_type": "code", 524 | "execution_count": null, 525 | "metadata": {}, 526 | "outputs": [], 527 | "source": [ 528 | "%pylab --no-import-all\n", 529 | "%matplotlib inline" 530 | ] 531 | }, 532 | { 533 | "cell_type": "code", 534 | "execution_count": null, 535 | "metadata": {}, 536 | "outputs": [], 537 | "source": [ 538 | "np?" 539 | ] 540 | }, 541 | { 542 | "cell_type": "markdown", 543 | "metadata": { 544 | "user_expressions": [] 545 | }, 546 | "source": [ 547 | "Let us now recreate `c` and `d`, but as Numpy arrays instead." 548 | ] 549 | }, 550 | { 551 | "cell_type": "code", 552 | "execution_count": null, 553 | "metadata": {}, 554 | "outputs": [], 555 | "source": [ 556 | "ca = np.array(c)\n", 557 | "da = np.array(d)\n", 558 | "print('c = %s' % c)\n", 559 | "print('d = %s' % d)\n", 560 | "print('ca = %s' % ca)\n", 561 | "print('da = %s' % da)" 562 | ] 563 | }, 564 | { 565 | "cell_type": "markdown", 566 | "metadata": { 567 | "user_expressions": [] 568 | }, 569 | "source": [ 570 | "We could have created them as matrices intead. Again how you want to cerate them depends on what you will be doing with them. See here for an explanation of the differences between Numpy arrays and matrices." 571 | ] 572 | }, 573 | { 574 | "cell_type": "code", 575 | "execution_count": null, 576 | "metadata": {}, 577 | "outputs": [], 578 | "source": [ 579 | "cm = np.matrix(c)\n", 580 | "dm = np.matrix(d)\n", 581 | "print('cm = %s' % cm)\n", 582 | "print('dm = %s' % dm)" 583 | ] 584 | }, 585 | { 586 | "cell_type": "markdown", 587 | "metadata": { 588 | "user_expressions": [] 589 | }, 590 | "source": [ 591 | "Let's see some information about these...(this is a good moment to show tab completion...a _wonderful_ feature of IPython, which is not avalable if Python)" 592 | ] 593 | }, 594 | { 595 | "cell_type": "code", 596 | "execution_count": null, 597 | "metadata": {}, 598 | "outputs": [], 599 | "source": [ 600 | "cm.shape" 601 | ] 602 | }, 603 | { 604 | "cell_type": "code", 605 | "execution_count": null, 606 | "metadata": {}, 607 | "outputs": [], 608 | "source": [ 609 | "ca.shape" 610 | ] 611 | }, 612 | { 613 | "cell_type": "code", 614 | "execution_count": null, 615 | "metadata": {}, 616 | "outputs": [], 617 | "source": [ 618 | "dm.diagonal()" 619 | ] 620 | }, 621 | { 622 | "cell_type": "code", 623 | "execution_count": null, 624 | "metadata": {}, 625 | "outputs": [], 626 | "source": [ 627 | "da.cumsum()" 628 | ] 629 | }, 630 | { 631 | "cell_type": "markdown", 632 | "metadata": { 633 | "user_expressions": [] 634 | }, 635 | "source": [ 636 | "Let's try again some operations on our new arrays and matrices" 637 | ] 638 | }, 639 | { 640 | "cell_type": "code", 641 | "execution_count": null, 642 | "metadata": {}, 643 | "outputs": [], 644 | "source": [ 645 | "cm*dm" 646 | ] 647 | }, 648 | { 649 | "cell_type": "code", 650 | "execution_count": null, 651 | "metadata": {}, 652 | "outputs": [], 653 | "source": [ 654 | "ca" 655 | ] 656 | }, 657 | { 658 | "cell_type": "code", 659 | "execution_count": null, 660 | "metadata": {}, 661 | "outputs": [], 662 | "source": [ 663 | "da" 664 | ] 665 | }, 666 | { 667 | "cell_type": "code", 668 | "execution_count": null, 669 | "metadata": {}, 670 | "outputs": [], 671 | "source": [ 672 | "ca*da" 673 | ] 674 | }, 675 | { 676 | "cell_type": "code", 677 | "execution_count": null, 678 | "metadata": {}, 679 | "outputs": [], 680 | "source": [ 681 | "ca.dot(da)" 682 | ] 683 | }, 684 | { 685 | "cell_type": "markdown", 686 | "metadata": { 687 | "user_expressions": [] 688 | }, 689 | "source": [ 690 | "We can create special matrices using Numpy's functions and classes" 691 | ] 692 | }, 693 | { 694 | "cell_type": "code", 695 | "execution_count": null, 696 | "metadata": {}, 697 | "outputs": [], 698 | "source": [ 699 | "print(np.ones((3,4)))\n", 700 | "print(np.zeros((2,2)))\n", 701 | "print(np.eye(2))\n", 702 | "print(np.ones_like(cm))" 703 | ] 704 | }, 705 | { 706 | "cell_type": "code", 707 | "execution_count": null, 708 | "metadata": {}, 709 | "outputs": [], 710 | "source": [ 711 | "np.random.uniform(-1,1,10)" 712 | ] 713 | }, 714 | { 715 | "cell_type": "code", 716 | "execution_count": null, 717 | "metadata": {}, 718 | "outputs": [], 719 | "source": [ 720 | "#np.random.seed(123456)\n", 721 | "x0 = 0\n", 722 | "x = [x0]\n", 723 | "[x.append(x[-1] + np.random.normal() ) for i in range(500)]\n", 724 | "plt.plot(x)\n", 725 | "plt.title('A simple random walk')\n", 726 | "plt.xlabel('Period')\n", 727 | "plt.ylabel('Log Income')\n", 728 | "plt.show()" 729 | ] 730 | }, 731 | { 732 | "cell_type": "markdown", 733 | "metadata": { 734 | "user_expressions": [] 735 | }, 736 | "source": [ 737 | "### Extending Capabilities with Functions" 738 | ] 739 | }, 740 | { 741 | "cell_type": "markdown", 742 | "metadata": { 743 | "user_expressions": [] 744 | }, 745 | "source": [ 746 | "We have used some of the functions in Python, Numpy and Matplotlib. But what if we wanted to create our own functions? It is very easy to do so in Python. There are two ways to define functions. Let's use them to define the CRRA utility function $u(c)=\\frac{c^{1-\\sigma}-1}{1-\\sigma}$ and the production function $f(k)=Ak^\\alpha$.\n", 747 | "\n", 748 | "The first method is as follows:" 749 | ] 750 | }, 751 | { 752 | "cell_type": "code", 753 | "execution_count": null, 754 | "metadata": {}, 755 | "outputs": [], 756 | "source": [ 757 | "def u(c, sigma):\n", 758 | " '''This function returns the value of utility when the CRRA\n", 759 | " coefficient is sigma. I.e. \n", 760 | " u(c,sigma)=(c**(1-sigma)-1)/(1-sigma) if sigma!=1 \n", 761 | " and \n", 762 | " u(c,sigma)=ln(c) if sigma==1\n", 763 | " Usage: u(c,sigma)\n", 764 | " '''\n", 765 | " if sigma!=1:\n", 766 | " u = (c**(1-sigma) - 1) / (1-sigma)\n", 767 | " else:\n", 768 | " u = np.log(c)\n", 769 | " return u" 770 | ] 771 | }, 772 | { 773 | "cell_type": "markdown", 774 | "metadata": { 775 | "user_expressions": [] 776 | }, 777 | "source": [ 778 | "This defined the utility function. Let's plot it for $0< c\\le5$ and $\\sigma\\in\\{0.5,1,1.5\\}$" 779 | ] 780 | }, 781 | { 782 | "cell_type": "code", 783 | "execution_count": null, 784 | "metadata": {}, 785 | "outputs": [], 786 | "source": [ 787 | "# Create vector\n", 788 | "c = np.linspace(0.1, 5, 100)\n", 789 | "# Evaluate utilities for different CRRA parameters\n", 790 | "u1 = u(c, .5)\n", 791 | "u2 = u(c, 1)\n", 792 | "u3 = u(c, 1.5)\n", 793 | "# Plot\n", 794 | "plt.plot(c, u1, label=r'$\\sigma=.5$')\n", 795 | "plt.plot(c, u2, label=r'$\\sigma=1$')\n", 796 | "plt.plot(c, u3, label=r'$\\sigma=1.5$')\n", 797 | "plt.xlabel(r'$c_t$')\n", 798 | "plt.ylabel(r'$u(c_t)$')\n", 799 | "plt.title('CRRA Utility function')\n", 800 | "plt.legend(loc=4)\n", 801 | "plt.savefig('./CRRA.jpg', dpi=150)\n", 802 | "plt.savefig('./CRRA.pdf', dpi=150)\n", 803 | "plt.savefig('./CRRA.png', dpi=150)\n", 804 | "plt.show()" 805 | ] 806 | }, 807 | { 808 | "cell_type": "markdown", 809 | "metadata": { 810 | "user_expressions": [] 811 | }, 812 | "source": [ 813 | "While this is nice, it requires us to always have to put a value for the CRRA coefficient. Furthermore, we need to remember if $c$ is the first or second argument. Since we tend to use log-utilities a lot, let us change the definition of the utility function so that it has a default value for $\\sigma$ equal to 1" 814 | ] 815 | }, 816 | { 817 | "cell_type": "code", 818 | "execution_count": null, 819 | "metadata": {}, 820 | "outputs": [], 821 | "source": [ 822 | "def u(c, sigma=1):\n", 823 | " '''This function returns the value of utility when the CRRA\n", 824 | " coefficient is sigma. I.e. \n", 825 | " u(c,sigma)=(c**(1-sigma)-1)/(1-sigma) if sigma!=1 \n", 826 | " and \n", 827 | " u(c,sigma)=ln(c) if sigma==1\n", 828 | " Usage: u(c,sigma=value), where sigma=1 is the default \n", 829 | " '''\n", 830 | " if sigma!=1:\n", 831 | " u = (c**(1-sigma) - 1) / (1-sigma)\n", 832 | " else:\n", 833 | " u = np.log(c)\n", 834 | " return u" 835 | ] 836 | }, 837 | { 838 | "cell_type": "code", 839 | "execution_count": null, 840 | "metadata": {}, 841 | "outputs": [], 842 | "source": [ 843 | "sigma1 = .25\n", 844 | "sigma3 = 1.25\n", 845 | "u1 = u(c, sigma=sigma1)\n", 846 | "u2 = u(c)\n", 847 | "u3 = u(c, sigma=sigma3)\n", 848 | "plt.plot(c, u1, label=r'$\\sigma='+str(sigma1)+'$')\n", 849 | "plt.plot(c, u2, label=r'$\\sigma=1$')\n", 850 | "plt.plot(c, u3, label=r'$\\sigma='+str(sigma3)+'$')\n", 851 | "plt.xlabel(r'$c_t$')\n", 852 | "plt.ylabel(r'$u(c_t)$')\n", 853 | "plt.title('CRRA Utility function')\n", 854 | "plt.legend(loc=4)\n", 855 | "plt.show()" 856 | ] 857 | }, 858 | { 859 | "cell_type": "markdown", 860 | "metadata": { 861 | "user_expressions": [] 862 | }, 863 | "source": [ 864 | "### Exercise\n", 865 | "\n", 866 | "Write the function for the Cobb-Douglas production function. Can you generalize it so that we can use it for aggregate, per capita, and per efficiency units without having to write a function for each?\n", 867 | "\n", 868 | "Remember aggregate production is \n", 869 | "$$\n", 870 | "Y = F(K, AL) = K^\\alpha (A L)^{1-\\alpha},\n", 871 | "$$\n", 872 | "\n", 873 | "per capita is\n", 874 | "\n", 875 | "$$\n", 876 | "\\hat y=\\frac{F(K, AL)}{L} = \\frac{K^\\alpha (A L)^{1-\\alpha}}{L} = Ak^\\alpha,\n", 877 | "$$\n", 878 | "\n", 879 | "and per effective worker\n", 880 | "\n", 881 | "$$\n", 882 | "y = \\frac{F(K, AL)}{AL} = \\frac{K^\\alpha (A L)^{1-\\alpha}}{AL} = k^\\alpha,\n", 883 | "$$\n", 884 | "\n", 885 | "where $k=K/AL$." 886 | ] 887 | }, 888 | { 889 | "cell_type": "markdown", 890 | "metadata": { 891 | "user_expressions": [] 892 | }, 893 | "source": [ 894 | "The second method is to use the `lambda` notation, which allows you to define functions in one line or without giving the function a name." 895 | ] 896 | }, 897 | { 898 | "cell_type": "code", 899 | "execution_count": null, 900 | "metadata": {}, 901 | "outputs": [], 902 | "source": [ 903 | "squared = lambda x: x**2\n", 904 | "squared(2)" 905 | ] 906 | }, 907 | { 908 | "cell_type": "markdown", 909 | "metadata": { 910 | "user_expressions": [] 911 | }, 912 | "source": [ 913 | "# Our first script" 914 | ] 915 | }, 916 | { 917 | "cell_type": "markdown", 918 | "metadata": { 919 | "user_expressions": [] 920 | }, 921 | "source": [ 922 | "Let's write a script that prints \"Hello World!\"" 923 | ] 924 | }, 925 | { 926 | "cell_type": "code", 927 | "execution_count": null, 928 | "metadata": {}, 929 | "outputs": [], 930 | "source": [ 931 | "%%file?" 932 | ] 933 | }, 934 | { 935 | "cell_type": "code", 936 | "execution_count": null, 937 | "metadata": {}, 938 | "outputs": [], 939 | "source": [ 940 | "%%file helloworld.py\n", 941 | "#!/usr/bin/env python\n", 942 | "# coding=utf-8\n", 943 | "'''\n", 944 | "My First script in Python\n", 945 | "\n", 946 | "Author: Me\n", 947 | "E-mail: me@me.com\n", 948 | "Website: http://me.com\n", 949 | "GitHub: https://github.com/me\n", 950 | "Date: Today\n", 951 | "\n", 952 | "This code computes Random Walks and graphs them\n", 953 | "'''\n", 954 | "\n", 955 | "'''\n", 956 | "from __future__ import division\n", 957 | "import numpy as np\n", 958 | "import matplotlib.pyplot as plt\n", 959 | "'''\n", 960 | "print('Hello World!')\n" 961 | ] 962 | }, 963 | { 964 | "cell_type": "markdown", 965 | "metadata": { 966 | "user_expressions": [] 967 | }, 968 | "source": [ 969 | "Let's run that script" 970 | ] 971 | }, 972 | { 973 | "cell_type": "code", 974 | "execution_count": null, 975 | "metadata": {}, 976 | "outputs": [], 977 | "source": [ 978 | "%run helloworld.py" 979 | ] 980 | }, 981 | { 982 | "cell_type": "markdown", 983 | "metadata": { 984 | "user_expressions": [] 985 | }, 986 | "source": [ 987 | "#### Exercise\n", 988 | "\n", 989 | "Write a simple script ``randomwalk.py`` that simulates and plots random walks. In particular, create a function `randomwalk(x0, T, mu, sigma)` that simulates the random walk starting at $x_0=x0$ until $t=T$ where the shock is distributed $\\mathcal{N}(\\mu,\\sigma^2)$" 990 | ] 991 | }, 992 | { 993 | "cell_type": "code", 994 | "execution_count": null, 995 | "metadata": {}, 996 | "outputs": [], 997 | "source": [ 998 | "import randomwalk as rw" 999 | ] 1000 | }, 1001 | { 1002 | "cell_type": "code", 1003 | "execution_count": null, 1004 | "metadata": {}, 1005 | "outputs": [], 1006 | "source": [ 1007 | "rw.randomwalk(0, 500, 0, 1)" 1008 | ] 1009 | }, 1010 | { 1011 | "cell_type": "code", 1012 | "execution_count": null, 1013 | "metadata": {}, 1014 | "outputs": [], 1015 | "source": [ 1016 | "from randomwalk import randomwalk" 1017 | ] 1018 | }, 1019 | { 1020 | "cell_type": "code", 1021 | "execution_count": null, 1022 | "metadata": {}, 1023 | "outputs": [], 1024 | "source": [ 1025 | "randomwalk??" 1026 | ] 1027 | }, 1028 | { 1029 | "cell_type": "code", 1030 | "execution_count": null, 1031 | "metadata": {}, 1032 | "outputs": [], 1033 | "source": [ 1034 | "import time\n", 1035 | "time.sleep(10)\n", 1036 | "print(\"It's time\")" 1037 | ] 1038 | }, 1039 | { 1040 | "cell_type": "markdown", 1041 | "metadata": { 1042 | "tags": [], 1043 | "user_expressions": [] 1044 | }, 1045 | "source": [ 1046 | "Notebook written by [Ömer Özak](http://omerozak.com) for his Ph.D. students in Economics at [Southern Methodist University](http.www.smu.edu). Feel free to use, distribute, or contribute." 1047 | ] 1048 | } 1049 | ], 1050 | "metadata": { 1051 | "kernelspec": { 1052 | "display_name": "Python 3 (ipykernel)", 1053 | "language": "python", 1054 | "name": "python3" 1055 | }, 1056 | "language_info": { 1057 | "codemirror_mode": { 1058 | "name": "ipython", 1059 | "version": 3 1060 | }, 1061 | "file_extension": ".py", 1062 | "mimetype": "text/x-python", 1063 | "name": "python", 1064 | "nbconvert_exporter": "python", 1065 | "pygments_lexer": "ipython3", 1066 | "version": "3.9.13" 1067 | }, 1068 | "widgets": { 1069 | "application/vnd.jupyter.widget-state+json": { 1070 | "state": {}, 1071 | "version_major": 2, 1072 | "version_minor": 0 1073 | } 1074 | } 1075 | }, 1076 | "nbformat": 4, 1077 | "nbformat_minor": 4 1078 | } 1079 | -------------------------------------------------------------------------------- /notebooks/Penn World Table.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": { 7 | "collapsed": false 8 | }, 9 | "outputs": [ 10 | { 11 | "name": "stdout", 12 | "output_type": "stream", 13 | "text": [ 14 | "Using matplotlib backend: MacOSX\n", 15 | "Populating the interactive namespace from numpy and matplotlib\n" 16 | ] 17 | } 18 | ], 19 | "source": [ 20 | "from __future__ import division\n", 21 | "%pylab --no-import-all\n", 22 | "%matplotlib inline\n", 23 | "import pandas as pd" 24 | ] 25 | }, 26 | { 27 | "cell_type": "code", 28 | "execution_count": 2, 29 | "metadata": { 30 | "collapsed": false 31 | }, 32 | "outputs": [], 33 | "source": [ 34 | "df=pd.read_excel('http://www.rug.nl/research/ggdc/data/pwt/v80/pwt80.xlsx',sheetname=1)\n", 35 | "dfpwt=pd.read_excel('http://www.rug.nl/research/ggdc/data/pwt/v80/pwt80.xlsx',sheetname=2)" 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": 4, 41 | "metadata": { 42 | "collapsed": false 43 | }, 44 | "outputs": [ 45 | { 46 | "data": { 47 | "text/html": [ 48 | "
\n", 49 | "\n", 50 | " \n", 51 | " \n", 52 | " \n", 53 | " \n", 54 | " \n", 55 | " \n", 56 | " \n", 57 | " \n", 58 | " \n", 59 | " \n", 60 | " \n", 61 | " \n", 62 | " \n", 63 | " \n", 64 | " \n", 65 | " \n", 66 | " \n", 67 | " \n", 68 | " \n", 69 | " \n", 70 | " \n", 71 | " \n", 72 | " \n", 73 | " \n", 74 | " \n", 75 | " \n", 76 | " \n", 77 | " \n", 78 | " \n", 79 | " \n", 80 | " \n", 81 | " \n", 82 | " \n", 83 | " \n", 84 | " \n", 85 | " \n", 86 | " \n", 87 | " \n", 88 | " \n", 89 | " \n", 90 | " \n", 91 | " \n", 92 | " \n", 93 | " \n", 94 | " \n", 95 | " \n", 96 | " \n", 97 | " \n", 98 | " \n", 99 | " \n", 100 | " \n", 101 | " \n", 102 | " \n", 103 | " \n", 104 | " \n", 105 | " \n", 106 | " \n", 107 | " \n", 108 | " \n", 109 | " \n", 110 | " \n", 111 | " \n", 112 | " \n", 113 | " \n", 114 | " \n", 115 | " \n", 116 | " \n", 117 | " \n", 118 | " \n", 119 | " \n", 120 | " \n", 121 | " \n", 122 | " \n", 123 | " \n", 124 | " \n", 125 | " \n", 126 | " \n", 127 | " \n", 128 | " \n", 129 | " \n", 130 | " \n", 131 | " \n", 132 | " \n", 133 | " \n", 134 | " \n", 135 | " \n", 136 | " \n", 137 | " \n", 138 | " \n", 139 | " \n", 140 | " \n", 141 | " \n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | " \n", 218 | " \n", 219 | " \n", 220 | " \n", 221 | " \n", 222 | " \n", 223 | " \n", 224 | " \n", 225 | " \n", 226 | " \n", 227 | " \n", 228 | " \n", 229 | " \n", 230 | " \n", 231 | " \n", 232 | " \n", 233 | " \n", 234 | " \n", 235 | " \n", 236 | " \n", 237 | " \n", 238 | " \n", 239 | " \n", 240 | " \n", 241 | " \n", 242 | " \n", 243 | " \n", 244 | " \n", 245 | " \n", 246 | " \n", 247 | " \n", 248 | " \n", 249 | " \n", 250 | " \n", 251 | " \n", 252 | " \n", 253 | " \n", 254 | " \n", 255 | " \n", 256 | " \n", 257 | " \n", 258 | " \n", 259 | " \n", 260 | " \n", 261 | " \n", 262 | " \n", 263 | " \n", 264 | " \n", 265 | " \n", 266 | " \n", 267 | " \n", 268 | " \n", 269 | " \n", 270 | " \n", 271 | " \n", 272 | " \n", 273 | " \n", 274 | " \n", 275 | " \n", 276 | " \n", 277 | " \n", 278 | " \n", 279 | " \n", 280 | " \n", 281 | " \n", 282 | " \n", 283 | " \n", 284 | " \n", 285 | " \n", 286 | " \n", 287 | " \n", 288 | " \n", 289 | " \n", 290 | " \n", 291 | " \n", 292 | " \n", 293 | " \n", 294 | " \n", 295 | " \n", 296 | " \n", 297 | " \n", 298 | " \n", 299 | " \n", 300 | " \n", 301 | " \n", 302 | " \n", 303 | " \n", 304 | " \n", 305 | " \n", 306 | " \n", 307 | " \n", 308 | " \n", 309 | " \n", 310 | " \n", 311 | " \n", 312 | " \n", 313 | " \n", 314 | " \n", 315 | " \n", 316 | " \n", 317 | " \n", 318 | " \n", 319 | " \n", 320 | " \n", 321 | " \n", 322 | " \n", 323 | " \n", 324 | " \n", 325 | " \n", 326 | " \n", 327 | " \n", 328 | " \n", 329 | "
Variable nameVariable definition
0 Identifier variables NaN
1 countrycode 3-letter ISO country code
2 country Country name
3 currency_unit Currency unit
4 year Year
5 NaN NaN
6 Real GDP, employment and population levels NaN
7 rgdpe Expenditure-side real GDP at chained PPPs (in ...
8 rgdpo Output-side real GDP at chained PPPs (in mil. ...
9 pop Population (in millions)
10 emp Number of persons engaged (in millions)
11 avh Average annual hours worked by persons engaged
12 hc Index of human capital per person, based on ye...
13 NaN NaN
14 Current price GDP, capital and TFP NaN
15 cgdpe Expenditure-side real GDP at current PPPs (in ...
16 cgdpo Output-side real GDP at current PPPs (in mil. ...
17 ck Capital stock at current PPPs (in mil. 2005US$)
18 ctfp TFP level at current PPPs (USA=1)
19 NaN NaN
20 National accounts-based variables NaN
21 rgdpna Real GDP at constant 2005 national prices (in ...
22 rkna Capital stock at constant 2005 national prices...
23 rtfpna TFP at constant national prices (2005=1)
24 labsh Share of labour compensation in GDP at current...
25 NaN NaN
26 Exchange rates and GDP price levels NaN
27 xr Exchange rate, national currency/USD (market+e...
28 pl_gdpe Price level of CGDPe (PPP/XR), price level of ...
29 pl_gdpo Price level of CGDPo (PPP/XR), price level of...
30 NaN NaN
31 Data information variables NaN
32 i_cig 0/1/2: relative price data for consumption, in...
33 i_xm 0/1/2: relative price data for exports and imp...
34 i_xr 0/1: the exchange rate is market-based (0) or ...
35 i_outlier 0/1: the observation on pl_gdpe or pl_gdpo is ...
36 cor_exp Correlation between expenditure shares of the ...
37 statcap Statistical capacity indicator (source: World ...
38 NaN NaN
39 Shares in CGDPo NaN
40 csh_c Share of household consumption at current PPPs
41 csh_i Share of gross capital formation at current PPPs
42 csh_g Share of government consumption at current PPPs
43 csh_x Share of merchandise exports at current PPPs
44 csh_m Share of merchandise imports at current PPPs
45 csh_r Share of residual trade and GDP statistical di...
46 NaN NaN
47 Price levels, expenditure categories and capital NaN
48 pl_c Price level of household consumption, price l...
49 pl_i Price level of capital formation, price level...
50 pl_g Price level of government consumption, price ...
51 pl_x Price level of exports, price level of USA GDP...
52 pl_m Price level of imports, price level of USA GDP...
53 pl_k Price level of the capital stock, price level ...
\n", 330 | "
" 331 | ], 332 | "text/plain": [ 333 | " Variable name \\\n", 334 | "0 Identifier variables \n", 335 | "1 countrycode \n", 336 | "2 country \n", 337 | "3 currency_unit \n", 338 | "4 year \n", 339 | "5 NaN \n", 340 | "6 Real GDP, employment and population levels \n", 341 | "7 rgdpe \n", 342 | "8 rgdpo \n", 343 | "9 pop \n", 344 | "10 emp \n", 345 | "11 avh \n", 346 | "12 hc \n", 347 | "13 NaN \n", 348 | "14 Current price GDP, capital and TFP \n", 349 | "15 cgdpe \n", 350 | "16 cgdpo \n", 351 | "17 ck \n", 352 | "18 ctfp \n", 353 | "19 NaN \n", 354 | "20 National accounts-based variables \n", 355 | "21 rgdpna \n", 356 | "22 rkna \n", 357 | "23 rtfpna \n", 358 | "24 labsh \n", 359 | "25 NaN \n", 360 | "26 Exchange rates and GDP price levels \n", 361 | "27 xr \n", 362 | "28 pl_gdpe \n", 363 | "29 pl_gdpo \n", 364 | "30 NaN \n", 365 | "31 Data information variables \n", 366 | "32 i_cig \n", 367 | "33 i_xm \n", 368 | "34 i_xr \n", 369 | "35 i_outlier \n", 370 | "36 cor_exp \n", 371 | "37 statcap \n", 372 | "38 NaN \n", 373 | "39 Shares in CGDPo \n", 374 | "40 csh_c \n", 375 | "41 csh_i \n", 376 | "42 csh_g \n", 377 | "43 csh_x \n", 378 | "44 csh_m \n", 379 | "45 csh_r \n", 380 | "46 NaN \n", 381 | "47 Price levels, expenditure categories and capital \n", 382 | "48 pl_c \n", 383 | "49 pl_i \n", 384 | "50 pl_g \n", 385 | "51 pl_x \n", 386 | "52 pl_m \n", 387 | "53 pl_k \n", 388 | "\n", 389 | " Variable definition \n", 390 | "0 NaN \n", 391 | "1 3-letter ISO country code \n", 392 | "2 Country name \n", 393 | "3 Currency unit \n", 394 | "4 Year \n", 395 | "5 NaN \n", 396 | "6 NaN \n", 397 | "7 Expenditure-side real GDP at chained PPPs (in ... \n", 398 | "8 Output-side real GDP at chained PPPs (in mil. ... \n", 399 | "9 Population (in millions) \n", 400 | "10 Number of persons engaged (in millions) \n", 401 | "11 Average annual hours worked by persons engaged \n", 402 | "12 Index of human capital per person, based on ye... \n", 403 | "13 NaN \n", 404 | "14 NaN \n", 405 | "15 Expenditure-side real GDP at current PPPs (in ... \n", 406 | "16 Output-side real GDP at current PPPs (in mil. ... \n", 407 | "17 Capital stock at current PPPs (in mil. 2005US$) \n", 408 | "18 TFP level at current PPPs (USA=1) \n", 409 | "19 NaN \n", 410 | "20 NaN \n", 411 | "21 Real GDP at constant 2005 national prices (in ... \n", 412 | "22 Capital stock at constant 2005 national prices... \n", 413 | "23 TFP at constant national prices (2005=1) \n", 414 | "24 Share of labour compensation in GDP at current... \n", 415 | "25 NaN \n", 416 | "26 NaN \n", 417 | "27 Exchange rate, national currency/USD (market+e... \n", 418 | "28 Price level of CGDPe (PPP/XR), price level of ... \n", 419 | "29 Price level of CGDPo (PPP/XR), price level of... \n", 420 | "30 NaN \n", 421 | "31 NaN \n", 422 | "32 0/1/2: relative price data for consumption, in... \n", 423 | "33 0/1/2: relative price data for exports and imp... \n", 424 | "34 0/1: the exchange rate is market-based (0) or ... \n", 425 | "35 0/1: the observation on pl_gdpe or pl_gdpo is ... \n", 426 | "36 Correlation between expenditure shares of the ... \n", 427 | "37 Statistical capacity indicator (source: World ... \n", 428 | "38 NaN \n", 429 | "39 NaN \n", 430 | "40 Share of household consumption at current PPPs \n", 431 | "41 Share of gross capital formation at current PPPs \n", 432 | "42 Share of government consumption at current PPPs \n", 433 | "43 Share of merchandise exports at current PPPs \n", 434 | "44 Share of merchandise imports at current PPPs \n", 435 | "45 Share of residual trade and GDP statistical di... \n", 436 | "46 NaN \n", 437 | "47 NaN \n", 438 | "48 Price level of household consumption, price l... \n", 439 | "49 Price level of capital formation, price level... \n", 440 | "50 Price level of government consumption, price ... \n", 441 | "51 Price level of exports, price level of USA GDP... \n", 442 | "52 Price level of imports, price level of USA GDP... \n", 443 | "53 Price level of the capital stock, price level ... " 444 | ] 445 | }, 446 | "execution_count": 4, 447 | "metadata": {}, 448 | "output_type": "execute_result" 449 | } 450 | ], 451 | "source": [ 452 | "df" 453 | ] 454 | } 455 | ], 456 | "metadata": { 457 | "kernelspec": { 458 | "display_name": "Python 2", 459 | "language": "python", 460 | "name": "python2" 461 | } 462 | }, 463 | "nbformat": 4, 464 | "nbformat_minor": 0 465 | } 466 | -------------------------------------------------------------------------------- /notebooks/QGIS/KEN-suit.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/QGIS/KEN-suit.tif -------------------------------------------------------------------------------- /notebooks/QGIS/KEN-suit.tif.aux.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -0.001593749970197678 6 | 0.9705937318503857 7 | 304 8 | 0 9 | 0 10 | 112|0|1|8|9|3|3|1|7|4|3|3|2|1|1|6|3|4|1|2|0|3|2|2|3|2|3|2|2|2|2|0|0|2|0|2|2|0|1|2|0|0|2|5|0|2|0|1|2|1|0|0|1|1|0|0|0|3|0|1|1|0|1|1|0|1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|1|2|2|1|0|0|1|0|1|0|0|0|2|0|1|0|0|1|0|0|1|0|1|1|0|0|0|0|0|1|1|1|1|0|0|1|1|1|0|0|0|1|2|0|1|1|1|0|0|0|0|1|0|1|0|1|0|0|0|1|0|0|0|1|0|0|0|0|0|0|1|0|1|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|1|0|0|0|3|0|1|0|0|2|0|0|2|0|0|0|0|1|0|1|1|0|0|1|0|1|0|1|1|0|0|0|0|0|0|0|1|0|0|0|0|0|1|0|0|1|0|0|0|0|1|1|0|0|1|0|0|0|0|0|0|0|0|1|0|0|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|0|0|1|1|0|2|0|0|0|0|1|1|1|1|0|2|0|0|0|0|0|0|0|0|0|0|0|1 11 | 12 | 13 | 14 | 0.96899998188019 15 | 0.16194078946596 16 | 0 17 | 0.24824412913286 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /notebooks/QGIS/KEN-suit5.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/QGIS/KEN-suit5.tif -------------------------------------------------------------------------------- /notebooks/QGIS/KEN-suit5.tif.aux.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -0.0004914999902248383 6 | 0.9834914804399013 7 | 1000 8 | 0 9 | 0 10 | 4045|0|0|0|0|0|0|36|0|138|72|72|96|72|144|0|66|36|35|36|36|16|36|0|36|108|36|73|36|0|103|0|72|0|36|0|30|66|0|36|36|0|36|0|0|0|27|0|108|15|73|36|36|36|0|108|36|0|0|0|30|36|36|0|9|0|0|36|0|58|36|17|36|4|36|0|36|0|36|72|0|35|36|0|72|36|0|30|36|0|0|36|36|36|0|0|36|36|36|0|0|0|0|0|0|0|0|36|36|0|0|0|0|0|36|37|36|36|0|0|0|0|47|0|0|0|36|0|43|0|0|0|0|0|0|0|0|36|33|0|33|108|0|0|0|36|0|36|0|0|0|0|41|0|36|0|0|0|36|0|0|36|12|0|0|0|0|0|0|36|0|0|0|36|0|0|0|0|0|0|19|0|0|0|0|72|0|0|5|0|0|0|0|36|36|0|0|0|0|0|0|0|34|0|24|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|36|0|0|0|0|36|0|36|36|0|0|0|36|0|0|0|0|0|0|0|0|32|0|0|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|36|2|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|29|0|0|0|0|0|0|0|0|0|33|0|0|0|0|0|36|0|36|0|0|0|6|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|36|36|0|0|36|0|0|0|0|0|0|0|0|0|0|30|0|0|34|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|36|0|36|0|0|0|0|0|30|0|0|0|42|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|0|0|36|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|4|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|8|0|0|0|0|0|28|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|2|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|15|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|4|0|0|0|0|0|0|0|36|36|0|36|0|0|0|36|0|0|0|0|0|0|0|0|0|0|36|36|0|0|0|0|0|0|0|36|36|0|0|10|0|0|0|0|0|0|0|0|0|21|0|3|36|0|0|0|0|0|0|36|0|0|0|36|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|36|0|0|0|0|36|0|24|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|9|0|0|0|0|0|29|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|24|0|0|0|0|19|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0|34|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|36|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|36|0|0|0|36|0|0|36|0|0|0|0|0|0|22|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|32|0|0|0|0|0|0|0|0|0|0|0|4|0|13 11 | 12 | 13 | 14 | 0.98299998044968 15 | 0.15792968758441 16 | 0 17 | 0.24395116033584 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /notebooks/QGIS/KEN-suit5cyl.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/QGIS/KEN-suit5cyl.tif -------------------------------------------------------------------------------- /notebooks/QGIS/KEN-suit5cyl.tif.aux.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -0.0004914999902248383 6 | 0.9834914804399013 7 | 1000 8 | 0 9 | 0 10 | 4053|0|0|0|0|0|0|36|0|138|72|66|96|72|156|0|66|30|35|36|30|15|30|0|36|114|36|73|36|0|91|0|72|0|36|0|30|60|0|30|36|0|36|0|0|0|33|0|108|18|72|36|36|42|0|108|36|0|0|0|30|42|42|0|9|0|0|36|0|52|36|18|25|4|42|0|30|0|36|78|0|28|30|0|66|36|0|30|36|0|0|36|30|36|0|0|42|42|36|0|0|0|0|0|0|0|0|42|42|0|0|0|0|0|36|37|36|30|0|0|0|0|51|0|0|0|36|0|43|0|0|0|0|0|0|0|0|36|33|0|39|108|0|0|0|30|0|36|0|0|0|0|45|0|36|0|0|0|42|0|0|36|8|0|0|0|0|0|0|36|0|0|0|36|0|0|0|0|0|0|19|0|0|0|0|66|0|0|2|0|0|0|0|30|42|0|0|0|0|0|0|0|34|0|24|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|42|0|0|0|0|36|0|42|35|0|0|0|42|0|0|0|0|0|0|0|0|35|0|0|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|36|2|0|0|0|0|0|0|0|42|0|0|0|0|0|0|0|0|22|0|0|0|0|0|0|0|0|0|33|0|0|0|0|0|36|0|30|0|0|0|7|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|36|42|0|0|42|0|0|0|0|0|0|0|0|0|0|30|0|0|47|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|42|0|30|0|36|0|0|0|0|0|25|0|0|0|46|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|0|0|30|0|0|0|0|0|0|49|0|0|0|0|0|0|0|0|0|0|0|0|35|0|0|5|0|0|0|0|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|7|0|0|0|0|0|27|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|2|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|12|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|30|0|4|0|0|0|0|0|0|0|30|36|0|42|0|0|0|36|0|0|0|0|0|0|0|0|0|0|30|35|0|0|0|0|0|0|0|36|36|0|0|8|0|0|0|0|0|0|0|0|0|28|0|3|36|0|0|0|0|0|0|25|0|0|0|42|0|0|0|0|0|0|0|0|30|0|0|0|0|0|0|42|0|0|0|0|36|0|25|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|8|0|0|0|0|0|34|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|35|0|0|0|0|24|0|0|0|0|13|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|42|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|28|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|30|0|0|36|0|0|0|0|0|0|0|0|36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|42|0|42|0|0|0|42|0|0|42|0|0|0|0|0|0|21|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|35|0|0|0|0|0|0|0|0|0|0|0|4|0|12 11 | 12 | 13 | 14 | 0.98299998044968 15 | 0.15792829250114 16 | 0 17 | 0.24391559512603 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /notebooks/QGIS/KEN.cpg: -------------------------------------------------------------------------------- 1 | UTF-8 -------------------------------------------------------------------------------- /notebooks/QGIS/KEN.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/QGIS/KEN.dbf -------------------------------------------------------------------------------- /notebooks/QGIS/KEN.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] -------------------------------------------------------------------------------- /notebooks/QGIS/KEN.qpj: -------------------------------------------------------------------------------- 1 | GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]] 2 | -------------------------------------------------------------------------------- /notebooks/QGIS/KEN.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/QGIS/KEN.shp -------------------------------------------------------------------------------- /notebooks/QGIS/KEN.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/QGIS/KEN.shx -------------------------------------------------------------------------------- /notebooks/QGIS/KENcyl.cpg: -------------------------------------------------------------------------------- 1 | UTF-8 -------------------------------------------------------------------------------- /notebooks/QGIS/KENcyl.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/QGIS/KENcyl.dbf -------------------------------------------------------------------------------- /notebooks/QGIS/KENcyl.prj: -------------------------------------------------------------------------------- 1 | PROJCS["Cylindrical_Equal_Area",GEOGCS["GCS_WGS_1984",DATUM["D_unknown",SPHEROID["WGS84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Cylindrical_Equal_Area"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] -------------------------------------------------------------------------------- /notebooks/QGIS/KENcyl.qpj: -------------------------------------------------------------------------------- 1 | PROJCS["unnamed",GEOGCS["WGS 84",DATUM["unknown",SPHEROID["WGS84",6378137,298.257223563],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Cylindrical_Equal_Area"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] 2 | -------------------------------------------------------------------------------- /notebooks/QGIS/KENcyl.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/QGIS/KENcyl.shp -------------------------------------------------------------------------------- /notebooks/QGIS/KENcyl.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/QGIS/KENcyl.shx -------------------------------------------------------------------------------- /notebooks/WDI/wdimobile.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/WDI/wdimobile.xls -------------------------------------------------------------------------------- /notebooks/helloworld.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding=utf-8 3 | ''' 4 | My First script in Python 5 | 6 | Author: Me 7 | E-mail: me@me.com 8 | Website: http://me.com 9 | GitHub: https://github.com/me 10 | Date: Today 11 | 12 | This code computes Random Walks and graphs them 13 | ''' 14 | 15 | ''' 16 | from __future__ import division 17 | import numpy as np 18 | import matplotlib.pyplot as plt 19 | ''' 20 | print 'Hello World!' -------------------------------------------------------------------------------- /notebooks/optgrowthfuncs.py: -------------------------------------------------------------------------------- 1 | def U(c,sigma=1): 2 | '''This function returns the value of utility when the CRRA 3 | coefficient is sigma. I.e. 4 | u(c,sigma)=(c**(1-sigma)-1)/(1-sigma) if sigma!=1 5 | and 6 | u(c,sigma)=ln(c) if sigma==1 7 | Usage: u(c,sigma) 8 | ''' 9 | if sigma!=1: 10 | u=(c**(1-sigma)-1)/(1-sigma) 11 | else: 12 | u=np.log(c) 13 | return u 14 | 15 | def F(K,L=1,alpha=.3,A=1): 16 | ''' 17 | Cobb-Douglas production function 18 | F(K,L)=K^alpha L^(1-alpha) 19 | ''' 20 | return K**alpha * L**(1-alpha) 21 | 22 | def Va(k,alpha=.3,beta=.9): 23 | ab=alpha*beta 24 | return np.log(1-ab)/(1-beta)+ab*np.log(ab)/((1-beta)*(1-ab))+alpha*np.log(k)/(1-ab) 25 | 26 | def opk(k,alpha=.3,beta=.9): 27 | return alpha*beta*k**alpha 28 | 29 | def opc(k,alpha=.3,beta=.9): 30 | return (1-alpha*beta)*k**alpha -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-Clipper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-Clipper.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-Coordinates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-Coordinates.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-Cylindrical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-Cylindrical.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-GADM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-GADM.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-KEN-Graduated-suit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-KEN-Graduated-suit.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-KEN-Raster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-KEN-Raster.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-KEN-Raster5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-KEN-Raster5.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-Layer-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-Layer-menu.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-MultiPart-SinglePart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-MultiPart-SinglePart.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-Query-KEN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-Query-KEN.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-Query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-Query.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-Raster-KEN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-Raster-KEN.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-SinglePart-MultiPart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-SinglePart-MultiPart.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-Style-Category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-Style-Category.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-Style-Field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-Style-Field.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-Style-Properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-Style-Properties.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-Zonal-Stats.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-Zonal-Stats.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-Zoom-Layer-Extent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-Zoom-Layer-Extent.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-ZoomToCoordinates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-ZoomToCoordinates.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-ZoomToCoordinatesPlugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-ZoomToCoordinatesPlugin.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-add-raster-layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-add-raster-layer.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-add-vector-layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-add-vector-layer.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-attribute-table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-attribute-table.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-attribute-table2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-attribute-table2.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-attribute-table3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-attribute-table3.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-change-raster-size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-change-raster-size.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-clip-KEN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-clip-KEN.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-file-toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-file-toolbar.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-handtool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-handtool.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-identify-features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-identify-features.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-main.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-raster-color-scheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-raster-color-scheme.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-raster-with-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-raster-with-color.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-select-feature-attributes-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-select-feature-attributes-button.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-select-features-by-ISO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-select-features-by-ISO.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-select-features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-select-features.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-zoom-toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-zoom-toolbar.png -------------------------------------------------------------------------------- /notebooks/pics/GIS/QGIS-zoomed-KEN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GIS/QGIS-zoomed-KEN.png -------------------------------------------------------------------------------- /notebooks/pics/GRASS-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/GRASS-logo.png -------------------------------------------------------------------------------- /notebooks/pics/IPy_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/IPy_header.png -------------------------------------------------------------------------------- /notebooks/pics/OSGEO-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/OSGEO-logo.png -------------------------------------------------------------------------------- /notebooks/pics/QGis_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/QGis_Logo.png -------------------------------------------------------------------------------- /notebooks/pics/marble-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/marble-logo.png -------------------------------------------------------------------------------- /notebooks/pics/python-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ozak/CompEcon/f41a960df58f146d366021f87f626b6217684ecf/notebooks/pics/python-logo.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # This file may be used to create an environment using: 2 | # $ conda create --name --file 3 | # platform: osx-64 4 | _r-mutex=1.0.1=anacondar_1 5 | affine=2.3.0=py_0 6 | appdirs=1.4.4=pypi_0 7 | appnope=0.1.0=py38h32f6830_1001 8 | arviz=0.8.3=py_0 9 | asciitree=0.3.3=py_2 10 | attrs=19.3.0=py_0 11 | autopep8=1.5.2=pyh9f0ad1d_0 12 | babel=2.8.0=py_0 13 | backcall=0.1.0=py_0 14 | basemap=1.3.0=py38h9bcff04_2 15 | bcolz=1.2.1=py38h4f17bb1_1001 16 | beautifulsoup4=4.9.1=py38h32f6830_0 17 | blas=2.16=openblas 18 | bleach=3.1.5=pyh9f0ad1d_0 19 | blinker=1.4=py_1 20 | blosc=1.19.0=h4a8c4bd_0 21 | bokeh=2.0.1=py38h32f6830_0 22 | boost-cpp=1.72.0=hdf9ef73_0 23 | boto=2.49.0=py_0 24 | boto3=1.9.191=py_0 25 | botocore=1.12.191=py_0 26 | brotlipy=0.7.0=py38h64e0658_1000 27 | bwidget=1.9.14=0 28 | bz2file=0.98=py_0 29 | bzip2=1.0.8=h0b31af3_2 30 | ca-certificates=2020.4.5.2=hecda079_0 31 | cachecontrol=0.12.6=py_0 32 | cachetools=4.1.0=py_1 33 | cairo=1.16.0=hec6a9b0_1003 34 | camelot-py=0.8.0=py_1 35 | cartopy=0.18.0=py38h9f7df5a_0 36 | cctools=927.0.2=h5ba7a2e_4 37 | certifi=2020.4.5.2=py38h32f6830_0 38 | cffi=1.14.0=py38h356ff06_0 39 | cfitsio=3.470=hddc9c06_5 40 | cftime=1.1.3=py38h65ad66c_0 41 | chardet=3.0.4=py38h32f6830_1006 42 | clang=9.0.1=default_hf57f61e_0 43 | clang-tools=9.0.1=default_hf57f61e_0 44 | clang_osx-64=9.0.1=h05bbb7f_0 45 | clangxx=9.0.1=default_hf57f61e_0 46 | clangxx_osx-64=9.0.1=h05bbb7f_2 47 | click=7.1.2=pyh9f0ad1d_0 48 | click-plugins=1.1.1=py_0 49 | cligj=0.5.0=pypi_0 50 | clldutils=3.5.1=pypi_0 51 | cloudpickle=1.4.1=py_0 52 | colorcet=2.0.1=py_0 53 | colorlog=4.1.0=pypi_0 54 | compiler-rt=9.0.1=h6a512c6_3 55 | compiler-rt_osx-64=9.0.1=h99342c6_3 56 | contextily=1.0.0=py_0 57 | coverage=5.1=pypi_0 58 | covid=2.2.10=pypi_0 59 | covid19py=0.3.0=pypi_0 60 | cryptography=2.9.2=py38hb761dab_0 61 | csvw=1.7.0=pypi_0 62 | curl=7.69.1=h2d98d24_0 63 | curlify=2.2.1=pypi_0 64 | cycler=0.10.0=py_2 65 | cython=0.29.19=py38hc84c608_0 66 | cytoolz=0.10.1=py38h0b31af3_0 67 | dask=2.17.2=py_0 68 | dask-core=2.17.2=py_0 69 | datashader=0.11.0=pyh9f0ad1d_0 70 | datashape=0.5.4=py_1 71 | dbus=1.13.6=h2f22bb5_0 72 | decorator=4.4.2=py_0 73 | defusedxml=0.6.0=py_0 74 | dendropy=4.4.0=pypi_0 75 | deprecated=1.2.10=pyh9f0ad1d_0 76 | descartes=1.1.0=py_4 77 | dill=0.3.1.1=py38h32f6830_1 78 | distributed=2.18.0=py38h32f6830_0 79 | docutils=0.16=py38h32f6830_1 80 | earthengine-api=0.1.223=pyh9f0ad1d_0 81 | econtools=0.3.2=pypi_0 82 | ecopy=0.1.2.2=pypi_0 83 | entrypoints=0.3=py38h32f6830_1001 84 | et_xmlfile=1.0.1=py_1001 85 | expat=2.2.9=h4a8c4bd_2 86 | facebook-business=7.0.1=pypi_0 87 | facebook-sdk=3.1.0=pypi_0 88 | fastcache=1.1.0=py38h64e0658_1 89 | fasteners=0.14.1=py_3 90 | feedgenerator=1.9.1=py_0 91 | ffmpeg=4.2.3=hd0c0d6a_0 92 | fiona=1.8.13=py38he71f6a4_0 93 | fontawesome-markdown=0.2.6=pypi_0 94 | fontconfig=2.13.1=h6b1039f_1001 95 | freetype=2.10.2=h8da9a1a_0 96 | freexl=1.0.5=h1de35cc_1002 97 | fribidi=1.0.9=h0b31af3_0 98 | fsspec=0.7.4=py_0 99 | future=0.18.2=py38h32f6830_1 100 | gdal=3.0.4=py38h9f7df5a_4 101 | gensim=3.8.3=py38hc84c608_2 102 | geocoder=1.38.1=pypi_0 103 | geographiclib=1.50=py_0 104 | geonamescache=1.1.0=pypi_0 105 | geopandas=0.7.0=py_1 106 | geoplot=0.4.1=py_0 107 | geopy=1.22.0=pyh9f0ad1d_0 108 | georasters=0.5.19a0=dev_0 109 | geos=3.8.1=h4a8c4bd_0 110 | geotiff=1.5.1=hd8796ba_10 111 | gettext=0.19.8.1=h46ab8bc_1002 112 | gfortran_impl_osx-64=7.3.0=hf4212f2_2 113 | gfortran_osx-64=7.3.0=h22b1bf0_11 114 | ghostscript=9.22=h0a44026_1001 115 | giflib=5.2.1=h0b31af3_2 116 | glib=2.64.3=h577aef8_0 117 | gmp=6.2.0=h4a8c4bd_2 118 | gmpy2=2.1.0b1=py38h4160ff4_0 119 | gnutls=3.6.13=hc269f14_0 120 | google-api-core=1.20.0=pypi_0 121 | google-api-python-client=1.8.4=pyh9f0ad1d_0 122 | google-auth=1.16.1=pypi_0 123 | google-auth-httplib2=0.0.3=py_3 124 | google-cloud-core=1.3.0=py_0 125 | google-cloud-storage=1.28.1=pyh9f0ad1d_0 126 | google-resumable-media=0.5.1=pyh9f0ad1d_0 127 | googleapis-common-protos=1.52.0=pypi_0 128 | googledrivedownloader=0.4=pypi_0 129 | googletrans=2.4.0=pypi_0 130 | graphite2=1.3.13=h12caacf_1001 131 | gsl=2.6=ha2d443c_0 132 | h5py=2.10.0=nompi_py38h106b333_102 133 | harfbuzz=2.4.0=hd8d2a14_3 134 | hdf4=4.2.13=h84186c3_1003 135 | hdf5=1.10.5=nompi_h3e39495_1104 136 | hdmedians=0.13=py38h65ad66c_1002 137 | heapdict=1.0.1=py_0 138 | hmi=0.8.2=dev_0 139 | html5lib=1.0.1=py_0 140 | httplib2=0.18.1=pyh9f0ad1d_0 141 | icu=64.2=h6de7cb9_1 142 | idna=2.9=py_1 143 | imagecodecs-lite=2019.12.3=py38h65ad66c_1 144 | imageio=2.8.0=py_0 145 | imagesize=1.2.0=py_0 146 | importlib-metadata=1.6.1=py38h32f6830_0 147 | importlib_metadata=1.6.1=0 148 | ipykernel=5.3.0=py38h23f93f0_0 149 | ipyparallel=6.3.0=py38h32f6830_0 150 | ipystata=0.3.8=pypi_0 151 | ipython=7.15.0=py38h32f6830_0 152 | ipython_genutils=0.2.0=py_1 153 | ipywidgets=7.5.1=py_0 154 | isl=0.19=0 155 | isodate=0.6.0=pypi_0 156 | isounidecode=0.3=pypi_0 157 | jasper=1.900.1=h636a363_1006 158 | jdcal=1.4.1=py_0 159 | jedi=0.17.0=py38h32f6830_0 160 | jinja2=2.11.2=pyh9f0ad1d_0 161 | jmespath=0.10.0=pyh9f0ad1d_0 162 | joblib=0.15.1=py_0 163 | jpeg=9d=h0b31af3_0 164 | json-c=0.13.1=h575e443_1002 165 | json5=0.9.4=pyh9f0ad1d_0 166 | jsonschema=3.2.0=py38h32f6830_1 167 | jupyter=1.0.0=pypi_0 168 | jupyter_client=6.1.3=py_0 169 | jupyter_console=6.1.0=py_1 170 | jupyter_contrib_core=0.3.3=py_2 171 | jupyter_contrib_nbextensions=0.5.1=py38_0 172 | jupyter_core=4.6.3=py38h32f6830_1 173 | jupyter_highlight_selected_word=0.2.0=py38_1000 174 | jupyter_latex_envs=1.4.4=py38_1000 175 | jupyter_nbextensions_configurator=0.4.1=py38_0 176 | jupyterlab=2.1.3=py_0 177 | jupyterlab_server=1.1.5=py_0 178 | kealib=1.4.13=h2324030_0 179 | keyring=21.2.1=pypi_0 180 | kiwisolver=1.2.0=py38ha0d09dd_0 181 | krb5=1.17.1=h1752a42_0 182 | lame=3.100=h1de35cc_1001 183 | latexcodec=2.0.0=pypi_0 184 | ld64=450.3=h3c32e8a_4 185 | ldpred=1.0.11=pypi_0 186 | libblas=3.8.0=16_openblas 187 | libcblas=3.8.0=16_openblas 188 | libclang=9.0.1=default_hf57f61e_0 189 | libcurl=7.69.1=hc0b9707_0 190 | libcxx=10.0.0=h1af66ff_2 191 | libdap4=3.20.6=h8c15375_0 192 | libedit=3.1.20191231=hed1e85f_0 193 | libffi=3.2.1=h4a8c4bd_1007 194 | libgcc=4.8.5=1 195 | libgdal=3.0.4=h1914a01_4 196 | libgfortran=4.0.0=2 197 | libgpuarray=0.7.6=h1de35cc_1003 198 | libiconv=1.15=h0b31af3_1006 199 | libkml=1.3.0=h169b8f9_1011 200 | liblapack=3.8.0=16_openblas 201 | liblapacke=3.8.0=16_openblas 202 | libllvm8=8.0.1=h770b8ee_0 203 | libllvm9=9.0.1=h7475705_1 204 | libnetcdf=4.7.4=nompi_he461dc0_101 205 | libopenblas=0.3.9=h3d69b6c_0 206 | libopencv=4.2.0=py38_5 207 | libpng=1.6.37=hbbe82c9_1 208 | libpq=12.2=h489d428_1 209 | libprotobuf=3.12.3=hd174df1_0 210 | libsodium=1.0.17=h01d97ff_0 211 | libspatialindex=1.9.3=h4a8c4bd_3 212 | libspatialite=4.3.0a=h658e6c1_1038 213 | libssh2=1.9.0=h39bdce6_2 214 | libtiff=4.1.0=ha78913b_3 215 | libuv=1.34.0=h0b31af3_0 216 | libwebp=1.0.2=hd3bf737_5 217 | libxml2=2.9.10=h53d96d6_0 218 | libxslt=1.1.33=h320ff13_0 219 | linearmodels=4.17=pypi_0 220 | lingpy=2.6.6=pypi_0 221 | llvm-openmp=10.0.0=h28b9765_0 222 | llvmlite=0.31.0=py38h0d43c1d_1 223 | locket=0.2.0=py_2 224 | lockfile=0.12.2=py_1 225 | lxml=4.5.1=py38hc829089_0 226 | lz4-c=1.9.2=h4a8c4bd_1 227 | make=4.3=h0b31af3_0 228 | mako=1.1.0=py_0 229 | mapclassify=2.2.0=py_0 230 | markdown=3.2.2=py_0 231 | markupsafe=1.1.1=py38h64e0658_1 232 | matplotlib=3.2.1=0 233 | matplotlib-base=3.2.1=py38h1300a51_0 234 | mccabe=0.6.1=pypi_0 235 | mercantile=1.1.4=pyh9f0ad1d_0 236 | mistune=0.8.4=py38h64e0658_1001 237 | mock=4.0.2=py38h32f6830_0 238 | modin=0.7.3=pypi_0 239 | monotonic=1.5=py_0 240 | more-itertools=8.3.0=py_1 241 | mpc=1.1.0=h4160ff4_1007 242 | mpfr=4.0.2=h65ac59c_1 243 | mpmath=1.1.0=py_0 244 | msgpack-python=1.0.0=py38ha0d09dd_1 245 | multipledispatch=0.6.0=py_0 246 | munch=2.5.0=py_0 247 | mypy-extensions=0.4.3=pypi_0 248 | natsort=7.0.1=py_0 249 | nbconvert=5.6.1=py38h32f6830_1 250 | nbformat=5.0.6=py_0 251 | ncurses=6.1=h0a44026_1002 252 | netcdf4=1.5.3=nompi_py38h645dd01_103 253 | nettle=3.4.1=h3efe00b_1002 254 | networkx=2.2=pypi_0 255 | nodejs=13.13.0=h38d8c5a_0 256 | nose=1.3.7=py38h32f6830_1004 257 | notebook=6.0.3=py38h32f6830_0 258 | nspr=4.20=h0a44026_1000 259 | nss=3.47=hc0980d9_0 260 | numba=0.48.0=py38h4f17bb1_0 261 | numcodecs=0.6.4=py38h4a8c4bd_0 262 | numexpr=2.7.1=py38h5fc983b_1 263 | numpy=1.18.4=py38h1f821a2_0 264 | olefile=0.46=py_0 265 | opencv=4.2.0=py38_5 266 | openh264=2.1.1=hd174df1_0 267 | openjpeg=2.3.1=h254dc36_3 268 | openpyxl=3.0.3=py_0 269 | openssl=1.1.1g=h0b31af3_0 270 | ordered-set=4.0.1=pypi_0 271 | osmnet=0.1.5=py_3 272 | owslib=0.20.0=py_0 273 | packaging=20.4=pyh9f0ad1d_0 274 | palettable=3.3.0=py_0 275 | pandana=0.4.4=py38h4f17bb1_1 276 | pandas=1.0.4=py38h5fc983b_0 277 | pandas-datareader=0.8.1=py_0 278 | pandasql=0.7.3=pypi_0 279 | pandoc=2.9.2.1=0 280 | pandocfilters=1.4.2=py_1 281 | pango=1.42.4=haa940fe_4 282 | param=1.9.3=py_0 283 | parso=0.7.0=pyh9f0ad1d_0 284 | partd=1.1.0=py_0 285 | patsy=0.5.1=py_0 286 | pcre=8.44=h4a8c4bd_0 287 | pdfminer.six=20200517=py_1 288 | pelican=4.2.0=py_0 289 | pexpect=4.8.0=py38h32f6830_1 290 | pickleshare=0.7.5=py38h32f6830_1001 291 | pillow=7.1.2=py38h83dc5e5_0 292 | pip=20.1.1=py_1 293 | pixman=0.38.0=h01d97ff_1003 294 | pkginfo=1.5.0.1=pypi_0 295 | plinkio=0.9.7=pypi_0 296 | pluggy=0.13.1=py38h32f6830_1 297 | pomegranate=0.13.3=py38ha0d09dd_0 298 | poppler=0.67.0=h16886b5_8 299 | poppler-data=0.4.9=1 300 | postgresql=12.2=h62ab893_1 301 | proj=7.0.0=hbce2d5c_4 302 | prometheus_client=0.8.0=pyh9f0ad1d_0 303 | prompt-toolkit=3.0.5=py_0 304 | prompt_toolkit=3.0.5=0 305 | property-cached=1.6.4=pypi_0 306 | protobuf=3.12.2=pypi_0 307 | psutil=5.7.0=py38h64e0658_1 308 | ptyprocess=0.6.0=py_1001 309 | py=1.8.1=py_0 310 | py-opencv=4.2.0=py38h23f93f0_5 311 | pyarrow=0.17.1=pypi_0 312 | pyasn1=0.4.8=py_0 313 | pyasn1-modules=0.2.8=pypi_0 314 | pybtex=0.22.2=pypi_0 315 | pycldf=1.14.1=pypi_0 316 | pycodestyle=2.6.0=pyh9f0ad1d_0 317 | pycountry=19.8.18=py_0 318 | pycparser=2.20=py_0 319 | pycryptodome=3.9.7=py38h646a047_1 320 | pyct=0.4.6=py_0 321 | pyct-core=0.4.6=py_0 322 | pydantic=1.5.1=pypi_0 323 | pydocstyle=5.0.2=pypi_0 324 | pyepsg=0.4.0=py_0 325 | pyface=7.0.0=pypi_0 326 | pyflakes=2.2.0=pypi_0 327 | pygments=2.6.1=py_0 328 | pygpu=0.7.6=py38h3b54f70_1000 329 | pylatex=1.3.2=pypi_0 330 | pymc3=3.8=py_0 331 | pyopenssl=19.1.0=py_1 332 | pyparsing=2.4.7=pyh9f0ad1d_0 333 | pypdf2=1.26.0=py_2 334 | pyproj=2.6.1.post1=py38h7d7e87d_0 335 | pyqt=5.12.3=py38hf180056_3 336 | pyqt5-sip=4.19.18=pypi_0 337 | pyqtchart=5.12=pypi_0 338 | pyqtwebengine=5.12.1=pypi_0 339 | pyreadstat=0.3.4=pypi_0 340 | pyrsistent=0.16.0=py38h64e0658_0 341 | pysal=2.1.0=py_0 342 | pyshp=2.1.0=py_0 343 | pysocks=1.7.1=py38h32f6830_1 344 | pytables=3.6.1=py38h6f8395a_1 345 | pytest=5.4.3=py38h32f6830_0 346 | pytest-cov=2.9.0=pypi_0 347 | python=3.8.2=hd5f0129_7_cpython 348 | python-dateutil=2.8.1=py_0 349 | python-jsonrpc-server=0.3.4=pypi_0 350 | python-language-server=0.33.0=pypi_0 351 | python_abi=3.8=1_cp38 352 | pytrends=4.7.3=pypi_0 353 | pytz=2020.1=pyh9f0ad1d_0 354 | pywavelets=1.1.1=py38h65ad66c_1 355 | pyyaml=5.3.1=py38h64e0658_0 356 | pyzmq=19.0.1=py38h1fcdcd6_0 357 | qt=5.12.5=h514805e_3 358 | qtconsole=4.7.4=pyh9f0ad1d_0 359 | qtpy=1.9.0=py_0 360 | quilt=2.9.15=pypi_0 361 | r=3.6=r36_1004 362 | r-askpass=1.1=r36h17f1fa6_2 363 | r-assertthat=0.2.1=r36h6115d3f_2 364 | r-backports=1.1.7=r36h17f1fa6_0 365 | r-base=3.6.3=h0dd4800_2 366 | r-base64enc=0.1_3=r36h17f1fa6_1004 367 | r-blob=1.2.1=r36h6115d3f_1 368 | r-boot=1.3_25=r36h6115d3f_1 369 | r-broom=0.5.6=r36h6115d3f_1 370 | r-callr=3.4.3=r36h6115d3f_1 371 | r-caret=6.0_86=r36h17f1fa6_2 372 | r-cellranger=1.1.0=r36h6115d3f_1003 373 | r-class=7.3_17=r36h17f1fa6_1 374 | r-cli=2.0.2=r36h6115d3f_1 375 | r-clipr=0.7.0=r36h6115d3f_1 376 | r-cluster=2.1.0=r36h384270c_3 377 | r-codetools=0.2_16=r36h6115d3f_1002 378 | r-colorspace=1.4_1=r36h17f1fa6_2 379 | r-crayon=1.3.4=r36h6115d3f_1003 380 | r-curl=4.3=r36h17f1fa6_1 381 | r-data.table=1.12.8=r36h17f1fa6_1 382 | r-dbi=1.1.0=r36h6115d3f_1 383 | r-dbplyr=1.4.4=r36h6115d3f_0 384 | r-desc=1.2.0=r36h6115d3f_1003 385 | r-digest=0.6.25=r36hc5da6b9_2 386 | r-dplyr=1.0.0=r36hc5da6b9_0 387 | r-ellipsis=0.3.1=r36h17f1fa6_0 388 | r-essentials=3.6=r36_2002 389 | r-evaluate=0.14=r36h6115d3f_2 390 | r-fansi=0.4.1=r36h17f1fa6_1 391 | r-farver=2.0.3=r36hc5da6b9_1 392 | r-fastmap=1.0.1=r36hc5da6b9_1 393 | r-forcats=0.5.0=r36h6115d3f_1 394 | r-foreach=1.5.0=r36h6115d3f_1 395 | r-foreign=0.8_76=r36h17f1fa6_1 396 | r-formatr=1.7=r36h6115d3f_2 397 | r-fs=1.4.1=r36hc5da6b9_1 398 | r-generics=0.0.2=r36h6115d3f_1003 399 | r-ggplot2=3.3.1=r36h6115d3f_0 400 | r-gistr=0.5.0=r36h6115d3f_1 401 | r-glmnet=4.0=r36h384270c_0 402 | r-glue=1.4.1=r36h17f1fa6_0 403 | r-gower=0.2.1=r36h17f1fa6_2 404 | r-gtable=0.3.0=r36h6115d3f_3 405 | r-haven=2.3.1=r36hee97c7f_0 406 | r-hexbin=1.28.1=r36h384270c_1 407 | r-highr=0.8=r36h6115d3f_2 408 | r-hms=0.5.3=r36h6115d3f_1 409 | r-htmltools=0.4.0=r36hc5da6b9_1 410 | r-htmlwidgets=1.5.1=r36h6115d3f_1 411 | r-httpuv=1.5.4=r36hc5da6b9_0 412 | r-httr=1.4.1=r36h6115d3f_2 413 | r-ipred=0.9_9=r36h17f1fa6_2 414 | r-irdisplay=0.7=r36_1002 415 | r-irkernel=1.1=r36h6115d3f_1 416 | r-isoband=0.2.1=r36hc5da6b9_1 417 | r-iterators=1.0.12=r36h6115d3f_1 418 | r-jsonlite=1.6.1=r36h17f1fa6_1 419 | r-kernsmooth=2.23_17=r36h3830744_1 420 | r-knitr=1.28=r36h6115d3f_1 421 | r-labeling=0.3=r36h6115d3f_1003 422 | r-later=1.1.0.1=r36hc5da6b9_0 423 | r-lattice=0.20_41=r36h17f1fa6_2 424 | r-lava=1.6.7=r36h6115d3f_1 425 | r-lazyeval=0.2.2=r36h17f1fa6_2 426 | r-lifecycle=0.2.0=r36h6115d3f_1 427 | r-lubridate=1.7.9=r36hc5da6b9_0 428 | r-magrittr=1.5=r36h6115d3f_1003 429 | r-maps=3.3.0=r36h17f1fa6_1004 430 | r-markdown=1.1=r36h17f1fa6_1 431 | r-mass=7.3_51.6=r36h17f1fa6_2 432 | r-matrix=1.2_18=r36h26f5615_3 433 | r-mgcv=1.8_31=r36h26f5615_1 434 | r-mime=0.9=r36h17f1fa6_1 435 | r-modelmetrics=1.2.2.2=r36hc5da6b9_1 436 | r-modelr=0.1.8=r36h6115d3f_0 437 | r-munsell=0.5.0=r36h6115d3f_1003 438 | r-nlme=3.1_148=r36h384270c_0 439 | r-nnet=7.3_14=r36h17f1fa6_1 440 | r-numderiv=2016.8_1.1=r36h6115d3f_2 441 | r-openssl=1.4.1=r36h9d0ceee_1 442 | r-pbdzmq=0.3_3=r36h95f32f2_1003 443 | r-pillar=1.4.4=r36h6115d3f_0 444 | r-pkgbuild=1.0.8=r36h6115d3f_0 445 | r-pkgconfig=2.0.3=r36h6115d3f_1 446 | r-pkgload=1.1.0=r36hc5da6b9_0 447 | r-plyr=1.8.6=r36hc5da6b9_1 448 | r-praise=1.0.0=r36h6115d3f_1004 449 | r-prettyunits=1.1.1=r36h6115d3f_1 450 | r-proc=1.16.2=r36hc5da6b9_1 451 | r-processx=3.4.2=r36h17f1fa6_1 452 | r-prodlim=2019.11.13=r36hc5da6b9_1 453 | r-progress=1.2.2=r36h6115d3f_2 454 | r-promises=1.1.1=r36hc5da6b9_0 455 | r-pryr=0.1.4=r36hc5da6b9_1004 456 | r-ps=1.3.3=r36h17f1fa6_0 457 | r-purrr=0.3.4=r36h17f1fa6_1 458 | r-quantmod=0.4.17=r36h6115d3f_1 459 | r-r6=2.4.1=r36h6115d3f_1 460 | r-randomforest=4.6_14=r36h384270c_1003 461 | r-rbokeh=0.5.1=r36h6115d3f_0 462 | r-rcolorbrewer=1.1_2=r36h6115d3f_1003 463 | r-rcpp=1.0.4.6=r36hc5da6b9_1 464 | r-readr=1.3.1=r36hc5da6b9_1004 465 | r-readxl=1.3.1=r36hee97c7f_4 466 | r-recipes=0.1.12=r36h6115d3f_1 467 | r-recommended=3.6=r36_1004 468 | r-rematch=1.0.1=r36h6115d3f_1003 469 | r-repr=1.1.0=r36h6115d3f_1 470 | r-reprex=0.3.0=r36h6115d3f_2 471 | r-reshape2=1.4.4=r36hc5da6b9_1 472 | r-rlang=0.4.6=r36h17f1fa6_0 473 | r-rmarkdown=2.2=r36h6115d3f_0 474 | r-rpart=4.1_15=r36h17f1fa6_2 475 | r-rprojroot=1.3_2=r36h6115d3f_1003 476 | r-rstudioapi=0.11=r36h6115d3f_1 477 | r-rvest=0.3.5=r36h6115d3f_1 478 | r-scales=1.1.1=r36h6115d3f_0 479 | r-selectr=0.4_2=r36h6115d3f_1 480 | r-shape=1.4.4=r36_1003 481 | r-shiny=1.4.0.2=r36h6115d3f_1 482 | r-sourcetools=0.1.7=r36h4a8c4bd_1002 483 | r-spatial=7.3_12=r36h17f1fa6_1 484 | r-squarem=2020.3=r36h6115d3f_0 485 | r-stringi=1.4.6=r36h3211bb2_2 486 | r-stringr=1.4.0=r36h6115d3f_2 487 | r-survival=3.1_12=r36h17f1fa6_1 488 | r-sys=3.3=r36h17f1fa6_1 489 | r-testthat=2.3.2=r36hc5da6b9_1 490 | r-tibble=3.0.1=r36h17f1fa6_1 491 | r-tidyr=1.1.0=r36hc5da6b9_0 492 | r-tidyselect=1.1.0=r36h6115d3f_0 493 | r-tidyverse=1.3.0=r36h6115d3f_2 494 | r-timedate=3043.102=r36h6115d3f_1002 495 | r-tinytex=0.23=r36h6115d3f_0 496 | r-ttr=0.23_6=r36h17f1fa6_1 497 | r-utf8=1.1.4=r36h17f1fa6_1003 498 | r-uuid=0.1_4=r36h17f1fa6_1 499 | r-vctrs=0.3.1=r36h17f1fa6_0 500 | r-viridislite=0.3.0=r36h6115d3f_1003 501 | r-whisker=0.4=r36h6115d3f_1 502 | r-withr=2.2.0=r36h6115d3f_1 503 | r-xfun=0.14=r36h6115d3f_0 504 | r-xml2=1.3.2=r36hc5da6b9_1 505 | r-xtable=1.8_4=r36h6115d3f_3 506 | r-xts=0.12_0=r36h17f1fa6_1 507 | r-yaml=2.2.1=r36h17f1fa6_1 508 | r-zeallot=0.1.0=r36h6115d3f_1002 509 | r-zoo=1.8_8=r36h17f1fa6_0 510 | rasterio=1.1.4=py38hc9271d6_0 511 | rasterstats=0.14.0=pypi_0 512 | ratelim=0.1.6=pypi_0 513 | readline=8.0=hcfe32e1_0 514 | readme-renderer=26.0=pypi_0 515 | requests=2.23.0=pyh8c360ce_2 516 | requests-toolbelt=0.9.1=pypi_0 517 | rfc3986=1.4.0=pypi_0 518 | rise=5.6.1=py38_0 519 | rope=0.17.0=pypi_0 520 | rpy2=3.3.2=py38r36h65ad66c_0 521 | rsa=4.0=py_0 522 | rstudio=1.0.44=0 523 | rtree=0.9.4=py38h08f867b_1 524 | s3transfer=0.2.1=py38_0 525 | scikit-allel=1.2.1=py38h4f17bb1_1 526 | scikit-bio=0.5.6=py38h65ad66c_2 527 | scikit-image=0.17.2=py38h5fc983b_0 528 | scikit-learn=0.23.1=py38hb7f0800_0 529 | scipy=1.4.1=py38h38b60c6_3 530 | seaborn=0.10.1=py_0 531 | send2trash=1.5.0=py_0 532 | setuptools=47.1.1=py38h32f6830_0 533 | shapely=1.7.0=py38h5b1fbde_3 534 | simpledbf=0.2.6=pypi_0 535 | simplegeneric=0.8.1=py_1 536 | simplejson=3.17.0=py38h64e0658_1 537 | six=1.15.0=pyh9f0ad1d_0 538 | smart_open=2.0.0=pyh9f0ad1d_0 539 | smartypants=2.0.1=pypi_0 540 | snowballstemmer=2.0.0=pypi_0 541 | snuggs=1.4.7=py_0 542 | sortedcontainers=2.2.1=pyh9f0ad1d_0 543 | soupsieve=2.0.1=py38h32f6830_0 544 | sqlalchemy=1.3.17=pypi_0 545 | sqlite=3.30.1=h93121df_0 546 | stargazer=0.0.4=pypi_0 547 | stata-kernel=1.11.2=pypi_0 548 | statsmodels=0.11.1=py38h64e0658_1 549 | swifter=0.302=py38h32f6830_0 550 | sympy=1.6=py38h32f6830_0 551 | tabulate=0.8.7=pypi_0 552 | tapi=1000.10.8=ha1b3eb9_4 553 | tbb=2019.9=ha1b3eb9_1 554 | tblib=1.6.0=py_0 555 | terminado=0.8.3=py38h32f6830_1 556 | testpath=0.4.4=py_0 557 | tex2ipy=0.3=pypi_0 558 | texsoup=0.2.1=pypi_0 559 | theano=1.0.4=py38h4a8c4bd_1001 560 | threadpoolctl=2.1.0=pyh5ca1d4c_0 561 | tifffile=2020.6.3=py_0 562 | tiledb=1.7.0=h84aa2a7_4 563 | tk=8.6.10=hbbe82c9_0 564 | tktable=2.10=h008db23_3 565 | toolz=0.10.0=py_0 566 | tornado=6.0.4=py38h64e0658_1 567 | tqdm=4.46.1=pyh9f0ad1d_0 568 | traitlets=4.3.3=py38h32f6830_1 569 | traits=6.0.0=pypi_0 570 | traitsui=7.0.0=pypi_0 571 | twine=3.1.1=pypi_0 572 | typing_extensions=3.7.4.2=py_0 573 | typogrify=2.0.7=pypi_0 574 | tzcode=2020a=h0b31af3_0 575 | tzlocal=2.1=pyh9f0ad1d_0 576 | ujson=1.35=pypi_0 577 | unidecode=1.1.1=py_0 578 | urbanaccess=0.2.0=py_1 579 | uritemplate=3.0.1=py_0 580 | urllib3=1.25.9=py_0 581 | w3lib=1.22.0=pypi_0 582 | wcwidth=0.2.4=pyh9f0ad1d_0 583 | webencodings=0.5.1=py_1 584 | wheel=0.34.2=py_1 585 | widgetsnbextension=3.5.1=py38_0 586 | wikipedia=1.4.0=py_2 587 | wrapt=1.12.1=py38h64e0658_1 588 | x264=1!152.20180806=h1de35cc_0 589 | xarray=0.15.1=py_0 590 | xerces-c=3.2.2=h8f8adb3_1004 591 | xlrd=1.2.0=py_0 592 | xlwt=1.3.0=pypi_0 593 | xz=5.2.5=h0b31af3_0 594 | yaml=0.2.5=h0b31af3_0 595 | yapf=0.30.0=pypi_0 596 | zarr=2.4.0=py_0 597 | zeromq=4.3.2=h6de7cb9_2 598 | zict=2.0.0=py_0 599 | zipp=3.1.0=py_0 600 | zlib=1.2.11=h0b31af3_1006 601 | zstd=1.4.4=h4b3e974_3 602 | -------------------------------------------------------------------------------- /setup_GeoPython.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Use conda to create python environment with Jupyter, 3 | # IPython, Stata, R, GIS 4 | # ====================================================== 5 | # Author: Ömer Özak, 2019 (ozak at smu.edu) 6 | # Website: http://omerozak.com 7 | # GitHub: https://github.com/ozak/ 8 | # ====================================================== 9 | conda create --name GeoPython38env -c conda-forge -c r --override-channels python=3.8 asciitree autopep8 babel basemap beautifulsoup4 blas bokeh bzip2 cartopy colorcet curl cython cytoolz dask dask-core datashader datashape descartes dill docutils earthengine-api fiona gensim geographiclib geopandas geoplot geopy geotiff google-api-python-client google-auth google-auth-httplib2 georasters imageio imagesize ipykernel ipyparallel ipython ipython_genutils ipywidgets jupyter jupyterlab kiwisolver matplotlib-base matplotlib markdown networkx nose numba numpy openpyxl pandas pandas-datareader pandoc pandocfilters pandana pelican pycountry pymc3 pysal urbanaccess rasterstats r r-base r-irkernel statsmodels sympy rpy2 rasterio r-tidyr r-tibble r-dplyr rise seaborn scikit-allel scikit-bio scikit-image scikit-learn scipy seaborn swifter theano unidecode urllib3 wikipedia xlrd jupyter_contrib_nbextensions rstudio camelot-py html5lib 10 | 11 | conda activate GeoPython38env 12 | pip install linearmodels git+https://github.com/jeetsukumaran/DendroPy.git git+https://github.com/dmsul/econtools ecopy facebook-business facebook-sdk fontawesome-markdown geocoder geonamescache googledrivedownloader googletrans ipystata isodate isounidecode latexcodec ldpred linearmodels lingpy mccabe ordered-set plinkio pyarrow pybtex pycldf pycountry pydocstyle pyface pyflakes pylatex pyparsing pyreadstat pytest-cov python-jsonrpc-server python-language-server pytrends quilt ratelim readme-renderer rfc3986 rope simpledbf simplejson smartypants snowballstemmer snuggs stata-kernel tabulate tex2ipy texsoup toolz traits traitsui twine typogrify uritemplate w3lib webencodings wrapt xlwt yapf modin stargazer covid COVID19Py pandasql 13 | 14 | python -m stata_kernel.install 15 | conda install -c conda-forge nodejs -y 16 | jupyter labextension install jupyterlab-stata-highlight 17 | ipcluster nbextension enable 18 | jupyter contrib nbextension install --sys-prefix 19 | jupyter nbextension enable nbTranslate/main 20 | r -e "IRkernel::installspec()" 21 | --------------------------------------------------------------------------------