Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.


A.1 Differentiation Rules

Basic rules. For differentiable functions f,gf, g and constant cc:

RuleFormula
Constant(c)=0(c)' = 0
Power(xn)=nxn1(x^n)' = nx^{n-1}
Sum(f+g)=f+g(f+g)' = f' + g'
Product(fg)=fg+fg(fg)' = f'g + fg'
Quotient(f/g)=(fgfg)/g2(f/g)' = (f'g - fg')/g^2
Chain(f(g(x)))=f(g(x))g(x)(f(g(x)))' = f'(g(x))\cdot g'(x)
InverseIf y=f1(x)y = f^{-1}(x): dy/dx=1/f(y)dy/dx = 1/f'(y)

Common functions:

FunctionDerivative
exe^xexe^x
axa^xaxlnaa^x\ln a
lnx\ln x1/x1/x
logax\log_a x1/(xlna)1/(x\ln a)
sinx\sin xcosx\cos x
cosx\cos xsinx-\sin x
arctanx\arctan x1/(1+x2)1/(1+x^2)

Implicit differentiation. If F(x,y)=0F(x, y) = 0 defines yy as a function of xx: dy/dx=Fx/Fydy/dx = -F_x/F_y.

Logarithmic differentiation. For y=f(x)g(x)y = f(x)^{g(x)}: lny=g(x)lnf(x)\ln y = g(x)\ln f(x), then differentiate both sides.

A.2 Integration Formulas

IntegrandAntiderivative
xnx^n (n1n\neq-1)xn+1/(n+1)x^{n+1}/(n+1)
1/x1/x$\ln
eaxe^{ax}eax/ae^{ax}/a
lnx\ln xxlnxxx\ln x - x
sinax\sin axcos(ax)/a-\cos(ax)/a
cosax\cos axsin(ax)/a\sin(ax)/a
1/(1+x2)1/(1+x^2)arctanx\arctan x

Integration by parts: udv=uvvdu\int u\,dv = uv - \int v\,du.

Gaussian integral: eax2dx=π/a\int_{-\infty}^\infty e^{-ax^2}dx = \sqrt{\pi/a} for a>0a > 0.

Present value integral: 0eρtf(t)dt=L{f}(ρ)\int_0^\infty e^{-\rho t}f(t)dt = \mathcal{L}\{f\}(\rho) (Laplace transform at ρ\rho).

A.3 Taylor Series Expansions

f(x)=n=0f(n)(a)n!(xa)n(Taylor series around a)f(x) = \sum_{n=0}^\infty\frac{f^{(n)}(a)}{n!}(x-a)^n \quad \text{(Taylor series around }a\text{)}

Standard expansions around 0:

