• Introductory Mathematics for Economists with Matlab
  • Preface
  • 1 Notations and Functions
    • 1.1 Real Number and intervals
      • 1.1.1 Real Number Line
      • 1.1.2 Non-negative numbers
    • 1.2 Interval Notations and Examples
      • 1.2.1 Closed Interval
      • 1.2.2 Open Interval
      • 1.2.3 Half Open and Half Close Interval
      • 1.2.4 Graph
    • 1.3 What is a Function?
    • 1.4 Function Notations
    • 1.5 Graphing Monomials and Polynomial of the 3rd Degree
      • 1.5.1 Monomial
      • 1.5.2 Polynomial
      • 1.5.3 Graphical Monomial Examples
      • 1.5.4 Polynomial of Degree Three
      • 1.5.5 Mononomials Function
      • 1.5.6 Polynomial of Degree Three Function
    • 1.6 Local and Global Maximum
  • 2 Commonly Used Functions
    • 2.1 Exponentiation and Compounding Interest Rate
      • 2.1.1 Exponential Function
      • 2.1.2 Exponential Function Graphs?
      • 2.1.3 Infinitely Compounding Interest rate
      • 2.1.4 Infinitely compounding Interest rate, different \(r\) (APR \(r\))
    • 2.2 Natural Logarithm and Exponential
      • 2.2.1 Log and Exponential
      • 2.2.2 Log Rules
      • 2.2.3 Why does \(\log (x\cdot y)=\log (x)+\log (y)\)?
      • 2.2.4 Why does \(\log (x^a )=a\cdot \log (x)\)?
      • 2.2.5 For Variables that Grow, Log difference is close to rate of change
  • 3 Derivatives
    • 3.1 Derivative Definition and Rules
      • 3.1.1 Linear and Non-linear Functions
      • 3.1.2 Definition
      • 3.1.3 Derivative Rules–Constant Rule
      • 3.1.4 Derivative Rules–Power Rule (Polynomial Rule)
      • 3.1.5 Derivative Rules–Chain Rule
      • 3.1.6 Derivative Rules–Sum (and difference) Rule
      • 3.1.7 Derivative Rules–Product Rule
      • 3.1.8 Derivative Rules–Quotient Rule
      • 3.1.9 Derivative Rules–Exponential
      • 3.1.10 Derivative Rules–Log
    • 3.2 Continuity and Differentiability
      • 3.2.1 Definition Continuous
      • 3.2.2 Definition Continuously Differentiable
    • 3.3 Elasticity and Derivative
      • 3.3.1 Demand and Supply
      • 3.3.2 How does demand (or supply) respond to a change in price?
      • 3.3.3 How sensitive are demands to price changes?
      • 3.3.4 Point Elasticity and Derivative
      • 3.3.5 Inelastic, elastic and unit elastic
    • 3.4 Differential and Marginal Product
      • 3.4.1 MPL for Cobb-Douglas
      • 3.4.2 Interpreting MPL
      • 3.4.3 Exact Output Calculated with Matlab
      • 3.4.4 Approximate Output Increase with Derivative (MPL)
      • 3.4.5 First Order Taylor Polynomial Approximation
    • 3.5 Higher Order Derivatives–Cobb Douglas
      • 3.5.1 Curvature and Second Derivative, Concave Function
      • 3.5.2 Curvature and Second Derivative, Convex Function
  • 4 Univariate Applications
    • 4.1 Marginal Product of Labor
      • 4.1.1 Marginal Product of Additional Workers (Discrete Workers)
      • 4.1.2 Using Derivative to approximate Increase in Output from More Workers
      • 4.1.3 Marginal Product of Additional Workers Different Capital (Discrete Workers)
    • 4.2 Derivative of Cobb-Douglas Production Function
      • 4.2.1 Marginal Output Per Worker Holding Capital Fixed
      • 4.2.2 Marginal Productivity Graph at Fixed Capital Level
      • 4.2.3 Marginal Product of Labor at different Capital Levels
    • 4.3 Derivative Approximation of Marginal Product
      • 4.3.1 Cobb-Douglas–Output as a Function of Capital
      • 4.3.2 Cobb-Douglas–Tangent line as h gets smaller
    • 4.4 Utility Maximization and Intertemporal Consumption
      • 4.4.1 Model Components and Maximization Problem
      • 4.4.2 Open set for Choice set
      • 4.4.3 Finding Optimal Choices–Brute Force Grid
      • 4.4.4 Analytical Solution
      • 4.4.5 Supply Curve For Capital
    • 4.5 Profit Maximization over Capital and Labor
      • 4.5.1 Model Components and Maximization Problem
      • 4.5.2 Finding Optimal Choices–Brute Force Grid
      • 4.5.3 Analytical Solution
      • 4.5.4 Demand Curve For Capital
      • 4.5.5 Demand and Supply Intersection
  • 5 Matrix Basics
    • 5.1 Laws of Matrix Algebra
      • 5.1.1 6 Old Rules, 5 Still Apply
      • 5.1.2 Example for \(A\cdot B\not= B\cdot A\)
      • 5.1.3 4 New Rules for Transpose
    • 5.2 Matrix Addition and Multiplication
      • 5.2.1 Scalar Multiplication/Division, Addition/Subtraction
      • 5.2.2 Addition and Subtraction
      • 5.2.3 Matrix Multiplication
    • 5.3 Creating Matrixes in Matlab
      • 5.3.1 Matlab Define Row and Column Vectors (Matrix)
      • 5.3.2 Matlab Define a Matrix
      • 5.3.3 Matlab Define a Square Matrix
      • 5.3.4 Identity Matrix
      • 5.3.5 Lower-Triangular Matrix and Upper-Triangular Matrix
      • 5.3.6 Three Dimensions Matrix (Tensor)
  • 6 System of Equations
    • 6.1 System of Linear Equations
      • 6.1.1 Linear Equation
      • 6.1.2 System of Linear Equations
      • 6.1.3 Augmented Form
    • 6.2 Solving for Two Equations and Two Unknowns
      • 6.2.1 Intersection of two Linear Equations
      • 6.2.2 Linear Equation in Matrix Form
      • 6.2.3 Two Linear Equation in Matrix Form
      • 6.2.4 Linsolve: Matlab Matrix Solution for 2 Equations and Two Unknowns
    • 6.3 System of Linear Equations, Row Echelon Form
      • 6.3.1 Two Equations and Two Unknowns
      • 6.3.2 Elementary Row Operations
      • 6.3.3 Row Echelon Form
      • 6.3.4 Row Echelon Form with 2 Equations and 2 Unknowns
      • 6.3.5 Reduced Row Echelon Form
      • 6.3.6 Reduced Row Echelon Form with 2 Equations and 2 Unknowns
    • 6.4 Matrix Inverse
      • 6.4.1 Inverse of a Matrix
      • 6.4.2 Rank of a Matrix
      • 6.4.3 Invertible Matrix
      • 6.4.4 Solving System of Equations using Inverse
  • 7 Matrix Applications
    • 7.1 Cobb Douglas Profit Maximization
      • 7.1.1 Firm and Capital and Labor
      • 7.1.2 Two First Order Conditions
      • 7.1.3 Log Linearizing Optimality Conditions
      • 7.1.4 Solving Linear System to find Optimal Choices
      • 7.1.5 Relative Choices
      • 7.1.6 Choices as a Function of \(w\) and \(r\)
      • 7.1.7 Own and Cross Price Elasticity
      • 7.1.8 Graphical Results for Optimal Choices
    • 7.2 Cobb Douglas Utility Maximization
      • 7.2.1 A Model with Two Goods
      • 7.2.2 Model Parameters
      • 7.2.3 Preference
      • 7.2.4 Budget
      • 7.2.5 Budget and Preference: Indifference Curves
    • 7.3 Equilibrium Interest Rate
      • 7.3.1 First Order Taylor Approximation
      • 7.3.2 Approximate the Supply
      • 7.3.3 Approximate the Demand
      • 7.3.4 Solve approximate Demand and Supply using a System of Linear Equations
    • 7.4 First Order Taylor Approximation
      • 7.4.1 Demand and Supply for Credit and \(a,b,h,k\)
      • 7.4.2 What are \(a,b,h,k\)?
      • 7.4.3 Exact Equlibrium Interest Rate
      • 7.4.4 Approximating Demand and Supply for Credit
      • 7.4.5 Graphical Ilustration
      • 7.4.6 Approximate Equilibrium in terms of Parameters
      • 7.4.7 Parameter Impacts on Equilibrium–Effects of changing \(A\)
      • 7.4.8 Parameter Impacts on Equilibrium–Effects of changing \(Z\)
      • 7.4.9 Parameter Impacts on Equilibrium–Effects of changing \(\beta\)
      • 7.4.10 Parameter Impacts on Equilibrium–Effects of changing \(\alpha\)
  • 8 Uncertainty
    • 8.1 Risky and Safe Assets
      • 8.1.1 Uncertainty
      • 8.1.2 Differential Returns Depending on the State of the World
      • 8.1.3 The Two Period Household Protofolio Choice Problem
      • 8.1.4 Household Maximization Problem
      • 8.1.5 First Order Conditions
      • 8.1.6 Marginal Utility and Marginal Returns
      • 8.1.7 Solving for Optimal Choices–Analytical Solution
      • 8.1.8 Solving for Optimal Chocies–Numerical Parameter Values
  • 9 Equality Constrained Optimization
    • 9.1 Cost Minimization Decreasing Returns
      • 9.1.1 Profit Maximization with Constraint
      • 9.1.2 Cost Minimization with Constraint
      • 9.1.3 Cost Minimization Problem–Optimal Capital Labor Choices
      • 9.1.4 Cost Minimization Problem–Solving on Matlab
    • 9.2 Profit Maximization Constant Returns
      • 9.2.1 What is the Profit of the firm at Constrained Optimal Choices?
      • 9.2.2 Profit Maximization and Marginal Cost
      • 9.2.3 Constant Return to Scale
      • 9.2.4 When will the Firm produce, and what is its Profit?
    • 9.3 Intertemporal Utility Maximization
      • 9.3.1 Utility Maximization over Consumption in Two Periods
      • 9.3.2 First Order Conditions of the Constrained Consumption Problem
      • 9.3.3 Optimal Relative Allocations of Consumptions in the First and Second Periods
      • 9.3.4 Optimal Consumption Choices
      • 9.3.5 Indirect Utility
      • 9.3.6 Optimal Borrowing and Savings Choices
      • 9.3.7 Computational Solution to the Equality Constrained Problem
      • 9.3.8 Fmincon Solution to the Constrained Problem
    • 9.4 Intertemporal Expenditure Minimization
      • 9.4.1 Utility Maximization over Consumption in Two Periods
      • 9.4.2 The Expenditure Minimization Problem
      • 9.4.3 First Order Conditions of the Constrained Consumption Problem
      • 9.4.4 Optimal Relative Allocations of Consumptions in the First and Second Periods
      • 9.4.5 Optimal Expenditure Minimization Consumption Choices
      • 9.4.6 Compuational Solution
      • 9.4.7 Graphical Representation
    • 9.5 Intertemporal Income and Substitution Effects
      • 9.5.1 Utility Maximization over Consumption in Two Periods
      • 9.5.2 Solving for the Substitution Effect
      • 9.5.3 Optimal Consumption Choices with Different Interest Rates
      • 9.5.4 Graphical Illustration of the Income and Substitution Effect
  • 10 Inequality Constrained Optimization
    • 10.1 Borrowing Constrained Profit Maximization
      • 10.1.1 Firm and Capital and Labor
      • 10.1.2 Lagrangian and First Order Conditions
      • 10.1.3 Solving for Different Cases
      • 10.1.4 Solution
    • 10.2 Constrained Borrowing and Savings
      • 10.2.1 What is the constrained borrowing problem?
      • 10.2.2 Inequality Constraint
      • 10.2.3 Lagrangian with Inequality Constraint
      • 10.2.4 Derivative with Respect to \(b\)
      • 10.2.5 First Order Conditions with Inequality Constraint
      • 10.2.6 Solving the Problem
      • 10.2.7 Effects of \(Z_2\) on optimal choices
      • 10.2.8 Effects of \(r\) on optimal choices
    • 10.3 Leisure, Savings and Constrained Borrowing
      • 10.3.1 What is the constrained asset choice problem with labor?
      • 10.3.2 Single Inequality Constraint Problem
      • 10.3.3 Unconstrained Optimal Labor and Borrowing and Savings Choices Prlbme
      • 10.3.4 Numerical Solution to the Inequality Constraint Problem
      • 10.3.5 Effects of \(\psi\) on optimal choices
      • 10.3.6 Effects of \(r\) and \(z_2\) on optimal choices
  • 11 Equilibrium and Policy
    • 11.1 Equilibrium Interest Rate and Tax
      • 11.1.1 How do households with different \(\beta\) respond to changes in \(r\) given Borrowing Constraint?
      • 11.1.2 Aggregate Household Excess Supply along Interest Rate
      • 11.1.3 Firm Demand for Credit
      • 11.1.4 Economy Wide Excess Supply for Credit (Firm + Households)
      • 11.1.5 Demand and Supply for Credit with a Tax on Interest Rate
    • 11.2 Equilibrium Interest Rate and Wage Rate
      • 11.2.1 Household and Firm’s Problem
      • 11.2.2 Setting Up Parameters
      • 11.2.3 Household Labor Supply and Borrow/Save with different \(\beta\) and \(r\) ?
      • 11.2.4 Firm’s Demand for Capital and Labor
      • 11.2.5 Demand and Supply for Capital
      • 11.2.6 Demand and Supply for Labor Demand and Supply
      • 11.2.7 Excess Demand for Capital and Labor
      • 11.2.8 \(w\) and \(r\) Equilibrium
  • Appendix
  • A Index and Code Links
    • A.1 Notations and Functions links
    • A.2 Commonly Used Functions links
    • A.3 Derivatives links
    • A.4 Univariate Applications links
    • A.5 Matrix Basics links
    • A.6 System of Equations links
    • A.7 Matrix Applications links
    • A.8 Uncertainty links
    • A.9 Equality Constrained Optimization links
    • A.10 Inequality Constrained Optimization links
    • A.11 Equilibrium and Policy links
  • Math4Econ Bookdown

