Skip to content

Latest commit

 

History

History
222 lines (182 loc) · 30.5 KB

README_OLD.md

File metadata and controls

222 lines (182 loc) · 30.5 KB

HitCount Star Fork Star

This is a work-in-progress course website for Mathematics for Economists, produced by Fan. Course covers a limited subset of topics from Mathematics for Economists (Simon and Blume 1994), and uses various definitions from the book. Applications focus on two period borrowing and savings problems. Matlab's symbolic toolbox is used throughout.

From Fan's other repositories: For dynamic borrowing and savings problems, see Dynamic Asset Repository; For matlab programming guides, see Project Reusable Matlab Code; For data analysis, see R Panel Data Code and Stata Example Code. See here for all of Fan's public repositories.

Materials are written in matlab livescript files and shown as HTML files. To obtain matlab codes, see here and here for github set up. For HTML files, click on the links below.

Files are from the Math4Econ repository. Please contact FanWangEcon for issues or problems.

1. Basic Calculus and Applications

1.1 Basics

  1. Real Number and Intervals: m | mlx | pdf | html
    • definition and draw a line
    • m: linspace, line, set(gca, yaxis off), pbaspect
  2. What is a Function?: m | mlx | pdf | html
    • domain, argument, do-domain, image/value, range
    • m: sin, plot, circle plot
  3. Function Notations: m | mlx | pdf | html
    • consistent function naming
  4. Interval Notations and Examples: m | mlx | pdf | html
    • closed, open intervals
  5. Monomial and Polynomial: m | mlx | pdf | html
    • monomial, polynomial, degree of polynomial
    • m: syms x, f(x) = a + x, fplot(@(x) f(x,a), [x_low, x_high])
  6. Local and Global Maximum: m | mlx | pdf | html
    • local and global maximum,
    • m: syms x, f(x) = x - x^2, double(solve(diff(f,x),x)), fplot(f,[x_low, x_high])

1.2 Derivatives

  1. Derivative Definition and Rules: m | mlx | pdf | html
    • derivative notations, limit definition, and key rules
    • m: syms, diff
  2. Continuity and Differentiability: m | mlx | pdf | html
    • Continuous point, set and function, continuously differentiable
  3. Elasticity and Derivative: m | mlx | pdf | html
    • elasticity of demand at price p, given h change in p
    • point elasticity of demand at price p
    • elasticity and the limiting definition of derivative
  4. First Order Taylor Approximation: m | mlx | pdf | html
    • differential: change along the tangent line to approximate change in function value
    • first order taylor approximation and the limiting definition of derivative
    • differential approximating marginal productivity of labor
    • m: syms L, f(L) = L^a, sub(f, 1)
  5. Higher Order Derivatives: m | mlx | pdf | html
    • Cobb-Douglas Production Function, first and second derivatives
    • Convex and Concave functions
    • m: syms L, f(L) = L^a, diff(diff(f, L),L); fplot, title({'title one' 'subtitle'}) + ylabel({'ylab abc' 'ylab efg'}) + legend{['line a'],['lineb'],, 'Location','NW'}

1.3 Applications--Production Function

  1. Marginal Product of Labor: m | mlx | pdf | html
    • marginal product for each additional units of workers given different levels of capital
    • m: plot, scatter, legend(['k=',num2str(K1)], ['k=',num2str(K1)])
  2. Derivative of Cobb-Douglas Production Function: m | mlx | pdf | html
    • marginal product of labor given different levels of capitals
    • m: syms, diff, fplot
  3. Derivative Approximation: m | mlx | pdf | html
    • marginal product and tangent line
    • m: syms, diff, fplot, lengend{}

1.4 Applications--Demand and Supply

  1. Household's Savings Problem: m | mlx | pdf | html
    • edowments today and tomorrow, borrowing and savings, no shocks
    • grid based or analytical solution
    • supply curve of savings (asset)
    • m: max, diff, solve; plot, scatter
  2. Firm's Borrowing Problem: m |mlx | pdf | html
    • profit maximization choosing capital, with labor fixed
    • grid based or analytical solution
    • demand curve of capital (asset)
    • overlay demand and supply curves, visualize interest rate equilibrium
    • m: max, diff, solve; plot, scatter

1.5 Application--Risky Asset

  1. Risky Assets and Different States of the World: m | mlx | pdf | html
    • bad and good states of the world
    • safe savings and risky investments with uncertain returns
    • borrowing to finance risky investments
    • m: solve(diff(U, D)==0, diff(U, B)==0, D, B)

2. Exponential and Log

  1. Exponential and Infinitely Compounding Interest Rate: m | mlx | pdf | html
    • exponential function and rules: a^b
    • base e exponential, e = 2.71828
    • infinitely compounding interest rate (continuous time)
    • e^r: borrow 1 dollar, given r, meaning r percent interest, e^r is how much to pay back in principle + interests given infinite compounding.
    • m: exp, fplot, double(subs())
  2. Exponential Function and Log Function: m |mlx | pdf | html
    • log and natural log (log in matlab base e, log in google base 10)
    • log rules, and why: log(xy) = log(x) + log(y); log(x^a) = alog(x)
    • log difference and small rates of change

3. Matrix

