Docsity

Statistics Notes Pt. 2 2020, Appunti di Statistica

Toggle sidebar
bg1
Second part
Probability
Random experiment: a random experiment is a process leading to two or more uncertain
outcomes.
Examples of random experiments could be tossing a coin: it has two uncertain outcomes,
head or tails. Another example can be rolling a die: if it is regular, we have six possible
uncertain outcomes.
The basic outcome is each of the possible outcomes of a random experiment.
The sample space is the collection of all possible basic outcomes in a random experiment.
The event is any subset of basic outcomes from the sample space.
So for example, we identify a random experiment, a possible basic outcome and a sample
space.
Probability is the chance that an uncertain event will occur (always between 0 and 1). It is
also the proportion of times an event will occur, assuming that all outcomes in a sample
space are equally likely to occur.
We need now to introduce the Laplace rule, which states that the probability of an event A is
equal to the ratio of the total number of basic outcomes included in A, to the total number of
elements included in the sample space.
P (A) = n (A)/N
Random variable: a random variable is a variable that takes on numerical values
determined by the outcome of the random experiment. 🡪 E.g. tossing a coin H = +1 / T = -1
X: S 🡪 R
Random variables can be of two kinds:
1. Discrete random variables
If can take on no more than a countable number of values.
Discrete does not mean finite, but finite means discrete.
Special discrete random variables: a discrete random variable is a
variable that can take on no more than a countable number of values.
E.g. if we toss two coins, with different combinations. We can define a
random variable X= number of heads you can observe.
Discrete probability distribution is a table, which associates a random
value of x to the probability that an event happens.
The sum of all the probabilities is always 1.
2. Continuous random variables
if it can take any value in an interval.
We need concepts: the expected value of a random variable that is equal to E(X) = Sigma X
P(X), and variance.
Discrete probability distribution: expresses the probability that X takes the value x, for all
values of x.
The P(X) function is always > or = to 0 and > or = to 1.
The distribution can be represented by a graphical demonstration 🡪 Bar chart.
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13

Anteprima parziale del testo

Scarica Statistics Notes Pt. 2 2020 e più Appunti in PDF di Statistica solo su Docsity!

Second part Probability Random experiment: a random experiment is a process leading to two or more uncertain outcomes. Examples of random experiments could be tossing a coin: it has two uncertain outcomes, head or tails. Another example can be rolling a die: if it is regular, we have six possible uncertain outcomes. The basic outcome is each of the possible outcomes of a random experiment. The sample space is the collection of all possible basic outcomes in a random experiment. The event is any subset of basic outcomes from the sample space. So for example, we identify a random experiment, a possible basic outcome and a sample space. Probability is the chance that an uncertain event will occur (always between 0 and 1). It is also the proportion of times an event will occur, assuming that all outcomes in a sample space are equally likely to occur. We need now to introduce the Laplace rule , which states that the probability of an event A is equal to the ratio of the total number of basic outcomes included in A, to the total number of elements included in the sample space. P (A) = n (A)/N Random variable : a random variable is a variable that takes on numerical values determined by the outcome of the random experiment. 🡪 E.g. tossing a coin H = +1 / T = - X: S 🡪 R Random variables can be of two kinds:

  1. Discrete random variables If can take on no more than a countable number of values. Discrete does not mean finite, but finite means discrete. Special discrete random variables: a discrete random variable is a variable that can take on no more than a countable number of values. E.g. if we toss two coins, with different combinations. We can define a random variable X= number of heads you can observe. Discrete probability distribution is a table, which associates a random value of x to the probability that an event happens. The sum of all the probabilities is always 1. 2. Continuous random variables if it can take any value in an interval. We need concepts: the expected value of a random variable that is equal to E(X) = Sigma X P(X) , and variance. Discrete probability distribution: expresses the probability that X takes the value x, for all values of x. The P(X) function is always > or = to 0 and > or = to 1. The distribution can be represented by a graphical demonstration 🡪 Bar chart.