Introductory Mathematics for Economists with Matlab

A Index and Code Links

A.1 Notations and Functions links

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

A.2 Commonly Used Functions links

  1. Exponential and Compounding Interest Rates: mlx | m | 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.
    • Log linear equation with a constant term, substraction and division.
    • m: exp() + fplot() + double(subs())
  2. Exponential and Log Functions: mlx | m | 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.
    • m: linspace() + log()

A.3 Derivatives links

  1. Derivative Definition and Rules: mlx | m | pdf | html
    • Derivative notations, limit definition, and key rules.
    • m: syms + diff()
  2. Continuity and Differentiability: mlx | m | pdf | html
    • Continuous point, set and function, continuously differentiable.
  3. Elasticity and Derivative: mlx | m | 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: mlx | m | 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 + f(L) = L^a + sub(f, 1)
  5. Higher Order Derivatives Cobb Douglas: mlx | m | pdf | html
    • Cobb-Douglas production function, first and second derivatives.
    • Convex and Concave functions.
    • m: syms + 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’}

A.4 Univariate Applications links

  1. Marginal Product of Labor: mlx | m | 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: mlx | m | pdf | html
    • Marginal product of labor given different levels of capitals.
    • m: syms + diff() + fplot()
  3. Derivative Approximation: mlx | m | pdf | html
    • Marginal product and tangent lines.
    • m: syms + diff() + fplot() + lengend{}
  4. Household’s Savings Problem: mlx | m | pdf | html
    • Endowments today and tomorrow, borrowing and savings, no shocks.
    • Grid based or analytical solution.
    • Supply curve of savings (asset).
    • m: max() + diff() + solve() + plot() + scatter()
  5. Firm’s Borrowing Problem: mlx | m | 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()