3.1 Basics

  1. Laws of Matrix Algebra: m |mlx | pdf | html
    • Scalar: Associative + Communtative + Distributive Law Laws
    • Matrix: all apply except A times B != B times A
    • m: transpose
  2. Matrix Addition and Multiplication: m |mlx | pdf | html
    • scalar and matrix
    • matrix dimensions
    • m: dot product
  3. Creating Matrixes in Matlab: m |mlx | pdf | html
    • vectors, matrixes and multiple matrixes
    • m: ceil, eye, tril, triu, rand(N,M,Q)

3.2 Matrix System of Equations

  1. System of Linear Equations: m |mlx | pdf | html
    • one or multiple linear equations
    • coefficient matrix and augmented form
  2. Solving for Two Equations and Two Unknowns: m |mlx | pdf | html
    • two equations and two unknowns matrix form
    • graphical intersection of two lines
    • using linear solver linsolve
    • m: linsolve, double(solve(y_1 - y_2 == 0))
  3. System of Linear Equations, Row Echelon Form: m |mlx | pdf | html
    • two equations and two unknowns
    • elementary row operations and row echelon form

3.3 Applications--Firm's Problem

  1. Firm Maximization Problem with Capital and Labor: m | mlx | pdf | html
    • first order conditions Cobb-Douglas production function with Capital and Labor
    • log linearize first order conditions
    • matrix form and linsolve Cobb-Douglas production function
    • own and cross price elasticities
    • m: linsolve, simplify(exp(linsolve())), meshgrid mesh, contourf, clabel, zlabel

3.4 Applications--Household's Problem

  1. Household Maximization with Two Goods and Budget: m | mlx | pdf | html
    • preference over two good, cobb douglas utility
    • indifference curves and budget set
    • m: linspace, meshgrid, mesh, contourf, clabel, colormap, zlabel, plot

3.5 Applications--Approximate Demand and Supply

  1. First Order Taylor Approximation of Demand and Supply Curves: m | mlx | pdf | html
    • simplified nonlinear form of demand and supply as functions or the interest rate
    • first order Taylor linear approximation of nonlinear demand and supply
    • m: diff, subs(S,r,1), linsolve
  2. Capital Demand and Supply Equilibrium Analysis: m | mlx | pdf | html
    • exact solutions for (approximated) equilibrium interest rate and asset supply/demand given linearized demand and supply equations
    • graphical illustration of exact equilibrium and linear approximated equilibrium
    • analyze how productivity, elasticity, wealth, discount factor impact equilibrium prices and quantity given exact solutions to linear approximation
    • m: linspace, subs(diff(S,r), r, r0), subs(D, {Z,beta}, {Z_num, beta_num}); fplot, plot, line.Color, line.LineStyle

4. Equality Constrained Optimization

4.1 Firm's Problems

  1. Constrained Profit Maximization and Cost Minimization: m | mlx | pdf | html
    • COO's problem: profit maximization and cost minimization with Cobb Douglas production function given quantity constraint constant or decreasing returns to scales
    • Lagrangian, Gradient and Hessian
    • optimal capital and labor given quantity constraint for constant
    • m: GRADIENT = subs(GRADIENT, {A,p,w,r,q,alpha,beta},{1,1,1,1,2,0.3,0.7});solu = solve(GRADIENT(1)==0, GRADIENT(2)==0, GRADIENT(3)==0, K, L, m, 'Real', true);
  2. Firm Marginal Cost and Profit given Constant Returns to Scale: m | mlx | pdf | html
    • CEO's problem: profit maximization over outputs given COO solutions
    • marginal costs and constant returns to scales, perfect competition and zero profits

4.2 Household's Problems

  1. Marshallian Constrained Utility Maximization: m | mlx | pdf | html
    • budget constrained intertemporal utility maximization
    • Marshallian solutions, indirect utility
    • analytical solution, matlab symbolic solution, matlab fminunc numerical solutions
    • m: diff, gradient; fmincon
  2. Hicksian Constrained Expenditure Minimization: m | mlx | pdf | html
    • optimal expenditure minimization choice given indirect utility
    • Hicksian solutions (Dual Problem)
    • analytical solution, matlab symbolic solution
    • m: diff, gradient
    • graph: budget, indifference, endowment and optimal choices
  3. Income and Substitution Effects: m | mlx | pdf | html
    • Slusky decomposition, expenditure minimization given two prices
    • analytical solution, matlab symbolic solution
    • m: diff, gradient
    • graph: budget, indifference, two prices, substitution effects

5. Inequality Constrained Optimization

5.1 Firm's Problems

  1. Firm Profit Maximization Problem with Borrowing Constraint: m | mlx | pdf | html
    • constrained on capital/borrowing, solve for cases
    • if constraint binds, re-optimize labor choice given capital bound

5.2 Households' Problems

  1. Borrowing and Savings with Borrowing Constraint: m | mlx | pdf | html
    • unconstrained and constrained problem
    • analytical solution and fmincon solution
    • optimal borrowing/savings with varying endowments and interests rates
  2. Labor and Borrowing/Savings Choices with Borrowing Constraint: m | mlx | pdf | html
    • unconstrained work/leisure and borrow/savings problem
    • constrained work/leisure and borrow/savings problem given borrow bound
    • analytical and matlab symbolic solutions
    • numerical solution with fmincon
    • optimal work/leisure and borrowing/savings with varying preference

6. Equilibrium and Government Policy

  1. Equilibrium Interest Rate
  2. Equilibrium Interest Rate and Wage

Please contact for issues or problems.

RepoSize CodeSize Language Release License