Expected value (or mean) of a discrete distribution (weighted average) is mean = E(X) = sum of xP(X). You can calculate it also in a numerical (not probability) way with mean = sum of xi/N (the same as in descriptive statistics). It will lead to the same results. Variance: Ơ2 = E(X-mean)^2P(X) Standard deviation: Square root of variance. Continuous random variable: a variable that can take any value in an interval. They cannot be counted. The most important difference between discrete and continuous variables is that in discrete probability when you observe random variables you can put an order in your x, there is no point in the middle. There is a correspondence, it makes sense to ask what is the P(X= n). Continuous random variables have ∞I’ve outcomes. The probability of observing n is one point in a ∞ive set of out counting variables. They tend to zero, so we have difficulty in the continuous variability because the answer in a point probability always tends to zero. In continuous random variables, we can only assign possibilities to a range of data. P (a<X<b) where a and b are the extremes of an interval. P (a<X<b) = length of a-b/total length of the interval. 🡪 a<b To overcome the problem we have to study the probability density function: a function that allows computing probabilities in a range of data. It is needed because in an interval we can have different probabilities. F(x) = density function P (a<X<b) = integral a b of f(x) d(x). 🡪 Is the area of the area between the function and the horizontal axes? The probability density function (f(x)) of a random variable x is a function with the following properties:

  1. F(x) > 0 for all value of x
  2. The area under the probability density function over all values of the random variable x is equal to 1. P (μn < x max) = 1 🡪 If is defined in all R P (- ∞ < x < + ∞) = 1
  3. Let a and b two possible values of x, with a < b, then the probability that x lies between a and b is the area under the density function graph between the two values. F(x) = density function P (a<X<b) = integral a b of f(x) d(x).
  4. The probability that a value x of the random variable does not exceed the value Xo is the area under the probability density function f(x) from the minimum value up to the Xo. P (< or = Xo) = integral – ∞ + ∞ of f(x) d(x). 🡪 The cumulative density function is F (Xo) = Pr[x> or = Xo] – ∞ < Xo < + ∞.
  • Different locations of the normal on the horizontal axis are indicated by differences in mean. Therefore, if we keep constant the value of sigma and change μ we can observe the shift of the distribution on the horizontal axis. If μ increases, the shift is to the right, if decreases it is to the left. μ = the location parameter. Its range is + ∞/ - ∞. On the other hand
  • differences in Ơ2 result in density functions with different width. It means that the highest Ơ 2 the wider would be the distribution. Sigma would always be between 0 and + ∞. How to obtain probabilities for a specified normal distribution (with μ and sigma known)? Before computing probabilities, we have to introduce the concept of cumulative distribution function : Definition: suppose that x is a normal random variable, or it is normally distributed with mean μ and variance Ơ2: x follows (~) N (μ, Ơ2). Then the cumulative distribution function is defined as follows: F (Xo) = Pr (X > or = Xo) Cumulative distribution function in Xo indicates the probability that the random variable x does not exceed the value Xo.

However, it is impossible to compute the area with the tools of simple algebraic expression for calculating the cumulative distribution function values. We do not have a convenient way to directly compute probabilities. In order to overcome the problem of computing probabilities we use numerical procedures with the use of computers. The computer collects results in a table, uploaded on bb that you can use on the day of the examination. How do you use this table? The computer collects result on a table only for a particular Normal density function, with μ= 0 and ơ^2 = 1 which is named “standard normal distribution” Definition: Let Z be a normal random variable with μ=0 and variance = 1 that is Z ~ N (0, 1). We say that Z follows a standard normal distribution. We can obtain probabilities for any normally distributed random variables z, but what about normally distributed variables other than μ= 0 and ơ^2 = 1. 🡪 There is always direct relationship between any normally distributed random variable and z. The relationship uses the following transformation Let x be a normally distributed random variable: x ~ N (μ, ơ^2 ) then it is possible to transform x into a z score in order to read probabilities in the table using the following transformation. Z= (X - μ)/ơ 🡪 called standardization If you are interested in computing Pr (x < or = Xo) it is the same of computing Pr (Z < or = (Xo- μ)/ơ)