A.5 Matrix Basics links

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

A.6 System of Equations links

  1. System of Linear Equations: mlx | m | pdf | html
    • One or multiple linear equations.
    • Coefficient matrix and augmented form.
  2. Solving for Two Equations and Two Unknowns: mlx | m | 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: mlx | m | pdf | html
    • Two equations and two unknowns.
    • Elementary row operations and row echelon form.
  4. Matrix Inverse: mlx | m | pdf | html
    • Find the inverse of a matrix.

A.7 Matrix Applications links

  1. Firm Maximization Problem with Capital and Labor: mlx | m | 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())) + mesh() + meshgrid() + contourf() + clabel() + zlabel()
  2. Household Maximization with Two Goods and Budget: mlx | m | pdf | html
    • Preference over two good, cobb douglas utility.
    • Indifference curves and budget set.
    • m: linspace() + meshgrid() + mesh() + contourf() + clabel() + colormap() + zlabel() + plot()
  3. Capital Demand and Supply Equilibrium Analysis: mlx | m | 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()
  4. First Order Taylor Approximation of Demand and Supply Curves: mlx | m | 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

A.8 Uncertainty links

  1. Risky Assets and Different States of the World: mlx | m | 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)

A.9 Equality Constrained Optimization links

  1. Profit Maximization and Cost Minimization: mlx | m | pdf | html
    • Profit maximization and cost minimization with Cobb Douglas production function given quantity constraint. Constant or decreasing returns to scales, optimal capital and labor given quantity constraint.
    • 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: mlx | m | pdf | html
    • Profit maximization over outputs given cost minimization.
    • Marginal costs and constant returns to scales, perfect competition and zero profits.
  3. Marshallian Constrained Utility Maximization: mlx | m | pdf | html
    • Budget constrained intertemporal utility maximization.
    • Marshallian solutions, indirect utility
    • Analytical solution, matlab symbolic solution, matlab fminunc numerical solutions
    • m: diff() + gradient() + fmincon()
  4. Hicksian Constrained Expenditure Minimization: mlx | m | 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
  5. Income and Substitution Effects: mlx | m | pdf | html
    • Slusky decomposition, expenditure minimization given two prices.
    • Analytical solution, matlab symbolic solution.
    • m: diff() + gradient()

