Hello, and welcome to course two of the self-driving car specialization.

In this course, we'll cover state estimation with a focus on localization.

Let's first begin by defining a few key terms.

Localization is the method by which we determine

the position and orientation of a vehicle within the world.

As you can probably imagine,

accurate localization is a key component of

any self-driving car software stack.

If we want to drive autonomously,

we certainly need to know where we are.

To accomplish this, we can use state estimation.

This is the process of computing a physical quantity

like position from a set of measurements.

Since any real-world measurements will be imprecise,

we will develop methods that try to find the best or

optimal value given some assumptions

about our sensors and the external world.

Related to state estimation is the idea of parameter estimation.

Unlike a state, which we will define as

a physical quantity that changes over time,

a parameter is constant over time.

Position and orientation are states of a moving vehicle,

while the resistance of a particular resistor in

the electrical sub-system of a vehicle would be a parameter.

In the first module or week one of the course,

we will cover a common technique in state estimation,

the method of least squares.

By the end of this week,

you'll know a little bit about the history of least squares and you'll

learn about the method of ordinary least squares and its cousin,

the method of weighted least squares.

Then, we'll cover the method of recursive least squares and finally,

discuss the link between least squares

and the maximum likelihood estimation technique.

In the first lesson of this module,

we'll introduce the method of least squares

and something called the squared error criterion.

By the end of the video,

you'll be able to describe how the method of least squares was first

used by Carl Friedrich Gauss in the discovery of the planetoid Ceres.

Describe the least error criterion and how

it's used in estimating the best parameters.

Derive the necessary normal equations that

we'll need to solve to use the method. Let's begin.

The method of least squares dates to

the late 18th century well

before anyone had considered the concept of automobiles.

On January 1st, 1801,

an Italian priest and astronomer

Giuseppe Piazzi discovered a new celestial object in the night sky.

The asteroid or planetoid now called Ceres.

You can see it here next to the moon and to the earth.

Piazzi made 24 telescope observations of

this new object over 40 days before it was lost in the glare of the sun.

Since Ceres is only about 900 kilometers in diameter,

finding it again it was extremely challenging.

This meant that other astronomers could not confirm Piazzi's discovery.

To help locate Ceres again,

Carl Friedrich Gauss who has been called the prince of

mathematicians for his prodigious contributions to many different fields,

used a method of least squares to accurately estimate

Ceres orbital parameters based on Piazza's published measurements.

With Gauss's calculations in hand,

astronomers were successfully able to rediscover Ceres

nearly a year after Piazzi had made his first observations.

Although he published the method in 1809,

Gauss claimed that he developed least squares in

1795, predating Lesion's work.

Gauss summarized the approach as follows.

The most probable value of an unknown parameter is that which minimizes

the sum of squared errors between what we observe and what we expect.

To illustrate how this works,

let's take a simple example.

Suppose you are trying to measure the value in ohms of

a simple resistor within the drive system of an autonomous vehicle.

To do this, you grab

a relatively inexpensive multimeter that's lying around your lab.

Now, let's say you collect these four separate measurements, sequentially.

If you've studied electrical circuits before,

you'll probably recall that the type of carbon film resistors shown

here is color-coded according to its rated resistance value.

This resistor is rated at one kilo ohm.

However, due to a number of factors,

the true resistance can vary from the rated value.

In this case, the resistor has a gold band

which indicates that it can vary by as much as five percent.