#!/usr/bin/env python # coding: utf-8 # # CompEcon Demos # The following lists show all the demo files that are available in the MATLAB version of CompEcon, by Mario Miranda and Paul Fackler. Some of these demos have been ported to Python; for them a hyperlink to the correspoding Jupyter notebook is provided. # # _Randall Romero-Aguilar_ # # April 2016 # # Last updated: July 22, 2018 # ## Introduction # * demintro01 -- [Inverse Demand Problem]() # * demintro02 -- [Rational Expectations Agricultural Market Model](<"intro/02 Rational Expectations Agricultural Market Model.ipynb">) # ## Mathematics Review # * demmath01 -- [Taylor Approximations]() # * demmath02 -- [Computing Function Inner Products, Norms & Metrics]() # * demmath03 -- [Continuous Distribution CDFs and PDFs]() # * demmath04 -- Standard Copulas # * demmath05 -- Illustrates Implicit Function Theorem # * demmath06 -- Simulate Simple Markov Chain # * demmath07 -- Operations with Markov Chains # ## Linear Equations # * demlin01 -- Solving Linear Equations by Different Methods # * demlin02 -- Ill-Conditioning of Vandermonde Matrix # * demlin03 -- Sparse Linear Equations # ## Nonlinear Equations # * demslv01 -- [Compute Root of f(x)=exp(-x)-1]() # * demslv02 -- [Compute Root of Rosencrantz Function]() # * demslv03 -- [Compute Fixedpoint of f(x) = x^0.5]() # * demslv04 -- [Compute Fixedpoint of f(x1,x2)= x1^2+x2^3;x1*x2-0.5]() # * demslv05 -- [Illustrates Newton and Broyden Paths]() # * demslv06 -- [Illustrates Function Iteration, Newton, and Secand Methods]() # * demslv07 -- [Linear Complementarity Problem Methods]() # * demslv08 -- [Nonlinear Complementarity Problem Methods]() # * demslv09 -- [Hard Nonlinear Complementarity Problem with Billup's Function]() # * demslv10 -- [Illustrates Linear Complementarity Problem]() # * demslv11 -- Nonlinear Complementarity Problem Methods # * demslv12 -- [Convergence Rates for Nonlinear Equation Methods]() # * demslv13 -- [Simple Nonlinear Complementarity Problem]() # * demslv14 -- [Spatial Equilibrium Model]() # ## Finite-Dimensional Optimization # * demopt01 -- Maximization via Golden Search # * demopt02 -- Changes in Nelder-Mead Simplex # * demopt03 -- Nelder-Mead Simplex Method # * demopt04 -- [Maximization of Banana Function, Various Methods]() # * demopt05 -- [Optimization with qnewton]() # * demopt06 -- [KKT Conditions for Constrained Optimization Problems]() # * demopt07 -- Bound Constrained Optimization via Sequential LCP # * demopt08 -- [Constrained Optimization with nlpsolve]() # ## Quadrature # * demqua01 -- [Equidistributed Sequences on Unit Square in R^2]() # * demqua01bis -- [Computing Integral with quasi-Monte Carlo methods]() # * demqua02 -- Compute Expectation of Function of Random Normal Vector # * demqua03 -- [Area under 1-D and 2-D Curves, Various Methods]() # * demqua04 -- [Area under Normal PDF Using Simpson's Rule]() # * demqua05 -- Willingness to Pay, Expected Utility Model # * demqua06 -- [Area under a Curve]() # * demqua07 -- [Integration Using Trapezoidal Rule]() # * demqua08 -- [Integration Using Simpson's Rule]() # * demqua09 -- Chebychev and Legendre Quadrature Nodes and Weights # * demqua10 -- [Monte Carlo Simulation of Time Series]() # ## Numerical Differentiation # * demdif01 -- Finite Difference Hessian Evaluation # * demdif02 -- Error in Finite Difference Differentiation # * demdif03 -- Demonstrates fdjac and checkjac # * demdif04 -- Demonstrates fdhess # * demdif02 -- [Demonstrates accuracy of one- and two-sided-difference derivatives]() # ## Function Approximation # * demapp00 -- [Approximating using CompEcon toolbox]() # * demapp01 -- [Approximating Functions on R]() # * demapp02 -- [Approximating Functions on R^2]() # * demapp03 -- [Basis Functions and Standard Nodes for Major Approximation Schemes](<03 Basis functions and standard nodes for major approximation schemes.ipynb>) # * demapp04 -- [Uniform-Node and Chebychev-Node Polynomial Approximation of Runge's Function]() # * demapp05 -- [Chebychev Polynomial and Spline Approximation of Various Functions]() # * demapp06 -- [Chebyshev and Cubic Spline Derivative Approximation Errors]() # * demapp07 -- [Solve Cournot Oligopoly Model via Collocation]() # * demapp08 -- [Compute Function Inverse via Collocation]() # * demapp09 -- [Linear Spline Approximation]() # * demapp10 -- [Monopolist's Effective Supply Function]() # ## Discrete Time Discrete State Dynamic Programming # * demddp01 -- [Mine Management Model]() # * demddp02 -- [Asset Replacement Model]() # * demddp03 -- [Asset Replacement Model With Maintenance]() # * demddp04 -- Binomial American Put Option Model # * demddp05 -- Water Management Model # * demddp06 -- Bioeconomic Model # * demddp07 -- Renewable Resource Model # * demddp08 -- Job Search Model # * demddp09 -- Deterministic Cow Replacement Model # * demddp10 -- Stochastic Cow Replacement Model # * demddp11 -- Stochastic Optimal Growth Model # ## Discrete Time Continuous State Dynamic Programming # * demdp01 -- [Timber Harvesting Model]() # * demdp01a -- [Timber Harvesting -- 2 nodes]() # * demdp01b -- [Timber Harvesting -- cubic spline]() # * demdp02 -- [Asset Replacement]() # * demdp03 -- [Industry Entry-Exit]() # * demdp04 -- [Job Search]() # * demdp05 -- [American Put Option Pricing]() # * demdp06 -- [Ramsey Economic Growth Model]() # * demdp07 -- [Stochastic Economic Growth]() # * demdp08 -- [Public Renewable Management]() # * demdp09 -- [Private Non-Renewable Resource Management]() # * demdp10 -- [Water Resource Management]() # * demdp11 -- [Monetary Policy]() # * demdp12 -- [Production Management]() # * demdp13 -- Inventory Management # * demdp14 -- Livestock Feeding (Euler Conditions) # * demdp15 -- Saving with Transactions Costs # * demdp16 -- [Linear-Quadratic Problem]() # * demdp17 -- Miscellaneous Lecture Note Figures # * demdp18 -- Credit With Technology Adopttopm # * demdp19 -- Credit with Strategic Default (Broyden) # * demdp20 -- Lifecycle Consumption-Savings # * demdp21 -- Savings and Insurance Model # * demdp22 -- Savings and Insurance Model - Alternate, Under Development # * demdp23 -- Ferility Decision Model - Under Development # ## Rational Expectations Models # * dem rem01 -- Asset Pricing Model # * dem rem02 -- Commodity Storage Model # * dem rem03 -- Government Price Support Model # ## Dynamic Games # * dem game01 -- Production Capacity Game # * dem game02 -- Income Redistribution Game # * dem game03 -- Marketing Board Game # ## Ordinary Differential Equations # * dem ode01 -- Stability of Linear ODEs # * dem ode02 -- Generic Nonlinear ODE Example # * dem ode03 -- IVP Linear ODE Example # * dem ode04 -- Non-IVP Linear ODE Example # * dem ode05 -- Commodity Storage Model # * dem ode06 -- Predator-Prey Model # * dem ode07 -- Commercial Fisheries Model # * dem ode08 -- Lorentz Strange Attractor # * dem ode09 -- Tobin's Q # * dem ode10 -- Regional Migratio Model # ## Continuous Time Deterministic Optimal Control # * dem doc01 -- Deterministic Optimal Economic Growth Model # * dem doc02 -- Deterministic Nonrenewable Resource Model # * dem doc03 -- Deterministic Renewable Resource Model # * dem doc04 -- Deterministic Optimal Fish Harvest Model # * dem doc05 -- Deterministic Production-Adjustment Model # ## Continuous Time Stochastic Optimal Control # * dem soc00 -- Ito Processes # * dem soc01 -- Stochastic Optimal Economic Growth Model # * dem soc02 -- Stochastic Nonrenewable Resource Model # * dem soc03 -- Stochastic Renewable Resource Model # * dem soc04 -- Stochastic Optimal Fish Harvest Model # * dem soc05 -- Stochastic Production-Adjustment Model # ## Regime Switching Problems # * dem rs01 -- Asset Abandonment Model # * dem rs02 -- Fish Harvest Model # * dem rs03 -- Dixit Entry/Exit Model # ## Impulse Control Problems # * dem ic01 -- Asset Replacement Model # * dem ic02 -- Timber Harvesting Model # * dem ic03 -- Storage Management Model # * dem ic04 -- Capacity Choice Model # * dem ic05 -- Cash Management Model # * dem ic06 -- Fish Harvest Model # ## Financial Asset Pricing # * dem fin01 -- Cox-Ingersoll-Ross Bond Pricing Model # * dem fin02 -- Black-Scholes Option Pricing Model # * dem fin04 -- American Put Option Pricing # * dem fin05 -- Barrier Option Pricing # * dem fin06 -- Compound Bond Option Pricing # * dem fin07 -- Asian Option Pricing # * dem fin08 -- Affine Asset Pricing # * dem fin09 -- Financial Asset Calibration