A.10 Inequality Constrained Optimization links

  1. Firm Profit Maximization Problem with Borrowing Constraint: mlx | m | pdf | html
    • Constrained on capital/borrowing, solve for cases.
    • If constraint binds, re-optimize labor choice given capital bound.
  2. Borrowing and Savings with Borrowing Constraint: mlx | m | pdf | html
    • Unconstrained and constrained problem.
    • Analytical solution and fmincon solution.
    • Optimal borrowing/savings with varying endowments and interests rates.
    • m: U = @(b) log(z1 - b) + matlabFunction(subs(U, {z1, z2}, {z1v, z2v})); + fmincon(U, b0, A, q); + optimoptions(‘FMINCON,’‘Display,’‘off’);
  3. Labor and Borrowing/Savings Choices with Borrowing Constraint: mlx | m | 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.
    • m: d_L_b = diff(L, b); + d_L_H = diff(L, H); + GRAD = [d_L_b; d_L_H] + solu = solve(GRAD(1)==0, GRAD(2)==0, b, H, ‘Real,’ true); + solu = simplify(solu) + fmincon(U_neg, b0, A, q) + fmincon(U_neg, b0, A, q, [], [], [], [], [], options) + legendCell = cellstr(num2str(Z2_vec’, ‘Z2=%-d’)) + plot()

