Basics of ML & AL Week 2 Challenge
1.Calculate all 4 business moments using pen and paper for the below data set?
First Moment - Mean
μ = (0 x 0.35) + (1 x 0.250) + (2 x 0.15) + (3 x 0.15) + (4 x 0.10)
= 0+0.25+0.3+0.45+0.4
μ = 1.4
Second Moment - Variance
take μ = 1.4
= ((0 - 1.4)2 x 0.35) + ((1-1.4)2 x 0.25) + ((2-1.4)2 x 0.15) + ((3-1.4)2 x 0.15) + ((4-1.4)2 x 0.10)
= 0.686+0.04+0.054+0.384+0.676
σ2 = 1.84
Third Moment - Skewness
take σ =√1.84
= 1.35
= [((0 -1.4)/1.35)3 x 0.35] + [((1 -1.4)/1.35)3 x 0.25] + [((2 -1.4)/1.35)3 x 0.15] + [((3 -1.4)/1.35)3 x 0.15] + [((4 -1.4)/1.35)3 x 0.10]
= -0.38-0.0069+0.0129+0.2442+0.6987
SK = 0.569 ~ 0.57
Fourth Moment - Kurtosis
= [((0 -1.4)/1.35)4 x 0.35] + [((1 -1.4)/1.35)4 x 0.25] + [((2 -1.4)/1.35)4 x 0.15] + [((3 -1.4)/1.35)4 x 0.15] + [((4 -1.4)/1.35)4 x 0.10] -3
= (0.39+0.00187+0.00568+0.287+1.3358) -3
= 2.023 - 3
KT = -0.98
2. What is the significance of expected value when simple mean (Sum of all observations/number of observations) is already in place
The expected value refers, intuitively, to the value of a random variable one would expect to find if one could repeat the random variable process an infinite number of times and take the average of the values obtained.
The Sample mean varies with each sample.
The difference in expected and sample mean differs in application If you were going to calculate the mean from the frequency distribution i.e. by multipying the frequency with the variable and summing up and dividing by the total frequency we can get sample mean.
If we have probability of occurance of random variables we can use expectation formula
The Expected value is calculated as follows for e.g. the player plays the soccer as probability of occurance is given by The probability that they play zero days is 0.2, the probability that they play one day is 0.5, and the probability that they play two days is 0.3.
Here the days are random variable 0days,1day & 2days the occurance of apperance is 0.2,0.5 & 0.3
multiplying both will give 0,0.5 & 0.6 and summing up will give expected values as 1.1
The sample mean varies with the frequency of appearence in the occurance of variable hence the sample varies with the value
3. Having skewness in the curve considered to be bad in the analysis?
Skewness refers to distortion or lack of symmetry in a symmetrical bell curve, or normal distribution in a set of data. If the curve is shifted to the left or to the right, it is said to be skewed. Skewness can be quantified as a representation of the extent to which a given distribution varies from a normal distribution. A normal distribution has a skew of zero.
a) In case of a positive value, mean is to the right of the peak (mode).
b) A value of zero implies the mean coincides with the median and the mode (as in the case of symmetric distributions like normal distributions).
c)A negative value implies the mean is to the left of the peak (mode),
The skewness cannot be considered as good or bad it is the reperesentation of spread of data since the normal distribution have mean,median and mode values are same so it will be symmetry but when there is a difference in the mean,median and mode values the curve gets skewed.
Mean: Average of the Data sets
Median: Central Value in the data sets
Mode : Frequently appearing number in the data set
4)Evaluate the probabilities for continuous normal distribution with given mean = 680 and standard deviation = 31
a)P(X<711)
b)P(X>740)
c)P(600<X<720)
d)P(X=720)
To evaluate we have to calculate Z value from the following formula
Z= X-μ /σ
μ = 680
σ = 31
a) P(X<711)
Z= 711-680/31
= 1
From the Z table (Taken from Internet) the value for P(Z<1) is 0.8413
P(Z<1) = 0.8413 It is the area to the left of the curve Z, because the probability for X<711 is taken.Hence there is 84.1% of data are within the limit 711 for std. deviation of 31 from 680
b) P(X>740)
Z=740-680/31
=1.935
from we can find the probability of P(Z<1.935)
P(Z<1.935)=0.9713 This the area to the left of the score
The area to the right of the score gives the value greater P(X>740), the total area of the distribution would be 100% so we can take it as
P(Z>1.935)=1-P(Z<1.935)
=1-0.9713
=0.0287
The area to the right of Z score which give the value of 0.0287 which is 2.87% of probability P(X>740)
c)P(600<X<720)
Z=600-680/31
=-2.58
Z=720-680/31
=1.29
We have to find the area for Z score -2.58 and 1.29 and subtract the value to get the probability P(-2.58<Z<1.29)
P(-2.58<Z<1.29)=0.90147 - 0.00466
P(-2.58<Z<1.29) = 0.89681
89% of are are between P(600<X<720)
d)P(X=720)
Z=720-680/31
=1.29
find the area for Z<1.29 and subtract it to get the probablity P(1.29<Z<1.29)
Z<1.29=0.90147
0.90147-0.9032=0
This gives the P(X=720)
5)Explain the curve
The curve is the normal distribution curve for the random variable and the percentage is the standard deviations from the mean.The normal distribution is a probability function that describes how the values of a variable are distributed. It is a symmetric distribution where most of the observations cluster around the central peak and the probabilities for values further away from the mean taper off equally in both directions.
1σ (std.Deviation) from the mean is arounnd 34.1 either side of the mean and hence the values lies between -34.1 and +34.1,so 68.2% of values falls in the 1 std.deviation.
2σ (std.Deviation) from the mean is taken as 34.1+34.1+13.6+13.6=95.4% approximately the values falls in the 2 std.deviation from the mean
Likewise 3σ (std.Deviation) rom the mean is taken as 34.1+34.1+13.6+13.6+2.1+2.1=99.7% approximately the values falls in the 3 std.deviation from the mean
The perfect normal distribution curve will have no skewness and distribution follows the symmetry.