




























































































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!





























































































Lesson 1 clarifies the relationship between four central concepts: Artificial Intelligence,
Machine Learning, Statistical Learning, and Data Mining.
Artificial Intelligence (AI)
with human intelligence (reasoning, perception, decision-making, language, etc.).
modern learning-based methods.
In finance, AI can refer to autonomous trading systems, robo-advisors, or complex
decision-support systems.
5.2 Machine Learning (ML)
performance over time without being explicitly programmed for every case.
datasets.Examples in finance include models predicting stock price movements,
default probabilities, or customer churn.
5.3 Statistical Learning (SL)
methods.
uncertainty, and interpreting the relationship between variables.
A typical example is credit scoring models, where you relate customer characteristics to
default events using regression or classification frameworks.
5.4 Data Mining
datasets using methods from ML and statistical learning.
settings.
In finance, data mining includes tasks such as fraud detection, customer segmentation, or
transaction pattern analysis.
Hierarchy and overlaps between AI, ML, SL, and Data Mining
Lesson 1 provides a conceptual hierarchy.Lezione1_2026.pdf
expert systems.
and formal statistical tools.
patterns in large datasets, often in business or scientific research.
Key distinctions:
flexible models; statistical learning stresses interpretability and statistical rigor.
business-oriented pattern discovery.
The instructor notes that in the course they will typically use the single term “statistical
learning” to refer both to traditional statistical methods and ML approaches.
Supervised vs unsupervised learning
These are fundamental paradigms shared by ML and statistical learning.
Supervised learning
(response, target).
1
𝑝
, to predict 𝑌for new observations or understand the effect of predictors.
Typical applications:
prediction.Lezione1_2026.pdf
For your finance background, you can think of supervised learning as generalizing standard
regression and classification models you already know from econometrics.
1. Variables, notation, and measurement scales
1.1 Response and predictor variables
o Denoted 𝑌.
o It is the outcome we want to predict or explain (e.g., stock return, probability of
default, house price).
o It is treated as random because it changes with the predictors and contains
noise.
o Denoted 𝑋(often as a vector 𝑋 = (𝑋
1
𝑝
o These are features/inputs that influence the response and are typically treated
as fixed or non-random in the modeling framework.
In supervised learning we always think in terms of “𝑌 given 𝑋”: we model how the distribution
of 𝑌changes as a function of the predictors.
1.2 Measurement scales
The type of a variable (measurement scale) matters because it determines which models and
loss functions are appropriate.
Nominal classification
o Pure categories with no intrinsic ordering.
o Examples: default vs non-default, sector (banking, utilities, tech), yes/no to a
survey question.
o Categorical but with a meaningful order.
o Examples: age group (young, middle-aged, old), credit rating classes (AAA, AA,
A, BBB, …), risk categories (low, medium, high).
o Numeric counts taking integer values.
o Examples: number of transactions, number of previous late payments, number
of claims per year.
o Can take any value in an interval.
o Examples: age in years, income, stock returns, log-GDP.
For the exam, be able to: define each type, classify example variables, and explain why, e.g.,
“credit rating” is ordinal while “income bracket” may be either ordinal or nominal depending
on how it is used.
2. Goals of statistical learning: prediction vs inference
Statistical learning aims at estimating the relationship between a response and predictors,
typically written 𝑌 ≈ 𝑓(𝑋).
Prediction
o Use past data to predict future or unseen outcomes.
o Example: predict future stock returns or real-estate prices from
macroeconomic indicators.
o Understand the nature and strength of the relationship between 𝑌and each 𝑋
𝑗
o Example: measure how consumer spending changes when tax policy changes,
or how PD changes with income and leverage.ù
Prediction asks “how accurately can we predict 𝑌for new 𝑋?”, while inference asks “which
predictors matter, and how do they affect 𝑌?”.
3. Supervised learning basics
3.1 Definition
Supervised learning uses labeled data, where both predictors 𝑋and outcomes 𝑌are observed,
to learn a model that can predict 𝑌 for new observations.
Supervised methods are built around a model that relates the response variable to the
predictors.
3.2 Regression vs classification
o 𝑌is continuous.
o Examples: predicting stock returns from macro variables, forecasting sales
from advertising expenditures.
returns for a given risk level.
5.2 Classification: credit scoring
Scenario: A bank decides whether a loan applicant will default.
Inputs: income, credit score, employment status, loan amount, etc.
reject very risky applications.
These examples show how notation 𝑋and 𝑌, measurement scales, and supervised learning
concepts directly apply in finance.
6. Why estimate 𝒇? Prediction and inference in depth
We estimate 𝑓for two primary reasons: prediction and inference.
6.1 Prediction
(𝑋), where 𝑓
is an estimator of
the unknown 𝑓.
spending and 𝑌 is sales.
Prediction accuracy depends on two sources of error: reducible and irreducible.
6.2 Inference
Inference focuses on understanding the relationship between 𝑌and the predictors.
Typical questions:
and by how much)?
forms?
Inference allows us to move from “black-box prediction” to economic interpretation and
policy implications.
7. Assessing prediction accuracy: Mean Squared Error (MSE)
To evaluate the accuracy of a statistical learning method that produces a prediction 𝑓
0
) at
some input 𝑥
0
, the relevant quantity is the Mean Squared Error (MSE).
0
0
2
0
is the true response at input 𝑥
0
0
and often also over the
randomness in the training sample that produced 𝑓
A lower MSE means better predictive performance.
8. MSE decomposition: simplified and general cases
8.1 Simplified case (fixed 𝑿 , fixed 𝒇
Assume 𝑋 and 𝑓
are fixed, so variability comes only from the noise 𝜀.
Then:
2
2
2
Reducible Error
Irreducible Error
2
is the reducible error: it depends on how well we estimate
even if we knew 𝑓exactly.
This decomposition shows that no method can reduce MSE below the irreducible component.
8.2 General case (both 𝒀 𝟎
and 𝒇
𝟎
) random)
In the general case:
𝑌
0
0
0
2
Here both 𝑌 0
and 𝑓
0
) are random: 𝑌
0
because of noise, and 𝑓
0
) because it depends on the
specific training sample.
The lecture shows that MSE can be written as an irreducible part (variance of 𝜀) plus a
reducible part that depends on the bias and variance of 𝑓
0
𝜀
2
⏟
Irreducible error
𝑌
0
0
2
𝜀
2
11. Parametric methods
11.1 Definition and steps
Parametric methods assume a specific functional form for 𝑓with a finite number of
parameters.
Two steps:
0
𝑗
𝑝
𝑗= 1
𝑗
etc.
11.2 Advantages and limitations
o If the chosen functional form differs from the true 𝑓, the model is misspecified
and estimates can be biased.
o More flexible parametric models (e.g., high-degree polynomials, many
interaction terms) can approximate a wider range of functions but require
estimating more parameters.
o Greater flexibility increases risk of overfitting: the model fits noise in the training
set instead of true signal.
o Overfitting increases MSE because variance becomes large.
o Parametric modeling therefore requires controlling complexity (e.g., via
regularization or model selection) to balance bias and variance.
Linear and logistic regression, parametric survival models, and many econometric
specifications are classic parametric methods widely used in finance.
12. Non-parametric methods
12.1 Definition and flexibility
Non-parametric methods do not assume a fixed functional form for 𝑓; instead, they let the
data determine the shape of 𝑓.
structure from the sample.
estimate more local structure.
12.2 Examples and challenges
Examples of non-parametric or highly flexible methods mentioned:
Decision trees.
Challenges:
fragile to noise.
In financial applications, these methods can capture complex nonlinearities (e.g., nonlinear
relation between volatility and returns), but must be controlled via pruning, regularization, or
cross-validation.
3. Unsupervised learning examples
3.1 Customer segmentation in banking
Scenario: a bank wants to segment clients based on financial behavior to offer personalized
products.
with low balances”.
high-net-worth, student loans for young customers).
3.2 Country classification
Scenario: an economist groups countries using macro indicators.
Inputs: GDP growth, inflation, unemployment, trade balance.
Model: clustering algorithm.
Output: clusters like “emerging markets”, “developed economies”, “high-inflation
economies”.
Impact: guides policy analysis and investment strategies for country groups with similar
economic conditions.
4. Choosing and assessing statistical learning methods
4.1 No universally best method
Lesson 3 emphasizes that there is no single method that is best for all datasets.
Performance is data-specific: a method may work very well on one dataset but poorly on
another.
Selecting an appropriate method is one of the most challenging aspects of statistical
learning.
4.2 Evaluating model fit: the role of MSE
Key question: how well do predictions match the actual data?
For regression, we use Mean Squared Error (MSE) to quantify prediction error.
because the underlying distribution is unknown.
This sets up the need for training and test splits.
5. Training and test sets
5.1 Definitions
o Used to fit (train) the model parameters.
o Training MSE measures how well the model captures patterns in the observed
data:
Training MSE =
∣ training set ∣
𝑖
𝑖
2
𝑖∈training set
o Set of observations not used during training.
o Used to evaluate generalization performance, i.e., how well the model predicts
unseen data
Test MSE =
∣ test set ∣
𝑖
𝑖
2
𝑖∈test set
5.2 Importance of test MSE
It is crucial that the model generalizes to new data.
Training MSE always decreases as model complexity (flexibility) increases; a very flexible
model can even fit the training data almost perfectly.
However, this can lead to overfitting, where the model learns noise instead of the true
underlying pattern. The key insight is that we want to minimize test MSE , not training MSE.
A later slide shows training MSE (grey curve) decreasing with flexibility, test MSE (red curve)
with a minimum at intermediate flexibility, and a horizontal line for Var(𝜀), the irreducible
error.
7. Overfitting and model complexity
As flexibility increases, test MSE initially decreases but eventually rises; this turning point
marks the onset of overfitting.
Overfitting occurs when a model achieves very low training MSE but high test MSE, meaning it
memorizes noise instead of learning the underlying structure.
An optimal model balances flexibility: complex enough to capture real patterns but simple
enough to avoid high variance.
The slides also show examples where:
flexible) perform well.
better.
8. Classification setting: error rates
8.1 Training and test error rates
In classification, the response variable 𝑌is qualitative (categorical).
We estimate a classifier 𝑓
and define:
o Proportion of misclassified observations in the training set.
o If 𝑦̂
𝑖
is the predicted class for observation 𝑖, the training error is
𝑛
𝑖= 1
𝑖
𝑖
where 𝐼(⋅) is the indicator function.
o Proportion of misclassified observations in a test set (unseen data).
o Computed with the same formula but over test observations. A good classifier
is the one that minimizes the test error rate, not necessarily the training error.
For a training sample
1
1
𝑛
𝑛
and predicted class labels 𝑦̂
𝑖
𝑖
), the training
error rate is:
Training Error =
𝑛
𝑖= 1
𝑖
𝑖
where 𝐼(⋅) is the indicator function equal to 1 if its argument is true and 0 otherwise.
A slide illustrates a 2D example with two classes: the shaded region where one class’
probability exceeds 50% and a dashed line marking the Bayes decision boundary.
10. From Bayes classifier to KNN
10.1 Practical limitations
In practice, we almost never know the conditional distribution 𝑃(𝑌 ∣ 𝑋), so we cannot
implement the Bayes classifier exactly.
K-Nearest Neighbors is introduced as a simple, non-parametric method that approximates
the Bayes rule using local information from the training sample.
10.2 K-Nearest Neighbors (KNN): definition
KNN is a non-parametric classifier that:
Makes no assumptions about the functional form of the decision boundary or about the data
distribution.
Classifies a new observation based on the majority class among its 𝐾nearest neighbors in the
training set.
Mechanism:
0
, identify the set 𝑁
0
of the 𝐾closest training points (using a
distance such as Euclidean).
0
) as the fraction of points in 𝑁
0
whose class is 𝑗.
0
to the class with the highest estimated probability.
KNN estimate of conditional probability
0
𝑖∈𝑁
0
𝑖
KNN classification rule
KNN
0
) = arg max
𝑗
0
10.3 Illustrative example
A slide shows:
representing a new observation. For 𝐾 = 3 , the three nearest neighbors include two
blue and one orange point, so the cross is classified as blue (probability 2/3).
orange.
Another slide compares the KNN decision boundary (black curve, e.g., 𝐾 = 10 ) with the Bayes
decision boundary (purple dashed line), showing that KNN can approximate the Bayes
classifier remarkably well even though it is a simple algorithm.