The parameter is a constant, meanwhile the mean is a variable 🡪 the statistic is a random variable. We use it in order to permit a parameter in descriptive statistics. In the 18, 18 case we are unlucky, because it distant from 21 (the mean) 🡪 the sample is not so representing with the population. Equally with 24, 24. These two are our extreme cases. Those are very unlikely events, because we have them just one time in sixteen. Only one out of sixteen times, we are so unlucky to under/overestimate the value. What changes in the first/second case is the order of the observation: nineteen for example is slightly better, we have it in 2 cases out of sixteen (1/8). We need to predict a value as close as possible to the mean 🡪 not the exact level, but a close result. Using a sample means allowing us to be more likely to be lucky than unlucky. Using sample means in order to predict population mean increases the probability of being lucky! Taking the population, we have uniform results: with the sample mean, we have different results with lower probabilities in the tails. The most important thing is that using a sample means you are more likely to fall in the centre than out-centre. Using sample means in order to predict population mean increases the probability of being lucky. Using sample means, even if with fewer data, is better than using a single x. What we learn is that sample mean is a good predictor for the mean of the population. This is not formally correct, it is better to say that x bar 🡪 is a good estimator for μ an estimator of a population parameter such as μ is a random variable that depends on the sample formation. Indeed we obtain x bar = xi + x2 + … xn / 2 its values provide approximations of the unknown parameter. A specific value of that random variable is called estimate (the particular value you can obtain). Estimator 🡪 is the function of random variable. Estimate 🡪 single number, which the estimator can assume. This distribution is no longer uniform, but different. Summary measures of this sampling distribution: This is an unbiased estimator = we can get the single variable wrong, but the mean is very likely true. The mean would be equal to the median, in the distribution. When E(X) predicts the mean of the parameter, it

is called an unbiased estimator. An estimator is unbiased if its expected value is equal to the parameter of interest. If the distribution is symmetric mean = median, but 21 is the mean of the population. Sample mean on average predicts the mean of the population 🡪 when an estimator on average predicts the value of the parameter Sample mean on average predicts the mean of the population. AN ESTIMATOR IS UNBIASED when on average it correctly predicts the value of the parameter. N ESTIMATOR IS UNBIASED when its expected value is the same as the parameter value. Now you are replacing x bar instead of x, for its standard deviation, getting the error. To get the standard deviation of the mean you need the square root of sample mean variance. The standard deviance is different: it means that with the population is more likely to indicate the mean of the population, but it is the same with the sample means, with less standard deviation (error). If the variance decreases, because standard deviance decreases its value, you are more likely to fall close to the mean. You can fail in correspondence of just one sample, but the fact that the variance is very low, allows us to see that if we fail, we fail by committing a very small error. Because sample mean reduces the variance. This means the estimator is very efficient. Is there a way to obtain 1.58, in a shorter manner? We can also appreciate that the larger the value of the sample size, the closer we go to a value of the correct parameter (because the error decreases). If we have a sample mean with a ∞ sample size, then the sample mean always predicts the mean with error close to zero. The larger the sample size the more accurate the prediction. 🡪 The variance decreases. The expected value of the expected mean is the mean of the population.

Statement of the central limit theorem Let xi, x2, xn be a set of n independent random variables having identical distributions with mean μ and variance and x bar as the mean of these random variables. As n becomes large, the central limit theorem states that the distribution of: Approaches the standard normal standard distribution, regardless of the underlying probability distribution of x. Central limit theorem is important in statistics because it provides us a distribution for x bar in any case. X bar is a good estimator of μ. An estimator of a population parameter is a random variable that depends on the sample information. Its values provide approximations of this unknown parameter. A specific value of that random