FunctionExpansion
exe^x1+x+x2/2!+x3/3!+1 + x + x^2/2! + x^3/3! + \cdots
ln(1+x)\ln(1+x)xx2/2+x3/3x - x^2/2 + x^3/3 - \cdots ($
(1+x)α(1+x)^\alpha1+αx+α(α1)2x2+1 + \alpha x + \frac{\alpha(\alpha-1)}{2}x^2 + \cdots
1/(1x)1/(1-x)1+x+x2+x3+1 + x + x^2 + x^3 + \cdots ($
sinx\sin xxx3/6+x5/120x - x^3/6 + x^5/120 - \cdots
cosx\cos x1x2/2+x4/241 - x^2/2 + x^4/24 - \cdots

Key approximations (small xx): ln(1+x)x\ln(1+x) \approx x, (1+x)α1+αx(1+x)^\alpha \approx 1 + \alpha x, ex1+x+x2/2e^x \approx 1 + x + x^2/2.

A.4 Matrix Identities

Woodbury identity: (A+UCV)1=A1A1U(C1+VA1U)1VA1(A + UCV)^{-1} = A^{-1} - A^{-1}U(C^{-1}+VA^{-1}U)^{-1}VA^{-1}.

Sherman–Morrison: (A+uv)1=A1A1uvA11+vA1u(A + \mathbf{u}\mathbf{v}')^{-1} = A^{-1} - \frac{A^{-1}\mathbf{u}\mathbf{v}'A^{-1}}{1+\mathbf{v}'A^{-1}\mathbf{u}}.

Matrix determinant lemma: det(A+uv)=(1+vA1u)det(A)\det(A + \mathbf{u}\mathbf{v}') = (1+\mathbf{v}'A^{-1}\mathbf{u})\det(A).

Trace and determinant: tr(AB)=tr(BA)\text{tr}(AB) = \text{tr}(BA). det(AB)=det(A)det(B)\det(AB) = \det(A)\det(B). det(A1)=1/det(A)\det(A^{-1}) = 1/\det(A).

Kronecker product: (AB)(CD)=(AC)(BD)(A\otimes B)(C\otimes D) = (AC)\otimes(BD). vec(AXB)=(BA)vec(X)\text{vec}(AXB) = (B'\otimes A)\text{vec}(X).

Differentiation: (Ax)/x=A\partial(A\mathbf{x})/\partial\mathbf{x} = A. (xAx)/x=(A+A)x\partial(\mathbf{x}'A\mathbf{x})/\partial\mathbf{x} = (A+A')\mathbf{x}. lndet(A)/A=(A1)\partial\ln\det(A)/\partial A = (A^{-1})'.

A.5 Special Functions in Macroeconomics

Log-normal: If lnXN(μ,σ2)\ln X \sim \mathcal{N}(\mu,\sigma^2), then XLogNormal(μ,σ2)X \sim \text{LogNormal}(\mu,\sigma^2) with E[X]=eμ+σ2/2\mathbb{E}[X] = e^{\mu+\sigma^2/2}, Var[X]=(eσ21)e2μ+σ2\text{Var}[X] = (e^{\sigma^2}-1)e^{2\mu+\sigma^2}.

Gamma function: Γ(n)=(n1)!\Gamma(n) = (n-1)! for integer nn; Γ(1/2)=π\Gamma(1/2) = \sqrt{\pi}; Γ(n+1)=nΓ(n)\Gamma(n+1) = n\Gamma(n).

Normal CDF: Φ(z)=P(Zz)\Phi(z) = P(Z\leq z) for ZN(0,1)Z\sim\mathcal{N}(0,1); Φ(z)=1Φ(z)\Phi(-z) = 1-\Phi(z).


Appendix B: Linear Algebra Review


B.1 Vector Spaces

Definition. A vector space over R\mathbb{R} is a set VV with addition and scalar multiplication satisfying 8 axioms (closure, associativity, commutativity, identity, inverses, distributivity).

Basis and dimension. A set {v1,,vn}\{\mathbf{v}_1,\ldots,\mathbf{v}_n\} is a basis if it is linearly independent and spans VV. The dimension dimV\dim V is the cardinality of any basis.

Standard basis of Rn\mathbb{R}^n: ei\mathbf{e}_i has 1 in position ii and 0 elsewhere.

B.2 Matrix Operations

Rank. rank(A)\text{rank}(A) = number of linearly independent rows (= columns). rank(A)min(m,n)\text{rank}(A) \leq \min(m,n) for ARm×nA\in\mathbb{R}^{m\times n}. Full column rank: rank(A)=n\text{rank}(A) = n (columns independent). Full row rank: rank(A)=m\text{rank}(A) = m.

Null space. N(A)={x:Ax=0}\mathcal{N}(A) = \{\mathbf{x}: A\mathbf{x}=\mathbf{0}\}. Dimension: nrank(A)n - \text{rank}(A) (rank-nullity theorem).

Norms. x1=xi\|\mathbf{x}\|_1 = \sum|x_i|; x2=xi2\|\mathbf{x}\|_2 = \sqrt{\sum x_i^2}; x=maxxi\|\mathbf{x}\|_\infty = \max|x_i|. Matrix norm: A2=σmax(A)\|A\|_2 = \sigma_{\max}(A) (largest singular value); AF=tr(AA)\|A\|_F = \sqrt{\text{tr}(A'A)} (Frobenius).

B.3 Determinants and Cramer’s Rule

For AR2×2A\in\mathbb{R}^{2\times2}: det(A)=a11a22a12a21\det(A) = a_{11}a_{22} - a_{12}a_{21}.

Cramer’s rule. For Ax=bA\mathbf{x} = \mathbf{b} with det(A)0\det(A)\neq0: xi=det(Ai)/det(A)x_i = \det(A_i)/\det(A), where AiA_i is AA with column ii replaced by b\mathbf{b}.

Properties. det(AB)=det(A)det(B)\det(AB) = \det(A)\det(B). det(A)=det(A)\det(A') = \det(A). det(αA)=αndet(A)\det(\alpha A) = \alpha^n\det(A) (for n×nn\times n). det(A)=iλi\det(A) = \prod_i\lambda_i (product of eigenvalues).

B.4 Eigenvalues and Eigenvectors

Av=λvA\mathbf{v} = \lambda\mathbf{v}, v0\mathbf{v}\neq\mathbf{0}. Eigenvalues are roots of det(AλI)=0\det(A-\lambda I) = 0 (characteristic polynomial).

Spectral decomposition (symmetric A=AA=A'): A=QΛQA = Q\Lambda Q' where QQ is orthonormal and Λ=diag(λ1,,λn)\Lambda = \text{diag}(\lambda_1,\ldots,\lambda_n).

Stability: Discrete: At0A^t \to 0 iff λi<1|\lambda_i| < 1 for all ii. Continuous: eAt0e^{At} \to 0 iff Re(λi)<0\text{Re}(\lambda_i) < 0 for all ii.

Generalized eigenvalues. Av=λBvA\mathbf{v} = \lambda B\mathbf{v} has generalized eigenvalues λi=Tii/Sii\lambda_i = T_{ii}/S_{ii} from the QZ decomposition QAZ=SQAZ = S, QBZ=TQBZ = T.

B.5 The Perron–Frobenius Theorem

Theorem (Perron–Frobenius). Let AA be a square matrix with all positive entries. Then:

  1. AA has a unique largest real eigenvalue λ1>0\lambda_1 > 0 (the Perron root).

  2. The corresponding eigenvector v1\mathbf{v}_1 has all positive entries (Perron vector).

  3. λi<λ1|\lambda_i| < \lambda_1 for all other eigenvalues.

Application in input-output analysis (Chapter 2). For the Leontief technical coefficient matrix AA (with Aij0A_{ij} \geq 0), the Perron root λ1(A)<1\lambda_1(A) < 1 guarantees (IA)1(I-A)^{-1} exists and is non-negative — the Leontief inverse has all non-negative entries (backward linkage multipliers are non-negative).

Application in Markov chains. For a stochastic matrix PP (row sums = 1, all entries 0\geq 0), Perron–Frobenius guarantees a unique stationary distribution π\bm\pi with πP=π\bm\pi'P = \bm\pi' and πi>0\pi_i > 0 for all ii (ergodic chains).

B.6 QR and LU Decompositions

LU decomposition. PA=LUPA = LU: PP permutation, LL unit lower triangular, UU upper triangular. Solves Ax=bA\mathbf{x}=\mathbf{b} in O(n3/3)O(n^3/3) flops (Chapter 25).

QR decomposition. A=QRA = QR: QQ orthonormal (QQ=IQ'Q=I), RR upper triangular. Used for numerically stable OLS (Chapter 25). κ(R)=κ(A)\kappa(R) = \kappa(A) vs. κ(AA)=κ(A)2\kappa(A'A) = \kappa(A)^2 for normal equations.

Cholesky. For positive definite AA: A=LLA = LL' (LL lower triangular). Fastest symmetric system solver. Used for sampling from multivariate normal (Chapter 26).

SVD. A=UΣVA = U\Sigma V': U,VU, V orthonormal, Σ=diag(σ1,,σr,0,)\Sigma = \text{diag}(\sigma_1,\ldots,\sigma_r,0,\ldots). Rank = number of positive singular values. Used for numerical rank determination (Chapter 41).


Appendix C: Calculus Review


C.1 Limits and Continuity

Limit. limxaf(x)=L\lim_{x\to a}f(x) = L: for every ε>0\varepsilon>0 there exists δ>0\delta>0 such that xa<δf(x)L<ε|x-a|<\delta \Rightarrow |f(x)-L|<\varepsilon.

L’Hôpital’s rule. If limf=limg=0\lim f = \lim g = 0 (or ±\pm\infty): limf/g=limf/g\lim f/g = \lim f'/g' (when the right-hand limit exists).

Useful limits: limx0(1+x)1/x=e\lim_{x\to0}(1+x)^{1/x} = e. limn(1+r/n)n=er\lim_{n\to\infty}(1+r/n)^n = e^r. limx0sinxx=1\lim_{x\to0}\frac{\sin x}{x} = 1.

C.2 Multivariate Differentiation

Partial derivative. f/xi\partial f/\partial x_i = derivative of ff treating all xjx_j (jij\neq i) as constants.

Gradient. f=(f/x1,,f/xn)Rn\nabla f = (\partial f/\partial x_1, \ldots, \partial f/\partial x_n)' \in \mathbb{R}^n.

Hessian. Hf=[2f/xixj]H_f = [\partial^2f/\partial x_i\partial x_j] — symmetric n×nn\times n matrix of second partial derivatives. Hf0H_f \succ 0 (positive definite) iff ff is strictly convex.

Jacobian. For F:RnRmF:\mathbb{R}^n\to\mathbb{R}^m: JF=[Fi/xj]J_F = [\partial F_i/\partial x_j] — the m×nm\times n matrix of first partial derivatives.

Chain rule (vector form). For h=fgh = f\circ g (h:RmRph:\mathbb{R}^m\to\mathbb{R}^p, g:RnRmg:\mathbb{R}^n\to\mathbb{R}^m, f:RmRpf:\mathbb{R}^m\to\mathbb{R}^p): Jh=Jf(g(x))Jg(x)J_h = J_f(g(\mathbf{x}))\cdot J_g(\mathbf{x}).

C.3 Optimization Conditions

Unconstrained. FOC: f(x)=0\nabla f(\mathbf{x}^*) = \mathbf{0}. SOC (minimum): Hf(x)0H_f(\mathbf{x}^*) \succ 0.

Equality constraints (Lagrange). Maximize f(x)f(\mathbf{x}) s.t. g(x)=0g(\mathbf{x}) = 0: Lagrangian L=fλg\mathcal{L} = f - \lambda g; FOCs: f=λg\nabla f = \lambda\nabla g.

Inequality constraints (KKT). Maximize ff s.t. gj(x)0g_j(\mathbf{x}) \leq 0: KKT conditions: f=jμjgj\nabla f = \sum_j\mu_j\nabla g_j; μj0\mu_j \geq 0; μjgj=0\mu_jg_j = 0 (complementary slackness).

Envelope theorem. For V(α)=maxxf(x,α)V(\alpha) = \max_x f(x,\alpha) s.t. g(x,α)=0g(x,\alpha)=0: dV/dα=L/αx=x(α)dV/d\alpha = \partial\mathcal{L}/\partial\alpha|_{x=x^*(\alpha)}.

C.4 Integration

Fundamental theorem of calculus. ddxaxf(t)dt=f(x)\frac{d}{dx}\int_a^x f(t)dt = f(x). abf(x)dx=f(b)f(a)\int_a^b f'(x)dx = f(b) - f(a).

Fubini’s theorem. For integrable ff:  ⁣f(x,y)dxdy= ⁣[f(x,y)dx]dy\int\!\int f(x,y)dxdy = \int\!\left[\int f(x,y)dx\right]dy.

Change of variables. ϕ(a)ϕ(b)f(x)dx=abf(ϕ(t))ϕ(t)dt\int_{\phi(a)}^{\phi(b)}f(x)dx = \int_a^b f(\phi(t))\phi'(t)dt.

Leibniz rule. ddαa(α)b(α)f(x,α)dx=f(b,α)b(α)f(a,α)a(α)+abfαdx\frac{d}{d\alpha}\int_{a(\alpha)}^{b(\alpha)}f(x,\alpha)dx = f(b,\alpha)b'(\alpha) - f(a,\alpha)a'(\alpha) + \int_a^b\frac{\partial f}{\partial\alpha}dx.

Dominated convergence theorem. If fnff_n \to f pointwise and fng|f_n| \leq g (integrable), then fnf\int f_n \to \int f.


Appendix D: Probability Distributions and Statistical Tables


D.1 Core Distributions

Normal Distribution: N(μ,σ2)\mathcal{N}(\mu, \sigma^2)

PDF: f(x)=1σ2πexp ⁣[(xμ)22σ2]f(x) = \frac{1}{\sigma\sqrt{2\pi}}\exp\!\left[-\frac{(x-\mu)^2}{2\sigma^2}\right].

Mean: μ\mu. Variance: σ2\sigma^2. MGF: M(t)=eμt+σ2t2/2M(t) = e^{\mu t + \sigma^2t^2/2}.

Standard normal N(0,1)\mathcal{N}(0,1): CDF Φ(z)\Phi(z). Key quantiles: Φ1(0.025)=1.960\Phi^{-1}(0.025) = -1.960, Φ1(0.05)=1.645\Phi^{-1}(0.05) = -1.645, Φ1(0.10)=1.282\Phi^{-1}(0.10) = -1.282.

Log-Normal Distribution: LogN(μ,σ2)\text{LogN}(\mu, \sigma^2)

XLogN(μ,σ2)X \sim \text{LogN}(\mu,\sigma^2) iff lnXN(μ,σ2)\ln X \sim \mathcal{N}(\mu,\sigma^2).

Mean: eμ+σ2/2e^{\mu+\sigma^2/2}. Variance: (eσ21)e2μ+σ2(e^{\sigma^2}-1)e^{2\mu+\sigma^2}. Median: eμe^\mu.

Role in macroeconomics: Income and productivity shocks (At=eztA_t = e^{z_t}, ztNz_t \sim \mathcal{N}); asset prices; firm sizes (Chapter 33).

Gamma Distribution: Gamma(α,β)\text{Gamma}(\alpha, \beta)

PDF: f(x)=βαΓ(α)xα1eβxf(x) = \frac{\beta^\alpha}{\Gamma(\alpha)}x^{\alpha-1}e^{-\beta x}, x>0x > 0.

Mean: α/β\alpha/\beta. Variance: α/β2\alpha/\beta^2.

Role: Prior for positive parameters (CRRA σ\sigma, shock persistence); the chi-squared is χ2(k)=Gamma(k/2,1/2)\chi^2(k) = \text{Gamma}(k/2, 1/2).

Beta Distribution: Beta(α,β)\text{Beta}(\alpha, \beta)

PDF: f(x)=xα1(1x)β1B(α,β)f(x) = \frac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha,\beta)}, x(0,1)x\in(0,1).

Mean: α/(α+β)\alpha/(\alpha+\beta). Variance: αβ/[(α+β)2(α+β+1)]\alpha\beta/[(\alpha+\beta)^2(\alpha+\beta+1)].

Role: Prior for parameters in [0,1][0,1] — Calvo probability θ\theta, AR persistence ρ\rho, capital share α\alpha.

Inverse-Gamma Distribution: IG(α,β)\text{IG}(\alpha, \beta)

XIG(α,β)X \sim \text{IG}(\alpha,\beta) iff 1/XGamma(α,β)1/X \sim \text{Gamma}(\alpha,\beta).

Mean: β/(α1)\beta/(\alpha-1) (α>1\alpha>1). Variance: β2/[(α1)2(α2)]\beta^2/[(\alpha-1)^2(\alpha-2)] (α>2\alpha>2).

Role: Prior for variance parameters (σε2\sigma^2_\varepsilon) — conjugate prior for the normal variance.

D.2 Key Statistical Tables

Normal Distribution Quantiles

ppΦ1(p)\Phi^{-1}(p)
0.901.282
0.951.645
0.9751.960
0.992.326
0.9952.576

ADF Critical Values (asymptotic, constant + trend)

SignificanceNo trendWith trend
1%−3.43−3.96
5%−2.86−3.41
10%−2.57−3.12

Johansen Trace Statistic Critical Values (5%)

rr (null: rank r\leq r)n=2n=2n=3n=3n=4n=4
015.529.747.2
13.815.429.7
23.815.4

D.3 Moment-Generating Functions

DistributionMGF M(t)=E[etX]M(t) = \mathbb{E}[e^{tX}]
N(μ,σ2)\mathcal{N}(\mu,\sigma^2)eμt+σ2t2/2e^{\mu t + \sigma^2t^2/2}
Bernoulli(p)\text{Bernoulli}(p)1p+pet1-p+pe^t
Poisson(λ)\text{Poisson}(\lambda)eλ(et1)e^{\lambda(e^t-1)}
Gamma(α,β)\text{Gamma}(\alpha,\beta)(1t/β)α(1-t/\beta)^{-\alpha} (t<βt<\beta)
Exponential(λ)\text{Exponential}(\lambda)λ/(λt)\lambda/(\lambda-t) (t<λt<\lambda)

Key property: E[Xk]=M(k)(0)\mathbb{E}[X^k] = M^{(k)}(0) (the kk-th derivative of MGF at 0).