A.11 Equilibrium and Policy links

  1. Equilibrium Interest Rate and Tax: mlx | m | pdf | html
    • Households supply savings or borrow (with constraint) to smooth consumption.
    • Firms borrow to finance capital inputs.
    • Solve for excess demand and supply of assets and equilibrium interest rate.
    • The effect of a tax on savings and subsidy for borrowing on equilibrium interest rate.
    • m: U_neg = @(x) -1(log(z1 - x(1)) + beta_vec(j)log(z2 + x(1)r_vec(i)(1-tau))) + excess_credit_supply = (sum(b_opti_mat, 2) + (-1)FIRM_K’) + min(abs(excess_credit_supply)) + plot(r, excess_credit_supply)*
  2. Equilibrium Interest Rate and Wage: mlx | m | pdf | html
    • Households supply labor and enjoy leisure, firms demand labor.
    • Households borrow with constraints and supply savings, firm demand capital.
    • Solve for excess supply of assets and labor over wage and interest rates grid.
    • Solve for market clearing wage and interest rates.
    • m: U_neg = @(x) -1(log(z1 + W_vec(j)x(2) - x(1)) + psilog(x(3)) + beta_vec(h)log(z2 + x(1)(R_vec(i)))) + options = optimoptions(‘FMINCON,’‘Display,’‘off’); + [x_opti,U_at_x_opti] = fmincon(U_neg, b0, A, q, [], [], [], [], [], options); + KD(i,j) = subs(K_opti,{r,w},{R(i), W(j)}) + LD(i,j) = subs(L_opti,{r,w},{R(i), W(j)}) + jet(numel(chart)) + plot(R, b_opti); + plot(R, -k_opti);*
Simon, Carl P, and Lawrence Blume. 1994. Mathematics for Economists. 2nd ed. New York City, New York: W. W. Norton & Company. https://wwnorton.com/books/9780393957334/.
The MathWorks Inc. 2019. MATLAB. https://www.mathworks.com/products/matlab.html.
Xie, Yihui. 2020. Bookdown: Authoring Books and Technical Documents with r Markdown. https://CRAN.R-project.org/package=bookdown.