 Welcome to the course on dealing with materials data. In the previous session we introduced what is known as random variables and from this session onwards we would like to talk about its expectations, its moments and many other properties of random variables. Let us review what we did in the past. Random variable we defined as a real valued function with probability space omega and p as its domain and then we said that there are there is always a cumulative distribution function capital F of x is attached to any random variable x and that is defined as f of x is equal to probability of x less than or equal to small x. If x is a discrete random variable then we defined a probability mass function which is nothing but a small f of xi which is equal to probability that x random variable x takes on a particular value x sub i, i varies from 1, 2, 3 etc. please remember it is a discrete random variable and therefore it takes countable values. In case x is a continuous random variable then there is a probability density function attached to it and it is defined with a small f of x as f of x is greater than 0 it is a positive function, the area under the complete curve of f of x is 1 that is integral from minus infinity to infinity f of x dx is 1 and then the probability that the random variable x lies between a and b is nothing but the integral from a to b small f of x dx. We gave some examples in the previous session and now we move on with the further properties of random variable. So, in this session what we plan to do is give a definition of expected value of x which is given as e of x for both discrete random variable and continuous random variable. The expected value of a function of a random variable gx we will define that also. We will define what is known as a moments of a random variable and then we will give you some more details on the measures of skewness, kurtosis and excess kurtosis of any random variable x. So, to begin with let us talk about what is expectation of a random variable. See when you have a data or you have a random experimentation or a random event which has a certain output which we called a random variable we would generally be curious to know that what do we estimate? What do we expect from this data? In other words what is the expected general value of this data? Like you remember in the discrete sorry in the case of descriptive statistics or exploratory data analysis we said that x bar or the average value of x gives a general location of where the data lies. Similarly, expected value of x is also a general location where the random variable x lies when it takes different values. So, expected value of x is of a random variable is like taking a mean value of the random variable it is actually defined as a mean value of a random variable. However, in this session we want to introduce expectation as a function and therefore we start that random variable which is a discrete random variable has a probability mass function small f of x attached to it and we find that x1, x2, x3, xn are the values observed values of this random variable x then the expectation of x is defined as expected value of x e of x is equal to summation of xi multiplied by f of xi you remember f of xi is a probability mass function. So, you can see that this is something like a weighted average of xi because summation of f of xi is 1. So, this is like a weighted average of an xi and that is called expected value of x. In general for a function of x say g of x an expected value of g of x is defined as e of g of x this is a notation is equal to summation from i to infinity g of xi multiplied by f of xi this is again the probability mass function of the random variable. Let us talk of its moments. Now expected value of a random variable to the power k, x to the power k remember that this is also a function of random variable. So, expected value of x to the power k which is summation of xi to the power k f of xi is defined as a kth raw moment of random variable x. Please remember now we are going to have two kinds of moments. We go back. I want you to remember that this is called a raw moment of random variable x. If k is equal to 1 then the first moment of random variable x is nothing but expected value of x and it is also called it is also called a mean value of random variable of x. If expected value of x is mu mean then expected value of x minus mean to the power k is called the kth moment about mean. This is the difference I want you to remember something is called a moment about mean and the other one is called a moment about sorry it is called a raw moment. And the variance of x is nothing but the second moment about mean of a random variable x. So, variance of x is expected value of x minus e expected value of x to the power square and therefore it is this. Please recall this exercise in a different format we have done it for the descriptive statistics when we define when we define the variance of a data x 1, x 2, x 3, x n. This is for a generalized definition for any random variable x. Let us move on. Expectation of random variable in continuous case. So, please remember in general the discrete case we have a probability mass function in continuous case we have a probability density function and whatever the definition we have for the probability mass function generally in the case of continuous random variable it gets replaced by the integration instead of summation. So, expected value of x is defined as integral for minus infinity to infinity x of f of x dx which we again call the first moment as mu it is a first raw moment. Expected value of a function of a random variable x can be defined as integral minus infinity to infinity g of f of x dx. The kth row moment can be defined as expected value of x to the power k and therefore it is the integral x to the power k f of x dx. The kth moment about mean can be defined as expected value of x minus mu to the power k which is again the integral minus infinity to infinity x minus mu to the power k f of x dx and therefore you can also define what is known as variance of x I do not think it needs any definition. If you recall that as such this formula which is shown here applies to both continuous and random cases. So, please note that. So, then we come to another important measure which we have briefly introduced in the descriptive statistics. Now, we put it in here again. If a data is positively skewed it has a long tail on the right side and if the data is negatively skewed it has a long tail on the left side. This is a symmetric data in which we do not have long tail anywhere and it is very nicely symmetric bell shaped curve. The skewness in terms of expectations is measured as expected value of in other words it is the third moment about mean divided by the appropriately normalized variance that is variance to the power square root of variance to the power 3. So, that this becomes a unit less quantity this is defined as a skewness. If skewness is less than 0 it implies the negative skewness. If skewness is greater than 0 it implies the positive skewness and if skewness is 0 it implies the perfect symmetry as in the normal distribution. So, going back to the previous slide here the skewness value as defined as a ratio of the third moment about mean divided by the variance to the power 3 by 2. This will have a positive value because it is a positively skewed this will have a negative value because it is negatively skewed with a perfect symmetry skewness will be 0. Let us move to another quantity which is called kurtosis. Kurtosis measures the flatness of the tip of the frequency curve. So, here again this black curve is the perfectly symmetric normal distribution curve. This is a sharper tip which is greater than the normal tip and this is a flatter tip which is less than the normal tip and this is defined by the fourth moment about mean. It is expected value of x minus mu to the power 4 divided by variance square. Please remember this variance is already a square term it is a second moment about the mean. So, you have to match the units and therefore you have the different powers of the variance so that you have a unit less quantity to compare across the data in order to check the kurtosis of the data. So, kurtosis for a normal distribution is always 3 that is if you go back this is a perfectly normal curve the black line if you can see here this is a black line and this is a kurtosis equal to normal and that kurtosis is generally 3 it is 3 not generally 3 it is 3 and therefore there is also another definition called excess kurtosis in which you take this measure of kurtosis and subtract 3 out of it. If the excess kurtosis is greater than 0 then tip of the curve is sharper than the normal distribution. If the excess kurtosis is smaller than 0 then the tip of the curve is flatter than the normal distribution. So, here you will have excess kurtosis greater than 0 here you will have excess kurtosis less than 0 this is excess kurtosis will be 0. Let us look at certain properties of this expectation these are very simple properties because you can imagine that expectation is nothing but an integral value and therefore you can show that for a random any random variable x a and b are 2 constant please remember I am not now going by having a discrete and non-discreet case this is I am saying any random variable x and a and b are 2 constant then expected value of ax plus b is nothing but a expected value of x plus b this is very obvious it can be shown very easily by taking either the discrete case or a continuous case the variance of ax plus b is always a square times variance of x. The moment generating function this is another quantity is defined as mx of t which is expected value of exponential to the power tx remember this is a function of x. So, we know how to deal with the expected value of a function of x the beauty why is it called a moment generating function because if you take a kth derivative of this moment generating function and you put t is equal to 0 you get the kth row moment kth raw moment of the random variable x and therefore it is called a moment generating function. This name is called a moment generating function because it generates the kth raw moment of random variable x by taking the kth derivative with respect to t of the moment generating function and putting t is equal to 0. This is I have shown a simple example by working it out if you take the first derivative of moment generating function t it is derivative of expected value of exponential t to the x which is expected value this is interchangeable. So, it is expected value of d by dt of e to the power tx which is expected value of x e to the power tx which is ex when you put t is equal to 0 here the n e is missing please note here the sorry e is missing. So, it is when t is equal to 0 similarly I leave it to you you can try and show that the second derivative gives you the second row moment of the random variable x and you can generalize it to show that the kth moment kth raw moment will be derived from the kth derivative at t equal to 0 of moment generating function. So, let us summarize what we learned right now we introduced a function called expectation of x and we defined it for a discrete case as an expectation of x is a summation i is equal to 1 to infinity xi times f of xi which is a probability mass function of x, x and then we defined in the case of x is continuous we defined it as an integral from minus infinity to infinity x f of x dx. We defined the kth raw moment of x defined as expected value of x to the power k we gave a measure of skewness and kurtosis these are all also called coefficients of skewness and kurtosis and we showed with respect to normal distribution what values they take skewness less than 0 indicates negative skewness skewness greater than 0 indicates positively skewed data kurtosis less than 0 indicates that the tip is flatter flatter and when kurtosis is greater than 0 it says that the tip of the curve is sharper. We also learnt that an expected value of a function of an x can also be defined as a in case of discrete as a summation i is to 1 to n infinity g of x i f xi otherwise you integrate in case x is a continuous function. Thank you.