










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!











Author Marc'Antonio Lopez AI & Data Analytics student at Polytechnic University of Turin
Probability theory forms the bedrock of machine learning, providing the essential mathematical framework for understanding and managing uncertainty. This enables well-informed decisions even with incomplete or unpredictable information. Moreover, it allows machine learning models to quantify belief, predict outcomes, and learn from inherently noisy or variable data.
Studying probability is crucial as it equips us with powerful methods for making predictions and decisions amidst uncertainty. Real-world phenomena are incredibly complex, influenced by countless often unknown or imprecisely measurable factors. This complexity renders purely deterministic models (where outcomes are always precisely predictable) impractical or impossible to build. Therefore, we utilize the concept of random events to quantify and systematically navigate this inherent complexity.
Understanding the nature of an event is fundamental:
Deterministic Event: An event whose outcome is entirely predictable if all initial conditions and influencing factors are fully known. For example, the outcome of a simple mathematical calculation is deterministic. Random Event: An event whose specific outcome is uncertain and cannot be predicted with absolute certainty, even if some initial conditions are known. For example, the result of a coin flip or a die roll is a random event.
Probability can be understood and applied from several perspectives:
Let's use the example of rolling a fair, standard six-sided die to illustrate basic probability concepts:
Probability Spaces and Axioms: The Formal
P ({x}) = 61 x ∈ {1, … , 6}
P ("even number") = P ({2}) + P ({4}) + P ({6}) = + 6
Probability Range: The probability of any event must always fall within the range of 0 to 1, inclusive.
Let's re-examine the die roll example through the lens of these axioms:
Axiom 1 (Non-negativity): For a fair die, the probability of rolling any specific number x is , which is indeed. This axiom is satisfied. Axiom 2 (Normalization): The sum of the probabilities of all individual outcomes in the sample space is:
. This axiom is satisfied. Axiom 3 (Countable Additivity): Consider the event "even number," which comprises the outcomes. Since the events , , and are mutually exclusive (you can't roll a 2 and a 4 simultaneously), we can use this axiom: . This axiom is satisfied.
Conditional Probability and Independence
Conditional probability , denoted as , is the probability of event occurring given that event has already occurred. This concept allows us to update our belief about an event's likelihood based on new information, and is defined only if. The formula for conditional probability is given by:
Here, represents the probability that both event A and event B occur.
Example (Die Roll): Let Event A be rolling a 2 or a 3. So,. The probability of A is .
P ({x}) = 1/6 ≥ 0
P ("even number") = P ({2} ∪ {4} ∪ {6}) = P ({2}) + P ({4}) + P ({6}) = 1/6 + 1/6 + 1/6 = 3/6 = 1/
Let Event B be rolling a number greater than 1. So,. The probability of B is. The intersection of A and B ( ) is the set of outcomes where both A and B occur:
. The probability of this intersection is. Now, let's calculate the probability of Event A given Event B has occurred, :
Interpretation: This result means that if we already know the die roll was greater than 1, the probability of that roll being a 2 or a 3 is now 2/5 (or 40%). This is higher than the original probability of A (1/3 or ~33.3%), indicating that knowing B occurred changes our assessment of A.
Bayes' Formula (also known as Bayes' Theorem) is one of the most fundamental and powerful results in probability theory, especially in machine learning. It allows us to "reverse" the conditionality; that is, to calculate if we know , along with the individual probabilities and .
The formula is:
This theorem is central to Bayesian inference, where is the "posterior probability" (updated belief), is the "likelihood," is the "prior probability," and is the "evidence."
Here's a conceptual flow of how Bayes' Theorem works:
Interpretation of the Result: The result means that if we know the roll was a 2 or a 3 (Event A), it is certain (probability of 1) that the roll was also greater than 1 (Event B).
Conclusion on Independence: Since which is not equal to , events A and B are not independent. This makes sense intuitively: knowing the roll was a 2 or 3 definitely tells us something about whether it was greater than 1.
Random Variables
A random variable (RV) is a powerful probability concept, serving as a bridge between abstract random experiment outcomes and numerical values. It maps each possible outcome to a real number, enabling mathematical analysis of uncertain situations.
Formally, a random variable is a function. This function assigns a unique real number, , to every individual outcome in the sample space.
A crucial condition for a function to be considered a random variable is that for any real number , the set of all outcomes for which must constitute an event (i.e., must be a member of the event space ). This condition ensures the variable is "measurable," meaning we can meaningfully assign probabilities to its values.
The Cumulative Distribution Function (CDF) , denoted as , is a fundamental function that completely describes the probability distribution of a random variable. It gives the probability that the random variable will take on a value less than or equal to a given number x.
The definition is:.
Key Properties of a CDF: i. Bounded: The probability value must always be between 0 and 1, inclusive.
ii. Non-decreasing: As x increases, the CDF value must either stay the same or increase. It can never decrease.
X(ω) ω Ω
x ω X(ω) ≤ x {ω : X(ω) ≤ x} F
F (^) X(x) X X
F (^) X (x) =P (X ≤ x)
0 ≤ F (^) X (x) ≤ 1
If , then. iii. Limits at Extremes: As x approaches negative infinity, the CDF approaches 0 (no chance of being less than an infinitely small number).
As x approaches positive infinity, the CDF approaches 1 (certainty of being less than an infinitely large number).
iv. Right-continuous: The CDF must be continuous from the right. This means that as you approach a point x from values slightly larger than x , the function value approaches .
Random variables are primarily categorized into two types based on the nature of the values they can take:
1. Discrete Random Variables
Definition: These are random variables that can take on a finite number of distinct values, or a countably infinite number of distinct values (like integers: 0, 1, 2, ...). They typically represent counts or categories. Description: They are described by a Probability Mass Function (PMF) , denoted as. The PMF gives the probability that the random variable is exactly equal to a specific value (^) x.
Properties of a PMF: Each probability must be non-negative:. The sum of all probabilities for all possible values of x must equal 1:. Example: The outcome of a fair die roll is a discrete random variable. Its PMF is for each possible value x.
2. Continuous Random Variables
Definition: These are random variables that can take on any value within a continuous range of real numbers. They typically represent measurements. Description: They are described by a Probability Density Function (PDF) , denoted as. Key Concept: For a continuous random variable, the probability of it taking on any exact single value is 0 ( ). Instead, probability is calculated as the area under the PDF curve
a < b F (^) X (a) ≤F (^) X(b)
lim (^) x→−∞ F (^) X (x) = 0
lim (^) x→∞ F (^) X (x) = 1
F (^) X(x) lim (^) h→0+^ F (^) X (x +h) = F (^) X(x)
f (^) X(x) X f (^) X (x) =P (X = x)
f (^) X (x) ≥ 0 ∑all x f (^) X (x) = 1 X ∈ {1, … , 6} f (^) X (x) =1/
f (^) X(x)
P (X = x) = 0
For Marginal CDF : You obtain the marginal CDF of a single variable by taking the limit of the joint CDF as the values of all other variables (where ) approach positive infinity. This effectively accounts for all possible values of the other variables.
Marginal PMFs/PDFs: Similarly, marginal probability mass functions (PMFs) for discrete variables and marginal probability density functions (PDFs) for continuous variables are obtained by summing (for discrete) or integrating (for continuous) the joint PMFs/PDFs over all possible values of the variables you want to "ignore."
Two random variables, and , are considered statistically independent if knowing the value of one variable provides absolutely no information about the value of the other variable.
This can be formally defined using their distributions:
Definition using CDFs: and are independent if their joint CDF is equal to the product of their individual (marginal) CDFs for all possible values of x and y. for all. Definition using PDFs/PMFs: For continuous variables: Their joint PDF is equal to the product of their individual (marginal) PDFs.
For discrete variables: The probability of them taking on specific values (^) x and (^) y simultaneously is equal to the product of their individual (marginal) probabilities.
The Conditional PDF , denoted as , describes the probability distribution of random variable given that random variable has taken on a specific value y. It is analogous to conditional probability for events but applied to continuous random variables.
The formula is:
Here, is the joint PDF of and , and is the marginal PDF of. This formula
F (^) Xi ( x (^) i ) Xi xj j = i
F (^) Xi (x (^) i ) =lim (^) x (^) j →∞ for all j=i F (^) X (x 1 , … , x (^) m)
F (^) X,Y (x, y) =F (^) X (x)F (^) Y (y) x, y
f (^) X,Y (x, y) =f (^) X (x)f (^) Y(y)
P (X = x, Y = y) = P (X = x)P (Y = y)
f (^) X∣Y(x∣y) X Y
f (^) X∣Y (x∣y) = (where f (y) > f (^) Y(y)
f (^) X,Y (x, y) Y 0)
f (^) X,Y (x, y) X Y f (^) Y (y) Y
essentially normalizes the joint probability by the likelihood of the condition, giving us the probability density of within that specific condition.
Expectations (Expected Values): Measures of Central
Tendency and Spread
The expectation (or expected value ) of a random variable, denoted as or , represents its long-run average value if the random experiment were repeated many times. Thus, it serves as a fundamental measure of central tendency for a probability distribution.
The calculation of expectation differs slightly for discrete and continuous random variables:
For a Discrete Random Variable (RV): The expectation is the sum of each possible value multiplied by its probability mass function (PMF).
Where is the set of all possible values for. For a Continuous Random Variable (RV): The expectation is the integral of each possible value multiplied by its probability density function (PDF).
While expectation tells us the central tendency, other measures help describe the spread or the relationship between variables.
1. Variance ( or )
Purpose: Variance is a measure of how widely dispersed the values of a random variable are around its mean. A high variance indicates that values tend to be spread out far from the mean, while a low variance indicates values are clustered closely around the mean. Definition: Variance is the expected value of the squared difference between the random variable and its mean.
Computational Formula: A more convenient formula for calculation is:
E[X] μX
E[ X ]
E[X] = μ (^) X =∑x∈S xf (^) X(x) S X
E[X] = μ (^) X =∫−∞∞^ xf (^) X(x)dx
Var(X) = σ (^) X^2 =E[(X − μ (^) X ) ]^2
Bayesian Estimation: Inferring Parameters with Prior
Beliefs
Estimation is the process of using observed data to infer the unknown parameters of an underlying probability distribution or process. Bayesian estimation is a specific approach that uniquely incorporates prior beliefs or knowledge about these parameters into the inference process.
Before delving into Bayesian estimation, it's helpful to understand Maximum Likelihood Estimation (MLE) , which is a common frequentist approach.
Principle: MLE identifies the values for the unknown parameters that make the observed data most probable (i.e., maximize the likelihood of the data given the parameters). It focuses solely on the likelihood of the observed data. Example (Bernoulli Distribution): Imagine you flip a coin times and observe (where for heads, for tails). You want to estimate the probability of success ( ) for this coin. The MLE estimate for ( ) is simply the sample proportion of successes:
For instance, if you flip a coin 10 times and get 7 heads, the MLE for would be 7/10 = 0.7.
In contrast to MLE, the Bayesian approach treats the unknown parameter itself (e.g., for the coin) as a random variable. This means we assign a probability distribution to the parameter to reflect our uncertainty about its true value.
The Bayesian estimation process involves combining three key components:
n xi x (^) i= 1 x (^) i = 0 π π πML
π ML^ = = number of trials
number of successes x n
i=
n i
π
π
f (^) Π( π ) π
P ( X = x ∣ π ) π
MLE.
The denominator, , is a normalizing constant (often called "evidence" or "marginal likelihood") that ensures the posterior distribution integrates to 1. The posterior distribution provides a complete probabilistic summary of what you now believe about the parameter, given both your prior knowledge and the new data.
Density Estimation: Uncovering Data's Underlying
Structure
Density estimation is the process of building a model to estimate the underlying probability density function (PDF) or probability mass function (PMF) from a given set of observed data. Essentially, it tries to understand the true distribution from which the data was sampled.
The Gaussian distribution (also known as the Normal distribution ) is a continuous probability distribution that is exceptionally important and frequently encountered in statistics and machine learning. Its prominence stems from its useful mathematical properties and its natural occurrence in many real-world phenomena.
Probability Density Function (PDF): The mathematical formula that defines the shape of the Gaussian distribution is:
Here: (mu) is the mean of the distribution, which represents its center.
f (^) Π∣ X ( π ∣ x ) π
f (^) Π∣X (π∣x) = ∫ P (X = x∣π ′) (^) f (π )dπ Π ′^ ′
P (X = x∣π)f (^) Π(π)
∫ P (X =x∣π ′^ )f (^) Π (π ′^ )dπ′
f (^) X (x; μ, σ 2 ) = e 2 πσ^2
(^1) − (x 2 −σμ 2 )^2
μ
Visual Enhancements for Conceptual Understanding
The following diagrams and tables are designed to help visualize and summarize the key probability concepts discussed.
This Mermaid diagram illustrates the logical progression and interconnectedness of the various probability concepts covered:
Understanding Random Events
Formalizing with Probability Spaces & Axioms
Conditional Probability & Independence
Introducing Random Variables (CDF, PDF/PMF)
Bayes' Theorem Expectations & Variance
Parameter Estimation (e.g., Bayesian, MLE)
Density Estimation (e.g., Gaussian)