












































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!













































Statistics is the art of learning from data. It is concerned with the collection of data, their
subsequent description and their analysis which often leads to drawing conclusion.
called DESCRIPTIVE STATISTICS
We toss a coin 10 times and we get the sequence T T T H T H T T T T
computing the proportion of TAILS we obtained, that is 80%
fair and 80% of TAILS can be explained by chance?
The possibility of chance must be considered for an inferential approach: we can’t just
use the data found with the descriptive approach.
It is usually necessary to make some assumptions about the chances of obtaining the
different data values, the totality of these assumption is referred to as a probability
model for the data
Statistical inference starts with the assumption that important aspects of the phenomenon
under study can be described in terms of probabilities and then it draws conclusions by using
data to make inference about these possibilities
Probability theory provides a key tool for statistical inference
A typical inferential problem consists in drawing conclusion on a population by analysing only a
subgroup of the total
In order for the sample to be informative about the total population, it must be representative
of that population:
The statistical units composing a sample can be described by random variables.
There are 2 types of random variables:
A sample of k members of population is said to be a random sample if the members are
chosen in such a way that all possible choices of the k members are equally likely.
Random experiment: roll of 2 dice
S:sample space = {(1,1)(1,2)(1,3)…}
X: #of 6= number of six out of the two dice
Range of X : {0,1,2}: X can takes these values.
x:number, realization of X
௦ ௪௧ ௭
௧௦ ௌ
௦ ௪௧
௧௦ ௌ
௦ ௪௧ ௧௪
௧௦ ௌ
X P(X=x)
Or
A random variable X is discrete if
௫ఢோ
భ
The distribution of the discrete random variables ( of X) is given by the list of probabilities
P(X=x) for all the values in the range of X.
A random variable X is continuous if P(X=x)=0 for all x€ R
A random variable X is continuous if there is a density function f such that:
Whenever a<= b
We consider a known function h of the sample which defines a new random variable Y that is
Y=h(X 1
2
n
2
n
induces a distribution on Y
There are 3 main approaches:
2
n
Or we can approximate the distribution of Y in 2 ways:
Generally, it’s easier to study the distribution of Y n
when n ∞. Then when n is large
we can approximate the distribution of Yn with the one holding when n—> ∞.
We can use Monte Carlo simulation to approximate the distribution of Y
That is we simulate -via computer- a realisation of the sample X1,X2,…,Xn, and based
on the simulated value, we compute one realisation of Y. We repeat the same process
many times and obtain many realisations of Y.
2
n
we obtain x 1
, x 2
, x n
2
n
2
n
starting from these we can approximate the distribution of Y ( e.g via histogram)
EXAMPLE n 1
Suppose we have X 1
2
i.i.d they are a random sample of size n = 2 with distribution given by
Range of X 1 ,
2
And consider the random variable Y defined as :
2
1,
2
1/
S= sample space = {(1,1)(1,2)(1,3)…}
We call random sample a collection of random variables X 1
2
n
that are independent and
identically distributed (i.id) from a common distribution(?)
Note that Y is the geometrical mean
of X1,X2: more in general Y n
1,
2
n
1/n
Range of Y 2
Now we can compute the exact distribution of Y
But what is the distribution of Y n
if the sample size n is larger? For example, n=20?
S=sample size = 3^20 so the explicit approach is not an option.
We can use the asymptotical approximation.
It’s convenient to work with :
Log ( Yn)= log ((X 1,
2
n
1/n
ଵ
log
ୀଵ
Thanks to the central limit theorem
Log ( Y20) ~N(0,4479;0,1052^2)
Approximation via Monte Carlo simulation.
Replicate nr 1
Now we repeat the procedure n times so , in this way, we have n values for n repliactes
we approximate the distribution of Y
TWO fair dice are rolled
1
: out come of die 1
2
: out come of die 2
We define a random variable W as : W = X 1
2
Range W = {1,2,3,4,5,6,8,9…}
We could compute the exact distribution, proceeding as before
Let Y = 0 and define the sequence of random variables {Xn} as Xn ~Exponential ( n).
Show that {Xn} converges in probability to Y
Firstly, we recall the exponential distribution
We say X n
~Exp( λ), λ > 0 if its PDF is given by
ି ఒ௫
௫
I.E X is a RV taking values in [0; ∞+] and E[X]= 1/λ
Let X 1
2
… be an infinite sequence of random variables also denoted by {X n
} and another variable Y.
we say that the sequence {X N
} converges in probability to Y if, for any ε>
→ஶା
𝑃(|𝑋𝑛 − 𝑌| > ε) = 0
We want to show that:
→ஶା
ε
Given that
This could be rewritten as ( f(x) is the PDF of Xn)
n
ε) = ∫ 𝑓
ାஶ
ఌ
ି ௫
ାஶ
ఌ
Solving the integer
= nቂ−
ଵ
ି ௫
ఌ
ାஶ
ଵ
ି ஶ
ଵ
ି ఌ
ቃ ൨ = 0 + e
-nε
Then
→ஶା
ε
→ஶା
ି ఌ
SO Xn Y
Say X 1
n
… is an infinite sequence of independent and identically distributed random variable,
coming from a distribution with mean μ and variance Ϭ
2
Consider the average of the first n random variable of the sequence that
Mn=
ଵ
(X1, +…+Xn)=
ଵ
ୀଵ
n
is called sample mean ( is also denoted as 𝑥̅ )
What can we say about the distribution of M n
Example
Experiment: sequence of tosses of a fair coin
1
2
where X i
The mean of X 1
( or equivalently of X i
, since they are I.ID) is
μ = E[X 1
]=0 * P(X=0) + 1P(X=1) = 0.50 + 0.5*1= 0,5 mean of distribution of each
observation
What’s about M n
Example with continuous random variable
If X is a continuous RV by definition we have a PDF f associated to X
0
) = P(X≤x 0
௫
ିஶ
convergence in distributions studies the difference between distributions ( or CDF)
that one of Y is easier. If we know that the sequence {Xn} converges in distribution to
Y, then we can use the distribution of Y to approximate that one of Xn (if n is large
enough)
The convergence in P is stronger than the convergence in D
Xn y then Xn y
But if Xn y then it’s not always true that Xn y
show that a {Xn} converges in distribution to Y, where:
and 𝑌 ቄ
We want to show that {Xn} Y, that is if lim n→∞ P(Xn ≤ x) = P(Y ≤ x) for any x such that
P(Y=x)=0 (that is, in this case, for every x different from 1)
let X1,X2,… be an infinite sequence of random variables, also denoted by {Xn}, and another random
variable Y. We say that the sequence {Xn} converges in distribution to Y if lim n→∞ P(Xn ≤ x) = P(Y ≤ x)
for any x such that P(Y=x)=
CDF OF Xn
IS THE LIMIT OF P(Xn ≤x) EQUAL TO P(Y≤x)?
We need to check that this is the case for every x different from 1
→ஶ
P(X≤x) = lim
→ஶ
0 = 0 = P(Y≤x)
→ஶ
P(X ≤ x) = lim
→ஶ
1/𝑛 = 0 = P(Y≤x)
→ஶ
P(X ≤ x) = lim
→ஶ
1 =1 == P(Y≤x)
So {Xn} Y
informal statement of central limit theorem
the sum of n i.i.d. random variables is approximately normal when n is large
or (equivalent statement)
the mean of n i.i.d. random variables is approximately normal when n is large
RECALL: normal distribution
A normal RV takes values on the real line, it is a continuous RV with PDF given by :
,f(x)=
ଵ
√ଶగ⋅ఙ
ି
భ
మ
( ௫ି௨
)
మ
ఙ
మ
2
= 1 we have the special case of standard normal Z ~𝑁(0,1)
mean of the distribution
What can we say about the distribution of Z n
? is it close to normal?
first we observe that, being standardised, Zn has 0 mean and unit variance (like the standard
normal)
If X1,X2,… are i.i.d. R.V. with finite mean μ and finite variance σ2, and Z is a standard normal
R.V., then{ Zn} → Z where
Zn =
ଵା⋯ି ∗௨
ఙ∗ √
ௌି ∗௨
ఙ∗ √
and Z ∼ N(0,1)
n
Which means that ( by definition of convergence in distribution)
approximately the distribution of Z
Zn=
ௌିா [ௌ]
ௌ(ௌ)
ௌି ∗௨
ఙ∗ √
( standardization of Sn)
If X~N(μ,Ϭ
2
) and Y= aX + b
Y~(aμ + b ; a
2
2
n
n √
ଶ
N
ଵ
n
n
n
n
1
𝑛
1
𝑛
ଶ
ଶ
n
n
N
PROBLEM:Ϭ the SD of the population distribution ( of X 1
n
) it is likely to be unknown
beside μ
If we can estimate σ2 with an estimator -say Sn2-, then we have a way to assess the error in
estimating μ
ଶ
ଶ
ୀଵ
It has good properties as an estimator of σ
2
ଶ
]= σ
2
The estimator, “ on average” takes the value σ
2
thanks to WLLN, we could show that 𝑆
ଶ
—converges in P σ
2
REMARK: If we estimate σ2 with Sn2 the (already approximate) distribution of Mn is not
anymore normal but is a student-t. Nonetheless, when n is large, the student-t is
approximated by a normal distribution
n
is called sample standard deviation the 0,95% confidence interval for μ becomes
n
± 1.96 ⋅ Sn √
we should look for the equivalent number for the student
large n confidence intervals with level of confidence 1-α:
Confidence interval M n
± 𝑍𝑎/2 ⋅ Sn √
Level of confidence α α/2 z α/
APPLICATION OF CLT: Normal approximation for the binomial distribution
Recall: Bernoulli and Binomial distributions
X~Bernoulli (p), p€[0,1]
If X can take only 2 values, say 0 and 1, (failure and success )with distribution given by
P(X=1)=p and P(X=0)=1-p
E[X] = 1* P(X=1)+0 *P(X=0)= p
VAR[X] = p(1-p)
Say X 1,
2
n
are independent Bernoulli experiments in each experiment p is the probability of
success
1,
2
n
= # success out of n experiments
The distribution of Y is binomial with parameters n, p
Y~Binomial(n,p)
What is the distribution of Binomial ( n,p)?
P(Y= k) for a fixed of k
111…1000..0 examples of outcomes that leads to k success and n-k failure
Probability of this specific sequence
Ppp..p*(1-p)(1-p)… = p
k
( 1-p)
n-k
each specific sequence with k success and n-k failures will
have P p
k
( 1-p)
n-k
: the order doesn’t matter
P(Y= k)= #sequences with exactly k success ways we can choose k elements out of n
!
!
( ି
) !
P(Y= k)= = ቀ
ቁ p
k
( 1-p)
n-k
distribution of binomial ( n,k)
E[Y]= np
VAR[Y]= np(1-p)
Y ∼ Binomial(n, p) Y = X1 + X2 + … + Xn = S n
with Xi i.i.d. Bernoulli(p)
We can apply the CLT
n
~ N(np,np(1-p)
we toss a coin n times and assume the coin is biased towards head. Specifically, n=1000 and
p=0.6. Compute the probability that the number of heads is least 550 and does not exceed
X= n of heads We want to compute P(550≤X≤ 625)
X=Binomial(n=1000, p=0.6)
It would be possible to compute P(550≤X≤ 625) considering X as a binomial and computing
P(X= 550) +P(X=551)… but the calculation are cumbersome.
But we know that X~apx N(np, np(1-p)
E[X]= np= 600
VAR[X]= np(1-p)= 240
So that X~apx N(600, 240)
ଶହା .ହି
√ଶସ
ହସଽା.ହି
√ଶସ
N= 100 students ( sample)
82 = non smokers
We want to estimate the proportion π of non smokers in the population of students
1
2
n
where X 1=
Xi = bernoulli ( π)
E[X]= π
VAR[X]= π(1- π)
1
2
n
= # non smokers in the sample
We know Y~ Binomial (100, π)
Y/n=
ଡ଼ଵ ଡ଼ଶ ଡ଼୬
=Mn= sample mean
By CLT Mn~ N(π,
(ଵି )
Confidence interval of confidence 1-a
Mn±Za/
గ
( ଵିగ
)
,଼ ଶ (ଵି ,଼ ଶ )
ଵ
The law of large numbers tells us that the sample mean Mn converges in probabiity to the
population mean μ.
Say μ is unknown. LLN suggests that, conditionally on the observation of a sample X1,X2,…,Xn,
we can use the average of the observations to estimate μ.
Monte Carlo approach: we can “create” observations by using a computer.
Say we want to study some property of a distribution (e.g. the mean μ of the population
distribution): if we know how to simulate realizations from that distribution, we can generate a
sample (as large as we want) and use that to estimate the property of the distribution.
REMARK: number generated with a computer are the result of a sequence of deterministic
operations and therefore they’re not random pseudo random
( in this course we will skip this distinction)
let Z~N(0,1) and Y=Z^2 +1. Compute P(2<Y<3)
assume we know how to simulate realizations from a standard normal via computer
say we generate n realization of Z ( with n large)
for zi we can compute the corresponding value taken by y = z^2+
Let’s define the random variables W1,W2,Wn as