Lecture1 FGV
Lecture1 FGV
Lecture1 FGV
of Lecture 1
Bernard Salanié
8 July 2024
Glossary
weights parameters
learning fitting
1
Bernard Salanié Machine Learning for Economics—Handout of Lecture 1
. . . and the parody
Outside of economics:
computer science + statistics + driven by user-side
(mostly) focused on model selection for prediction, using
large datasets with many covariates
the new, really heavy stuff: Large Language Models, like
GPT.
yes indeed!
and yields
(X 0 X +λIp )θ̂R 0
n =X y
Pn
Denote Ên Z = i=1 Zi /n, and V̂n Z for the empirical variance.
Renormalization
Throughout the lectures (and most often in practice!) we
translate the variables so Ên xk = 0 and V̂n xk = 1 for each
covariate k (except the constant).
√
Note also that θ̂O
n = θ0 + σ0 u/ n with u = N(0, 1).
The MSE is
E(y − x θ̂R
n ) = E(xθ0 + ε − nx θ̂n /(n + λ))
2 O 2
√ !2
nxθ0 n
= E xθ0 + ε − − σ0 u
λ+n λ+n
!
n 2 n
= 1− E(xθ0 ) + σ0 1 +
2 2
.
n+λ (λ + n)2
choose K = 5 or 10 (typically)
split the sample randomly into K folds
for given values of the hyperparameters:
for k = 1, . . . , K :
estimate θ̂k (λ) on observations from all folds except k
predict on fold k : ŷi (λ) = xi θ̂
Pk (λ)
compute the MSE ek (λ) = i∈k (yi − ŷi (λ))2 on fold k
PK
compute e(λ) = k =1 ek (λ)
repeat with other values until happy with e(λ).