Posts

Full Bayesian Parameter Estimation

Image
Introduction The prevoius post discussed Maximum Likelihood Estimation (MLE) and Maximum A Posteriori (MAP) Estimation , focusing on the two properties of parameter estimation methods: whether an estimation method is a point or density estimate and whether an estimation method uses prior knowledge. While MLE does not use prior knowledge, MAP integrates prior knowledge into parameter estimation. Both parameter estimation methods are a point estimate. The current post focuses on Bayesian parameter estimation. Unlike the previous approaches, the Bayesian estimation is a density estimation method that produces a full distribution of parameter values as its outcome.  As the name of the "Bayesian estimate" suggests, the formula is based on the Bayes theorem, which solves a conditional probability \( P(\theta|D) \). The mathematical definition of full Bayesian parameter estimation is below:  \[ P(\theta | D) = \frac{P(D | \theta)...

Maximum {Likelihood, A Posteriori} Estimation

Image
Introduction I have made several posts about probabilities and distributions.  Basic Probability Two Random Variables Chain Rule of Probability Theory Probability Distribution1 Probability Distribution2: Normal distribution Probability Distribution3: Beta and Dirichlet distribution I used arbitrary probabilities and parameters in the series. Something like, "the chance of me going to Paris next year is 70% ( Two Random Variables )", "the mean wait time to enter the Eiffel tower is 60 minutes and variance is 144 ( Probability Distribution2: Normal distribution ) and "the rate of successful task completion by your new colleague is 66% ( Probability Distribution3: Beta and Dirichlet distribution )". All those numbers are arbitrary and random. The goal of...

Probability Distribution3: Beta and Dirichlet distribution

Image
Introduction The sixth post of my probability theory series focuses on the Beta distribution.  Basic Probability Two Random Variables Chain Rule of Probability Theory Probability Distribution1 Probability Distribution2: Normal distribution The beta distribution has the multivariate version called the Dirichlet distribution. The Dirichlet distribution used to be very popular in Bayesian and natural language processing literature before the LLM era. A common one-linear explanation of the beta distribution is "a distribution over a probability". I hope all readers are confused, so was I when I heard this for the first time. Here is an example. I visited paris every year in the past 10 years. That makes my chance of visiting Paris next year 100% according to my travel history.  The beta distribution asks this question: "how confident are we with t...

Differentiation and optimisation

Image
Introduction Differentiation calculus is a core part of machine learning optimisation. Differentiation is often taught at school as finding a slope in geometry. While a theoretical concept of differentiation is important, I feel that connection between differentiation at school and differentiation for machine learning optimisation is not linked well. This post aims to bridge the gap between school math and machine learning optimisation, focusing on how the mathematical concept (differentiation) is essential for the practical algorithm (gradient descent) to support machine learning. The post begins with a very basic concept of slope finding. Finding a slope between two points The general formula to find a slope \(a\) of a function \( y = ax \) is: \[ a = \frac{y_2 - y_1}{x_2-x_1} \] The figure below illustrates rise (vertical) and run (horizontal) changes between two points, Point 1 \((x = 0, y=0)\)  and Point 2 \((x=2, y=4)\).  ...

Probability Distribution2: Normal distribution

Image
Introduction The fifth post of my probability series is about continuous probability distributions. Basic Probability Two Random Variables Chain Rule of Probability Theory Probability Distribution1 A quick recap: a probability distribution concerns probabilities of  all possible outcomes  of a sample space. The previous post introduced four different discrete probability distributions.  The current post introduces the most popular continuous probability distribution: normal (Gaussian) distribution. The normal distribution has been an essential tool for Automatic Speech Recognition a long time before deep learning. Normal distribution The normal distribution is a bit like the Eiffel Tower. It is a distribution known for its "bell curve". The distribution is pointy in the middle and wider towards the edges of the distribution. The name "Gaussian" d...

Probability Distribution1

Image
Introduction The fourth post of my probability series is about  probability distributions . Basic Probability Two Random Variables Chain Rule of Probability Theory In the previous posts, I discussed probabilities involving a single and multiple random variables. Briefly, a random variable in an experiment or a trial maps a specific outcome from a sample space to a numeric value.  The example of a probabilistic event which I kept using was whether I to go to Paris next year \(X=1\) or not \(X=0\). A probability of a specific event can be expressed like this: \[ P(X=1) = 0.7 \] The generalised probability is then like this: \[ P(X) \] where \(X\) can be anything in a defined sample space. A probability distribution concerns probabilities of all possible outcomes of a sample space. So, \( P(X=1)=0.7 \) is a part of a probability distribution, but the whole representation of the ...