variable is called an estimate. Estimator 🡪 function of random variable. The estimator we are interested in is sample mean, x bar in order to predict the unknown mean of the population μ. X bar is a good estimator for μ because:

  1. It is unbiased E(X) = μ On average, the sample mean predicts exactly the mean of the population.
  2. It is efficient: V(x bar) = variance/n is the minimum we can obtain: When you collect information and summarise them in a sample you obtain that this is a good method. When you want to estimate the mean of the population, it is a good choice to calculate the sample mean with sample-sized data. The sample mean is a good estimator of the mean of the population. X bar can also be defined as a point estimator for the mean; it means it provides a single value for the mean. Therefore, point estimates are likely to fail to predict the mean, even if they are likely to be close to the real value of the parameter. Our objective is to find a range of values which is likely to include the unknown parameter. In this case, our aim is to estimate population mean with sample information. We first assume that a random sample is taken from a population with an unknown mean, and a known value for sigma^2. This is a complementary way to describe our estimation procedure. We assume:

Confidence interval for the mean (with sigma known) The general formula for all confidence intervals is point estimate +/- (Reliability Factor) (Standard Error) The value of the reliability factor depends on the desired level of confidence. In the case of the sample mean, when sigma is known, the formula is: (where z (Alfa/2) is the normal distribution value for a probability of Alfa/2 in each tail). The confidence interval can also be written as xbar +/- ME where ME is called the margin of error: The margin of error can be reduced if:

  1. The population standard deviation can be reduced (sigma down)
  2. The sample size is increased (n up)
  3. The confidence level is decreased (one – Alpha). Commonly used confidence levels are 90%, 95% and 99% (go check the table for this). Example 🡪 go see at the first rec of 10/ 🡪 Consulting the tables. You can obtain: The upper limit and lower limit are very likely to include the mean of the population. 1.96 is the reliability factor which depends on one – Alfa (= 0.95). The Sigma divided square root of n is the standard error. Moving to a general setting (general formula to learn): Example – Suppose that shopping times for customers at a local market are distributed with known population standard deviation of 20 minutes. A random sample of 64 shoppers in the local grocery had a mean time of 75 minutes. Answer to these questions:

A) Find the standard error of the sample mean B) Compute the upper and the lower confidence limits of a 95% confidence interval for mi. C) How to do the results obtained at point b) change if 1 – Alfa =90%. Sigma = 20 n = 64 x bar = 75 🡪 Tables.

You cannot use Z, because it works only if you use sigma or S with a very large sample size. The approximation, if zeta can’t be used, we use student’s T. Student’s T is a distribution which approximates the normal one when s replaces sigma and the sample size is not large enough in order to guarantee that normal density function does work. Student’s T is a flexible family of distribution, with an increasing quality as the sample size goes up. As n grows up towards ∞, the student’s t becomes more and more similar to the normal density. Then, student’s t and a normal density function are the same. 🡪 n-1= degrees of freedom When n largely increases S 🡪 sigma When n goes to infinitive S = sigma Confidence interval for the mean with sigma unknown Assumption: ● Population standard deviation is unknown ● Population is normally distributed. ● If the population is not normal, use a large sample. Use Student’s t distribution, confidence interval estimate: The t is a family of distribution; the t value depends on degrees of freedom. Number of observations that are free to vary after the sample mean has been calculated: d.f. = n – 1. We need the student’s t table just to have the confidence interval. Listen again to the last ten minutes.

The value of t decreases a becomes closer to a normal one, if n goes up. The better the sample size, the better the accuracy of our estimate. Example Practical case Intro In the case of the sample, the error is called residual.

B1 measures the estimated change in the average value of Y because of a one-unit change in X. Here, b1 = 2.745 tells us that the average value of revenues at box office increases by 2.745 million dollars, on average, for each additional one million dollar of budget. So if you increase the budget by 1 million dollars, you will expect the box office to grow by 1 million dollars. Prediction: The regression equation can be used to predict a value for y, given a particular x. for a specified value, xn+one, the predicted value is: Predict the revenues for a movie with 100 million dollars of budget: Box Office Revenues = 471.484 + 2.745 · 100 = = 471.484 + 274.5 = 745.984. The predicted revenue for a movie with 100 million dollars of budget is 745.984($1,000,000s). Coefficient of Determination, R The coefficient of determination is the portion of the total variation in the dependent variable that is explained by variation in the independent variable ß the coefficient of determination is also called R-squared and is denoted as R2.