Scarica Statistics and Probability e più Dispense in PDF di Statistica solo su Docsity!
Crash Course - Statistics
Beniamino Sartini
Table of contents
- Summary
- I Probability
- 1 Basic set theory
- 1.1 Set operations
- 1.2 Indicator function
- 1.3 Limits of sets
- 1.4 Monotone Sequences
- 1.5 Fields and sigma-fields
- 2 Probability measure
- 2.1 Consequences of the axioms
- 3 Measurable maps
- 3.1 Maps and inverse maps
- 3.2 Random variables
- 3.2.1 sigma-field generated by a map
- 3.3 Induced distribution function
- 3.3.1 Distribution function on ℝ
- 3.3.2 Survival function
- 4 Independence
- 4.1 Independent random variables
- 4.2 Independence theorems
- 5 Expectation
- 5.1 Simple functions
- 5.1.1 Expectation of simple functions
- 5.2 Extension of the definition
- 5.2.1 Non-negative random variables
- 5.2.2 Integrable random variables
- 5.3 General definition
- 5.3.1 Variance and Covariance
- 5.3.2 Skewness
- 5.3.3 Kurtosis
- 5.4 Review of inequalities
- 6 Conditional expectation
- 6.1 Properties of conditional expectation
- 6.2 Conditional probability
- 6.2.1 Conditional variance
- 7 Moment generating functions
- 7.1 Characteristic functions
- 8 Convergence concepts
- 8.1 Types of convergence
- 8.2 Laws of Large Numbers
- 8.2.1 Strong Laws of Large Numbers
- 8.2.2 Weak Laws of Large Numbers
- 8.3 Central Limit Theorem
- II Statistics
- 9 Introduction
- 9.1 Population and Sample
- 9.2 Estimators
- 9.2.1 Properties
- 9.2.2 Sufficiency and Completeness
- 10 Moments
- 10.1 Sample mean
- 10.2 Variance
- 10.3 Skewness
- 10.4 Kurtosis
- 11 Likelihood
- 11.1 ML Estimator
- 11.1.1 Independent sample
- 11.1.2 IID sample
- 11.1.3 Properties MLE
- 11.1.4 MLE in the Gaussian case
- 11.2 Quasi-Maximum Likelihood
- 11.2.1 QML Estimator
- 11.2.2 Properties
- 11.2.3 Sandwich Standard Errors
- 12 Hypothesis tests
- 12.1 Tests for the means
- 12.1.1 Test for two means and equal variances
- 12.1.2 Test for two means and unequal variances
- 12.2 Tests for the variances
- 12.2.1 F-test for two variances
- 12.3 Left and right tailed tests
- 13 Multivariate data
- 13.1 Vector of means
- 13.2 Deviation matrix
- 13.3 Variance-covariance matrix
- 13.4 Standardized variables
- 13.5 Correlations matrix
- III Linear models
- 14 Introduction
- 14.1 The matrix of data
- 14.2 Joint, conditional and marginals
- 14.3 Conditional expectation model
- 14.4 Uniequational linear models
- 15 Classic least squares
- 15.1 Assumptions
- 15.2 Estimator of 𝑏
- 15.2.1 Projection matrices
- 15.2.2 Properties OLS
- 15.3 Variance decomposition
- 15.3.1 Estimator of 𝜎^2 u
- 15.3.2 R
- 15.4 Diagnostic
- 15.4.1 t-test for 𝑏𝑗
- 15.4.2 Confidence intervals for 𝑏
- 15.4.3 F-test for the regression
- 15.5 Multi-equations OLS
- 16 Generalized least squares
- 16.1 Working hypothesis
- 16.2 Generalized least squares estimator
- 16.3 Properties GLS
- 17 Restricted least squares
- 17.1 Multiple restrictions
- 17.2 Restricted least squares
- 17.3 A test for linear restrictions
- IV Time Series
- 18 Time series
- 18.1 Stationarity
- 18.2 Notable processes
- 18.3 Lag operator
- 18.3.1 Polynomial of Lag operator
- 19 MA and AR processes
- 19.1 MA(q)
- 19.2 AR(P)
- 19.2.1 Stationary AR(1)
- 19.2.2 Non-stationary AR(1): random walk
- 20 ARMA processes
- 20.1 ARMA(p, q)
- 20.2 Moments
- 21 Conditional variance processes
- 21.1 ARCH(p) process
- 21.2 GARCH(p,q) process
- 21.3 IGARCH
- 21.4 GARCH-M
- 22 GARCH(1,1) moments
- 22.1 First moment 𝜎^2 𝑡
- 22.1.1 Short-term
- 22.1.2 Long-term
- 22.2 Second moment 𝜎^2 𝑡
- 22.2.1 Short-term
- 22.2.2 Long-term
- 22.3 Variance 𝜎^2 𝑡
- 22.4 First moment 𝜎𝑡
- 22.4.1 Short-term
- 22.4.2 Long term
- 22.5 Variance 𝜎𝑡
- 22.5.1 Short-term
- 22.5.2 Long term
- 22.6 Third moment 𝜎𝑡
- 22.6.1 Short-term
- 22.6.2 Long term
- 22.7 Covariance
- V Diagnostic tests
- 23 Stationarity tests
- 23.1 Dickey–Fuller test
- 23.2 Augmented Dickey–Fuller test
- 23.3 Kolmogorov-Smirnov test
- 24 Autocorrelation tests
- 24.1 Durbin-Watson test
- 24.2 Breusch-Godfrey
- 24.3 Box–Pierce test
- 25 Normality tests
- 25.1 D’Agostino skewness test
- 25.2 Anscombe Kurtosis test
- 25.3 D’Agostino-Pearson 𝐾^2 test
- 25.4 Kolmogorov-Smirnov test
- 26 Value at Risk test
- 26.1 Test on the number of violations
- 26.1.1 Asymptotic variance
- 26.1.2 Empirical variance
- VI Notable Distributions
- 27 Bernoulli random variable
- 27.1 Distribution and density
- 27.2 Characteristic function
- 27.3 Moments
- 28 Exponential distribution
- 28.1 Distribution
- 28.2 Quantile
- VII Appendix
- 29 Calculus
- 29.1 Fundamental limits
- 29.2 Derivatives
- 29.3 Integrals
- 29.3.1 Fundamental theorem
- 29.3.2 Integration by parts
- 29.4 Useful relations
- 30 Probability
- 31 Linear Algebra
- 31.1 Vector multiplication
- 31.2 Matrix multiplication
- 31.3 Special matrices
- 31.3.1 Basis vector
- 31.3.2 Matrix of ones
- 31.3.3 Identity matrix
- 31.4 Determinant
- 31.5 Trace
- 31.6 Derivatives
- 31.6.1 Gradient
- 31.6.2 Jacobian
- 31.7 Lagrange Multipliers
- 32 Notable relations between distributions
- 32.1 Chi squared
- 32.1.1 Relations with others distributions
- 32.2 Student-t
- 32.2.1 Relations with others distributions
- 32.3 Fisher–Snedecor
- 32.3.1 Relations with others distributions
- References
Summary
General notations
- Ω: abstract set representing the sample space of a random experiment. The elements 𝜔 ∈ Ω are the possible outcomes of the experiment.
- 𝒫(Ω): power set of Ω, the set of all possible subsets of Ω.
- Most subsets 𝐴, 𝐵, … will be thought of as events.
- Collections of subsets: 𝒜, ℬ, ….
- The empty set ∅.
- ℬ is a sigma-field, usually connected with the sample space Ω.
- ℬ(ℝ) is the Borel sigma-field of ℝ.
- ℙ is a probability measure function ℙ ∶ ℬ → [0, 1].
- (Ω, ℬ, ℙ) is a probability space.
- ⊔ is a shortcut to denote a disjoint union, for example writing 𝐴⊔𝐵 means that the sets 𝐴 and 𝐵 are disjoint, while writing 𝐴∪𝐵 means that the sets 𝐴 and 𝐵 are not disjoint.
- 𝑋 denotes an univariate random variable.
- Bold letters, such as X 𝑛 = (𝑋 1 , 𝑋 2 , … , 𝑋𝑖, … , 𝑋𝑛), denote a random vector with 𝑛 elements, where each 𝑋𝑖 is a random variable. Instead, x 𝑛 = (𝑥 1 , 𝑥 2 , … , 𝑥𝑖, … , 𝑥𝑛) denotes a vector, where each 𝑥𝑖 is a scalar.
- X denotes a random matrix. More precisely, X = ( X 1 , X 2 , … , X 𝑗, … , X 𝑘), where X 𝑗 is a random vector related to column 𝑗 with 𝑛 elements. In a matrix context, the index 𝑖 denotes a generic row, while 𝑗 denotes a generic column.
1 Basic set theory
Reference : Chapter 1. Resnick (2005).
In probability, an event is interpreted as a collection of possible outcomes of a random exper- iment.
Definition 1.1 (Random experiment). A random experiment is any repeatable procedure that results in one out of a well-defined set of possible outcomes.
- The set of possible outcomes is called the sample space and denoted by Ω. An element of Ω is denoted by 𝜔 and is an outcome
- A set of zero or more outcomes 𝜔 is an event 𝐴, where we denote a class of subsets 𝐴 ⊂ Ω by ℱ.
- A map (function) that goes from the space of the events ℱ to the space of probabilities (real numbers in [0, 1]) is the probability law and is denoted with ℙ.
Together, sample space, event space and probability law characterize a random experiment.
There are several definitions related to sets and their operations.
Definition 1.2 (Complementation). The complement of a set 𝐴 is denoted by 𝐴c^ and repre- sents the set of elements that do not belong to 𝐴, i.e.
𝐴c^ = {𝜔 ∈ Ω ∶ 𝜔 ∉ 𝐴}. (1.1)
Definition 1.3 (Containment). A set 𝐴 is said to be contained in a set 𝐵 if every element of 𝐴 is also an element of 𝐵. Formally,
𝐴 ⊂ 𝐵 ⟺ 𝜔 ∈ 𝐴 ⟹ 𝜔 ∈ 𝐵 ∀𝜔 ∈ Ω. (1.2)
Definition 1.4 (Equality). Given two sets, 𝐴 is equal to 𝐵, written 𝐴 = 𝐵, if and only if every element of 𝐴 is an element of 𝐵 and every element of 𝐵 is an element of 𝐴. Formally,
𝐴 ⊂ 𝐵 and 𝐵 ⊂ 𝐴. (1.3)
Figure 1.1: Elementary set operations.
1.1 Set operations
Let’s now state some elementary operations between sets.
Definition 1.5 (Union). The union of two sets, written 𝐴∪𝐵, is the set of 𝜔 that belong either to 𝐴 or to 𝐵, i.e. 𝐴∪𝐵 = {𝜔 ∈ Ω ∶ 𝜔 ∈ 𝐴 or 𝜔 ∈ 𝐵}. (1.4)
As a consequence of the definition of the union, the following relations hold true, i.e.
𝐴∪𝐴 = 𝐴 𝐴∪Ω = Ω 𝐴∪∅ = 𝐴 𝐴⊔𝐴c^ = Ω
Definition 1.6 (Intersection). The intersection of 𝐴 and 𝐵 is written 𝐴∩𝐵 and is the set of elements that belong at the same time to 𝐴 and 𝐵.
𝐴∩𝐵 = {𝜔 ∈ Ω ∶ 𝜔 ∈ 𝐴 and 𝜔 ∈ 𝐵}.
As a consequence of the definition of the intersection, the following relations hold, i.e.
𝐴∩𝐴 = 𝐴 𝐴∩Ω = 𝐴 𝐴∩∅ = ∅ 𝐴⊓𝐴c^ = ∅
Proof: Proposition 1.
Proof. Let’s denote 𝐶 = 𝐴c∩𝐵, then apply the distributive law of the union twice (Equa- tion 1.5) and develop the computations, i.e.
𝐴Δ𝐵 = (𝐴∩𝐵c)⊔(𝐴c∩𝐵) = = (𝐴∩𝐵c)⊔𝐶 = = (𝐴∪𝐶)∩(𝐵c∪𝐶) = = [𝐴∪(𝐴c∩𝐵)]∩[𝐵c∪(𝐴c∩𝐵)] = = [((𝐴⊔𝐴c)∩(𝐴∪𝐵)]∩(𝐵c∪𝐴c)∩(𝐵c⊔𝐵) = = (𝐴∪𝐵)∩(𝐴c∪𝐵c)
1.2 Indicator function
Definition 1.9 (Indicator function). An indicator function is a function that associates an 𝜔 ∈ 𝐴 ⊂ Ω with a real number, i.e. either 0 or 1. It is a tool that allows us to transfer a computation from the domain of sets into the domain of real numbers, i.e. {0, 1}. Formally, 𝟙𝐴(𝜔) ∶ Ω → {0, 1}, i.e.
𝟙𝐴(𝜔) = {
0 𝜔 ∈ 𝐴c^
Á Indicator function in ℝ
If 𝑥 ∈ ℝ, then the equivalent operator to an indicator function is the Heaviside function at a point 𝑎 ∈ ℝ (see here), i.e.
The first derivative of the Heaviside function with respect to 𝑥 is the Dirac delta function (see here), i.e. 𝑑 𝑑𝑥
0 otherwise
A fundamental property of the Dirac delta is that, for a general function 𝑓,
∞
−∞
Proposition 1.2. The containment between two sets can be equivalently written in terms of indicator functions: 𝐴 ⊂ 𝐵 ⟺ 𝟙𝐴(𝜔) ≤ 𝟙𝐵(𝜔), ∀𝜔 ∈ Ω.
Proof: Proposition 1.
Proof. Let’s start by assuming 𝐴 ⊂ 𝐵 and let’s distinguish two main cases.
- Assuming 𝜔 ∈ 𝐴 implies that 𝜔 ∈ 𝐵, and therefore we have the equality 1 = 𝟙𝐴 ≤ 𝟙𝐵 = 1.
- Assuming 𝜔 ∈ 𝐴c^ implies [𝜔 ∈ 𝐵]∪[𝜔 ∈ 𝐵c]. In this situation for both cases one will have that 𝟙𝐴 ≤ 𝟙𝐵, in fact: - Considering 𝜔 ∈ 𝐵 implies that 0 = 𝟙𝐴 < 𝟙𝐵 = 1. - Considering 𝜔 ∈ 𝐵c^ implies that 0 = 𝟙𝐴 ≤ 𝟙𝐵 = 0.
Hence, assuming 𝐴 ⊂ 𝐵 implies that 𝟙𝐴(𝜔) ≤ 𝟙𝐵(𝜔) for all 𝜔 ∈ Ω. Now let’s assume the contrary: 𝟙𝐴 ≤ 𝟙𝐵 and let’s again distinguish in two main cases:
- Assuming 𝜔 ∈ 𝐴, i.e. 𝟙𝐴 = 1, the inequality 𝟙𝐴 ≤ 𝟙𝐵 holds and since the indicator function is bounded by 1 by definition it is possible to write 1 = 𝟙𝐴 ≤ 𝟙𝐵 ≤ 1. Therefore, we obtain 𝟙𝐵 = 1 and so 𝜔 ∈ 𝐵.
- Assuming 𝜔 ∈ 𝐴c, i.e. 𝟙𝐴 = 0, the inequality 𝟙𝐴 ≤ 𝟙𝐵 holds and it is possible to write 0 = 𝟙𝐴 ≤ 𝟙𝐵 ≤ 1. Hence, when 𝜔 ∈ 𝐴c, there are two possible cases, i.e. - 𝟙𝐵 = 1, but this implies that 𝜔 ∈ 𝐵. - 𝟙𝐵 = 0, but this implies that 𝜔 ∈ 𝐵c.
The implication 𝜔 ∈ 𝐴 ⟹ 𝜔 ∈ 𝐵 holds, while the converse does not. Hence, it is possible to conclude that 𝐴 ⊂ 𝐵.
1.3 Limits of sets
Let’s define the infimum (inf) and the supremum (sup) of a sequence of sets {𝐴𝑛}𝑛≥1 as
inf 𝑘≥𝑛
∞ ⋂ 𝑘=𝑛
𝐴𝑘 sup 𝑘≥𝑛
∞ ⋃ 𝑘=𝑛
Informally, the infimum of a sequence of sets is the smallest set in 𝑘 = 𝑛, … , ∞, on the other hand, the supremum of a sequence of sets is the biggest set in 𝑘 = 𝑛, … , ∞.
- 𝐴𝑛 ↓ is a sequence of non-increasing sets, i.e. 𝐴 1 ⊃ 𝐴 2 ⊃ …, then the limit exists, i.e.
𝐴𝑛 ↓ ⟹ (^) 𝑛→∞lim 𝐴𝑛 =
∞ ⋂ 𝑛=
1.5 Fields and sigma-fields
Definition 1.11 (Field). Let’s define a field 𝒜 as a non-empty class of subsets of Ω closed under complementation, finite union and intersection. The minimal requirements for a class of subsets to be a field are:
- Ω ∈ 𝒜, i.e. the sample space is in 𝒜.
- 𝐴 ∈ 𝒜 ⟹ 𝐴c^ ∈ 𝒜, i.e. if a set 𝐴 is in 𝒜, then also its complement is in 𝒜.
- 𝐴, 𝐵 ∈ 𝒜 ⟹ 𝐴 ∪ 𝐵 ∈ 𝒜, i.e. if two sets 𝐴 and 𝐵 are in 𝒜, then also their union (or intersection) is in 𝒜.
Definition 1.12 (sigma-field). Let’s define a 𝜎- field ℬ as a non-empty class of subsets of Ω closed under complementation, countable union and intersection. The minimal requirements for a class of subsets to be a sigma-field are:
- Ω ∈ ℬ, i.e. the sample space is in ℬ.
- 𝐵 ∈ ℬ ⟹ 𝐵c^ ∈ ℬ, i.e. if a set 𝐵 is in ℬ, then also its complement is in ℬ.
- 𝐵𝑖 ∈ ℬ, 𝑖 ≥ 1 ⟹ ⋃ 𝑛≥
𝐵𝑛 ∈ ℬ, i.e. if a countable sequence of sets 𝐵𝑖 is in ℬ, then also its countable union (or intersection) is in ℬ.
Á Field vs 𝜎-Field
The main difference between a field and a sigma-field is in the third property of the definitions. A field is closed under finite union , namely the union of a finite sequence of events 𝐴𝑛 indexed by 𝑛 ∈ {0, 1, 2, … , 𝑛} (property 3 of Definition 1.11). On the other hand, a sigma-field is closed under countable union , namely the union of an infinite sequence of events 𝐴𝑛 indexed by 𝑛 ∈ {0, 1, 2, … , 𝑛, 𝑛 + 1, … } (property 3. of the Definition 1.12).
Exercise 1.1. Let the sample space be Ω′^ = {−1, 0, 1}. Generate a 𝜎-algebra according to Definition 1.
Ď Solution: Exercise 1.
Solution 1.1_._ Let the sample space be Ω′^ = {−1, 0, 1}. A natural choice of 𝜎–algebra on a finite set is the power set :
𝒫(Ω′) = {∅, {−1}, {0}, {1}, {−1, 0}, {−1, 1}, {0, 1}, Ω′}.
𝜎-additivity (Equation 2.1) to obtain:
Ω = 𝐴⊔𝐴c^
ℙ ⟶ ℙ(Ω) = ℙ(𝐴) + ℙ(𝐴c) ⟹ 1 = ℙ(𝐴) + ℙ(𝐴c) ⟹ ℙ(𝐴c) = 1 − ℙ(𝐴)
Proposition 2.2 (Probability of the empty set). The probability of the empty set ∅ is zero, i.e. ℙ(∅) = 0_._
Proof: Proposition 2.
Proof. Using the fact that ℙ(Ω) = 1 by assumption and applying Equation 2.2:
ℙ(∅) = 1 − ℙ(∅𝑐) = 1 − ℙ(Ω) = 0.
Proposition 2.3 (Probability of the union). The probability of the union of two sets is:
ℙ(𝐴∪𝐵) = ℙ(𝐴) + ℙ(𝐵) − ℙ(𝐴∩𝐵).
Proof: Proposition 2.
Proof. Let’s write the sets 𝐴 and 𝐵 in terms of a union of disjoint events (Equation 1.9) and apply ℙ on both sides and 𝜎-additivity (Equation 2.1).
ℙ(𝐴) = ℙ(𝐴∩𝐵) + ℙ(𝐴∩𝐵𝑐) ⟹ ℙ(𝐴∩𝐵𝑐) = ℙ(𝐴) − ℙ(𝐴∩𝐵) ℙ(𝐵) = ℙ(𝐴∩𝐵) + ℙ(𝐵∩𝐴𝑐) ⟹ ℙ(𝐵∩𝐴𝑐) = ℙ(𝐵) − ℙ(𝐴∩𝐵)
Let’s now decompose 𝐴∪𝐵 into the disjoint union of 3 events (Equation 1.8) and again apply ℙ on both sides and 𝜎-additivity:
ℙ(𝐴∪𝐵) = ℙ(𝐴∩𝐵) + ℙ(𝐴∩𝐵c) + ℙ(𝐴c∩𝐵).
Substituting ℙ(𝐴∩𝐵𝑐) and ℙ(𝐵∩𝐴𝑐) from Equation 2.3 gives the result:
ℙ(𝐴∪𝐵) = ℙ(𝐴∩𝐵) + ℙ(𝐵) − ℙ(𝐴∩𝐵) + ℙ(𝐴) − ℙ(𝐴∩𝐵) = = ℙ(𝐵) + ℙ(𝐴) − ℙ(𝐴∩𝐵)
Proposition 2.4 (Monotonicity of probability measure). The probability measure ℙ is non- decreasing, in the sense that given two events 𝐴 and 𝐵 , then
𝐴 ⊂ 𝐵 ⟹ ℙ(𝐴) ≤ ℙ(𝐵).
Proof: Proposition 2.
Proof. The proof of the statement follows once the set 𝐵 is written as a disjoint union of subsets of 𝐴 and 𝐵 (Equation 1.9). Then, applying the probability ℙ and 𝜎-additivity on both sides, one obtains:
ℙ(𝐵) = ℙ(𝐴) + ℙ(𝐵 − 𝐴) ≥ ℙ(𝐴).
Further properties are:
- Subadditivity : the measure ℙ is 𝜎- subadditive. For a sequence of events {𝐴𝑛}𝑛≥1 in ℬ then: ℙ (
∞ ⋃ 𝑛=
∞ ∑ 𝑛=
- Continuity : the measure ℙ is continuous for a monotone sequence of sets 𝐴𝑛 ∈ ℬ, i.e.
𝐴𝑛 ↑ 𝐴 ⟹ ℙ(𝐴𝑛) ↑ ℙ(𝐴), 𝐴𝑛 ↓ 𝐴 ⟹ ℙ(𝐴𝑛) ↓ ℙ(𝐴). (2.5)
- Fatou’s lemma : consider a sequence of events {𝐴𝑛}𝑛≥1 in ℬ, then we have the following result: ℙ(lim inf 𝑛→∞ 𝐴𝑛) ≤ lim inf 𝑛→∞ ℙ(𝐴𝑛) ≤ lim sup 𝑛→∞
ℙ(𝐴𝑛) ≤ ℙ(lim sup 𝑛→∞