• Nie Znaleziono Wyników

Task 1. /2 points/ Generate random sample X 1 , X 2 , . . . , X n from a distribution (see table) with mean E[X i ] = µ and variance V ar[X i ] = σ 2 . Calculate sample mean X n and sample variance S n 2 :

N/A
N/A
Protected

Academic year: 2021

Share "Task 1. /2 points/ Generate random sample X 1 , X 2 , . . . , X n from a distribution (see table) with mean E[X i ] = µ and variance V ar[X i ] = σ 2 . Calculate sample mean X n and sample variance S n 2 :"

Copied!
1
0
0

Pełen tekst

(1)

Urszula Libal Modelling and Identication 3.1

3. Parametric estimation and limit theorems

Task 1. /2 points/ Generate random sample X 1 , X 2 , . . . , X n from a distribution (see table) with mean E[X i ] = µ and variance V ar[X i ] = σ 2 . Calculate sample mean X n and sample variance S n 2 :

X n = 1 n

n

X

i=1

X i , (1)

S 2 n = 1 n − 1

n

X

i=1

X i − X n  2

. (2)

Experimentally observe the bias of each estimator as n → ∞. Plot the estimator value (1) or (2) in function of sample size n. Draw a horizontal line on the same plot for true value of mean µ or variance σ 2 respectively.

Are sample mean X n and sample variance S n 2 unbiased?

No distribution p.d.f. µ σ 2

1 normal N (µ, σ 2 ) f (x) = 1

σ √

2π exp 

(x−µ)

22



µ σ 2

2 uniform U[a, b] f (x) = b−a 1 1 {a 6 x 6 b} µ = 1 2 (a + b) σ 2 = 12 1 (b − a) 2

3 Beta(α, β) f (x) = Γ(α)Γ(β) Γ(α+β) x α−1 (1 − x) β−1 1 {0 6 x 6 1} µ = α+β α σ 2 = αβ

(α+β)

2

(α+β+1)

4 exponential Exp(λ) f (x) = λ exp (−λx) 1 {x > 0} µ = 1 λ σ 2 = λ 1

2

Task 2. /3 points/ Experimentally illustrate Central Limit Theorem:

Lindeberg-Lévy CLT. Suppose X 1 , X 2 , ...X n is a sequence of i.i.d. random variables with E[X i ] = µ and V ar[X i ] = σv 2 < ∞ . Then as n → ∞

1 σ √

n

n

X

i=1

X i − nµ

!

→ N (0, 1) . D (3)

Method:

1. Generate random sample X 1 , X 2 , ...X n of size n. Calculate Y 1 = σ 1 n ( P n

i=1 X i − nµ) . 2. Generate second random sample X 1 , X 2 , ...X n of size n. Calculate Y 2 = σ 1 n ( P n

i=1 X i − nµ) . 3. . . . (repeat it k times)

4. Draw histogram for random variables Y 1 , Y 2 , ...Y k and compare its shape with theoretical pdf of N (0, 1).

5. Repeat steps 1-4 for larger sample size n.

6. Repeat steps 1-5 for another distribution of random sample X 1 , X 2 , ...X n (see table from task 1).

/Total: 5 points/

Cytaty

Powiązane dokumenty

[r]

Relacja r´ ownowa˙zno´ sci form kwadratowych jest relacj a r´ , ownowa˙zno´ sci w rodzinie wszystkich form kwadratowych n-zmiennych..

[r]

[r]

[r]

[r]

Let us mention that this idea has been already used in [3, 4, 8] to obtain second-order necessary optimality conditions for problems given by differential inclusions and

We give a distinguished basis for this form, which is a deformation of the usual basis of Schubert polynomials, and apply it to the computation of the Schubert cycle expansions of