Welcome back to the second topic of the course.

In the previous topic,

we primarily introduced the use of Python to import,

read, and manipulate stock data by adding new features.

One of the key new features we added is a moving average.

After that, we combine what we have learned

and developed our first simple trading strategy.

In this simple trading strategy,

we buy and hold one share of stock.

If the 10 day moving average, MA10,

is larger than 50 day moving average, MA50,

which we called long one share of stock,

then we do not do anything if MA50 is less than MA10.

The result looks promising.

But as you can see,

there are two points whereby we lose money and financial analysis,

we will try our best to minimize the loss.

What do we want to know is,

how to compute the chance of bankruptcy if I apply this strategy?

Am I lucky enough,

so that we can avoid this in the next two years?

The simple trading strategy is built on two variables,

moving average 10 and moving average 50.

In statistics, they are called random variables.

This is where we need to apply some statistical knowledge by asking,

what is a probability rule?

Or more formally speaking,

what is in distribution of these two random variables, MA10 and MA50?

Identify important variables is

important in helping us making better prediction and decisions,

not just in financial,

but in other contexts as well.

For example, many social programs have

a hard time making sure that right people are given enough aid.

It's especially tricky where in program focus on the poorest segment of the population.

The world's poorest typically cannot provide

the necessary income and expense records to prove that they are qualified.

In Latin America, one popular method to verify

income qualification is called the Proxy Means Test or PMT.

PMT identifies new variables in the model,

which are family observable household attributes like the material of their walls,

and the ceilings or the assets found in

the home to qualify them and predict their level of need.

There is also another success story in small lending industry.

Many people struggle to get loans due to insufficient and non-existing credit histories.

Unfortunately, this population is often taken advantage of by untrustworthy lenders.

There is a company called Home Credit,

who makes use of variety and alternative external variables,

including telecom company bills and

other transnational information to predict their clients' repayment abilities.

These new variables tend to be very important in new prediction model.

This example gave us enough incentives to

explore some basic concepts and facts about random variables.

We will explore this topic in three videos.

First, we will explain,

what random variable is?

In the second video,

we will describe the distribution of random variables,

distribution helps identify extreme values of events.

For example, it is used for risk management in financial context.

After knowing the distribution random variables,

we will apply this concept to measure the risk of investing money in Apple stock.

Hopeful you will enjoy this part.