Professional Documents
Culture Documents
• Exemple:
Considerem una m.a.s. de n=10 d’una variable de 'pus
Bernoulli que pren valors x=1, 0 amb probabilitats p i 1-p
amb p desconegut. Sigui 1,0,1,0,0,0,0,0,0,1 la mostra
concreta.
La funció de probabilitat conjunta és
f(x1,x2,...,xn,p)=p3(1-p)7 definim la funció L(p)=p3(1-p)7
Pregunta: per a aquesta mostra concreta, quin valor de p
maximitza L(p)?
Es'mador de màxima versemblança
Definim L(x1,...x n ,θ ) = ∏ f (x i )
i=1
€
Es'mador de màxima versemblança
Procediment:
n
• Definim L(x1,...x n ,θ ) = ∏ f (x i )
i=1
n n
• Calculem d
€ el màxim resolem l’equació: Ln(L(x1,θ )) = 0
dθ
• Si θ ∈ [ a,b
€] comprovem si el màxim absolut es troba en cap extrem.
€
€
Exemple: Càlcul de l’es'mador de la màxima versemblança del
paràmetre λ d’una distribució de Poisson
n
n n
λxi ∑ xi n 1
L(x1,...x n ,θ ) = ∏ f (x i ) = ∏ e − λ =e λ ∏
−nλ i =1
€
€
Propietats dels es'madors de màxima versemblança
n⎡ 1 −( x i − µ ) 2
⎤ −n
− ∑ (x i − µ )2
−n i =1
L(X; µ,σ ) = ∏ ⎢
2
e 2σ 2 ⎥ = (2π ) 2 (σ ) e
2 2 2σ 2
2
⎣ 2πσ
i=1 ⎢ ⎥⎦
Pr enem log aritmes :
n
n n ∑ (x i − µ) 2
ln( L(X; µ,σ 2 )) = − ln(2π ) − ln(σ 2 ) − i=1
2 2 2σ 2
€
Es'madors de màxima versemblança per Ν( µ,σ )
∂µ σ i=1 €
n
∂ −n 1 2
∂σ 2
ln( L(X, µ, σ 2
)) 2σ 2
= +
2 2
∑ i( x − µ)
2(σ ) i=1
∂ ⎫
ln( L(X, µ,σ )) = 0 ⎪
2
n n
∂µ ⎪ 2
⎬ ⇒ ∑ ( x i − µ) = 0 i − nσ 2 + ∑ ( x i − µ) = 0
∂ ⎪
∂σ 2
ln( L(X, µ, σ 2
)) = 0 ⎪⎭
i=1 i=1
n n
∑( x i − µ) = 0 ⇒ ∑ x i − nµ = 0 ⇒ µˆ = X
i=1 i=1
n n n
2 1 2 1 2
−nσ + ∑ ( x i − µ) = 0 ⇒ σ = ∑ ( x i − µ) ⇒ σ = ∑ ( x i − X )
2 2 ˆ 2
i=1
n i=1 n i=1
Es'madors de màxima versemblança per Ν( µ,σ )
Comprovem que es tracta d' un màxim, fem la matriu hessiana
⎛ ∂2 ∂2 ⎞
⎜ ln( L(X, µ,σ ))
2
2 ln( L(X, µ,σ )) ⎟
2
∂µ∂µ ∂µ∂σ
H(L(X, µ,σ ) = ⎜ 2
2
2
⎟
⎜ ∂
⎜ 2 ln( L(X, µ,σ ))
⎝ ∂σ ∂µ
2 ∂
2
∂σ ∂σ
€ 2 ⎟
2 ln( L(X, µ,σ ))⎟
⎠
⎛ −n 1
n ⎞
⎜ − 2 ⋅ ∑ ( x i − µ) ⎟
⎜ σ2 ( )
σ 2
i=1 ⎟
=⎜ n n ⎟
1 n 1 2
⎜ σ2 2 ∑
⎜− ⋅ ( x i − µ) − ⋅ ∑ ( x i − µ) ⎟
2 2 2 3 ⎟
⎝ ( ) i=1 2(σ ) (σ ) i=1 ⎠
Així
⎛ −n ⎞ −n
⎜σ 2 0 ⎟ 0
−n σ2
H(L(X, µˆ ,σˆ ) = ⎜
2
−n ⎟ com que 2 <0 i −n > 0 la matriu és definida positiva
⎜ 0 ⎟ σ 0
⎜ 2 2⎟ 2
⎝ 2(σ ) ⎠ 2(σ 2 )
i llavors L(X, µ,σ 2 ) té un màxim a (X ,S 2 )
n
1 2
µˆ = X i σˆ 2 = S 2 = ∑ ( x i − X ) són els estimadors per màxima versemblança.
n i=1
€
Mètode dels moments
€
Mètode dels moments
+∞ i
αi = ∫ −∞
x f (x,θ1,...,θ n )dx moment poblacional d'ordre i
1 m i
Mi = ∑
m i=1
x moment mostral d'ordre i
1 1 n
• Llei exponencial: com que 1
α = E [ ]
X = = X = ∑ x i = M1
ˆ= 1 λ n i=1
Llavors: λ
X
1 n
• Llei de Poisson: Com
€ que α1 = E [ X ] = λ = X = ∑ x i = M1
n i=1
Llavors:
€ λˆ = X
⎧ 1 n
€ ⎪α1 = E [ X ] = µ = X = ∑ x i = M1
€ ⎪ n i=1
• Llei normal: com que ⎨
⎪ 1 n 2
⎪⎩α 2 = E [ X ] = σ + µ = n ∑ x i = M 2
2 2 2
Llavors: λˆ = X i σˆ = Sn i=1
€ €
Problemes per resoldre
Problemes per resoldre
θ −1
n ⎛ n ⎞
Sol: a) Definim L(X,θ ) = ∏θxθi −1 = θ n ⎜ ∏ x i ⎟
i=1 ⎝ i=1 ⎠
n
ln(L(X,θ )) = n ln(θ ) + (θ −1)∑ ln( x i )
i=1
n
d n
ln(L(X,θ )) = + ∑ ln( x i )
dθ θ i=1
d −n
ln(L(X,θ )) = 0 ⇒ θˆ = n
dθ θ =θˆ
∑ ln( x ) i
i=1
Problemes per resoldre
Sol: b)
1 1
x θ +1 1
θ ⎫
∫ xθx dx = ∫ θx dx = θ θˆ
θ −1 θ
α1 = E(X) = = ⎪
0 0 θ +1 0 θ +1 ⎬ α1 = M1 ⇒ ˆ =X
⎪ θ +1
M1 = X ⎭
X
així θˆ =
1− X
€
Problemes per resoldre
Problemes per resoldre
−θ
n n ⎛ n ⎞
Definim L(X,θ ) = ∏θ 2 x ie −θx i = θ 2n ∏ x i ⎜∏ e x i ⎟
Sol: i=1 i=1 ⎝ i=1 ⎠
n n
ln(L(X,θ )) = 2n ln(θ ) + ∑ ln( x i ) − θ ∑ x i
i=1 i=1
n
d 2n
ln(L(X,θ )) = −∑x
dθ θ i=1 i
d 2n 2
ln(L(X,θ )) = 0 ⇒ θˆ = n =
dθ θ =θˆ X
∑ ix
i=1
Problemes per resoldre
Problemes per resoldre
Sol: a)
1 1 1
(1+ θ ) xθ +2 (1+ θ )
E(X) = ∫ x (1+ θ )x dx = ∫ (1+ θ )x dx =
θ θ +1
θ + 2
=
θ +2
0 0 0
€
Problemes per resoldre
Sol: b)
(1+ θ ) ⎫⎪ (1+ θˆ ) = X
α1 = E(X) = 2X −1
θ + 2 ⎬ α1 = M1 ⇒ ˆ ⇒ θˆ =
⎪ θ +2 1− X
M1 = X ⎭
€
Problemes per resoldre
Sol: c)
2X −1
θˆ = =
1− X
0.92 + 0.79 + 0.90 + 0.65 + 0.86
X= = 0.824
5
€
Problemes per resoldre
Problemes per resoldre
1
−x i2 −
xn n⎛ n
x i2
⎞ 2θ
Definim L(X,θ ) = ∏ i e 2θ
= θ ∏ x i ⎜∏ e ⎟
−n
Sol: b) i=1
θ i=1 ⎝ i=1 ⎠
n
1 n 2
ln(L(X,θ )) = −n ln(θ ) + ∑ ln( x i ) − ∑ x i
i=1 2θ i=1
d −n 1 n 2
dθ
ln(L(X,θ )) = + ∑x
θ 2θ 2 i=1 i
n
d 1
ln(L(X,θ )) = 0 ⇒ θˆ = ∑ x i2
dθ θ =θˆ 2n i=1
Problemes per resoldre
€
Problemes per resoldre
Problemes per resoldre
Sol: X ~ G( p) X compte els fracasos abans del primer èxit llavors f X (x) = (1 − p) x p
n
n
∑ xi
L(X, p) = ∏ (1 − p) x i p = p n ⋅ (1 − p) i =1
i=1
d n ∑ xi
ln(L(X, p)) = − i=1
dp p 1− p
n
d n ∑ xi n 1
ln(L(X, p)) = 0 ⇒ − i=1 = 0 ⇒ pˆ = n =
dp p = pˆ
pˆ 1 − pˆ n + ∑ x i 1+ X
i=1
Sol:
1 ⎫
θ θ θ
2(θ − x) 2θx − x 2 2 x3
α1 = E(X) = ∫ x dx = ∫ 2
dx = 2 (θx − ) = θ ⎪
0 θ 2
0 θ 2
θ 3 0 3 ⎬ α1 = M1 ⇒ θˆ = 3X
⎪
M1 = X ⎭
1
E(θˆ ) = 3E(X ) = 3E(X) = 3⋅ θ = θ així θˆ és un estimador no esbiaixat d'θ
3
€
Problemes per resoldre
Problemes per resoldre
⎛ n⎞ x
Sol: a) X ~ B(n, p) f X (x) = ⎜ ⎟ p (1 − p) n −x ; X1,..., X m m. a. s. d' X
⎝ x⎠
m m
m ⎛n⎞ x m ⎛ ⎞
n ∑ xi −∑ x i
L(X, p) = ∏⎜ ⎟ p (1 − p)
i n −x i
= ∏⎜ ⎟⋅ p (1 − p) (1 − p) i =1
i =1 n⋅m
x
i=1 ⎝ i ⎠
x
i=1 ⎝ ⎠
m ⎛n⎞ m m
ln(L(X, p)) = ∑ ln⎜ ⎟ + ∑ x i ⋅ ln( p) + n⋅ m⋅ ln(1 − p) − ∑ x i ⋅ ln(1 − p)
i=1 ⎝ x i ⎠ i=1 i=1
m m
d ∑ xin⋅ m i=1 ∑ xi
ln(L(X, p)) = i=1 − +
dp p 1− p 1− p
m m m
d ∑ x i n⋅ m ∑ x i ∑ xi X
i=1 i=1
ln(L(X, p)) =0 ⇒ − + = 0 ⇒ pˆ = i=1 =
dp p = pˆ
pˆ 1 − pˆ 1 − pˆ n⋅ m n
⎛X⎞ 1 1 1
E( pˆ ) = E ⎜ ⎟ = E(X ) = E(X) = np = p així pˆ és un estimador no esbiaixat de p
⎝n⎠ n n n
Problemes per resoldre
Sol: c)
n
∑ xi X
pˆ = i=1
=
n2 n
p
l = g( p) = és una funció bijectiva, llavors pel principi d'in var iància
1− p
lˆ = g( pˆ ) és un estimador de la màxima versemblança d' l
X
pˆ n X
lˆ = = =
1 − pˆ X n−X
1−
n