Problem Set 5: Solutions. Set 5: Solutions. 1 (a) Reject if 1.96 | | 0.245ˆ 8 ρ> = (b) Here is the...

2
Problem Set 5: Solutions. 1 (a) Reject if 1.96 ˆ | | 0.245 8 ρ > = (b) Here is the code and the resulting simulated power function randn('seed',123); for i=1:51; rho=-0.52+(i/50); for j=1:10000; x=randn(64,1); u=randn(64,1); y=(rho*x)+(sqrt(1-(rho^2))*u); stat(j)=corr(x,y); end; power(i)=mean(abs(stat)>0.245); end; plot([-0.5:0.02:0.5],power,'Linewidth',2); title('Simulated Power Function','Fontsize',16); -0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Simulated Power Function 2. (a) The rejection region is ˆ p below 0.465 or above 0.535. In fact, ˆ 0.471 p = , so the hypothesis is accepted. (b) If 0.45 p = , (1 ) ˆ~ ( , ) (0.45, 0.000309) 802 p p p Np N = . With this distribution, the probability of ˆ p being below 0.465 is 0.803. The probability of it being above 0.535 is 0.000 (to 3 dps). So the power of the test is 80.3 percent. 3. (a) The log-likelihood function is 1 1 () log(0.5) log( ) | | (log(0.5) log( )) | | n n i i i i l X n X λ λ λ λ λ = = + = + Σ

Transcript of Problem Set 5: Solutions. Set 5: Solutions. 1 (a) Reject if 1.96 | | 0.245ˆ 8 ρ> = (b) Here is the...

Problem Set 5: Solutions.

1 (a) Reject if 1.96ˆ| | 0.2458

ρ > =

(b) Here is the code and the resulting simulated power function randn('seed',123); for i=1:51; rho=-0.52+(i/50); for j=1:10000; x=randn(64,1); u=randn(64,1); y=(rho*x)+(sqrt(1-(rho^2))*u); stat(j)=corr(x,y); end; power(i)=mean(abs(stat)>0.245); end; plot([-0.5:0.02:0.5],power,'Linewidth',2); title('Simulated Power Function','Fontsize',16);

-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1Simulated Power Function

2. (a) The rejection region is p̂ below 0.465 or above 0.535. In fact, ˆ 0.471p = , so the hypothesis is accepted.

(b) If 0.45p = , (1 )ˆ ~ ( , ) (0.45,0.000309)802

p pp N p N−= . With this distribution, the probability

of p̂ being below 0.465 is 0.803. The probability of it being above 0.535 is 0.000 (to 3 dps). So the power of the test is 80.3 percent. 3. (a) The log-likelihood function is

1 1( ) log(0.5) log( ) | | (log(0.5) log( )) | |n ni i i il X n Xλ λ λ λ λ= == Σ + − = + − Σ

The FOC is

1'( ) | | 0ni i

nl Xλλ == − Σ =

1

ˆ| |n

i i

nX

λ=

∴ =Σ

is the MLE. With the specific numbers in the question, this is 0.2. (b) log( ( , )) log(0.5) log( ) | |f x xλ λ λ= + −

log( ( , )) 1 | |f x xλλ λ

∂= −

2

2 2

log( ( , )) 1f x λλ λ

∂= −

So, 2ˆ( ) (0, )dn Nλ λ λ− → .

(c) ˆ( ) 20* (log(0.5) log(0.2)) 0.2*100 66.0517l λ = + − = − (0.125) 20* (log(0.5) log(0.125)) 0.125*100 67.9518l = + − = −

Twice the difference is 3.8002. The hypothesis is not rejected (at the 5 percent level).

(d) The Wald test statistic is 22

120* (0.125 0.2) * 2.81250.2

− = . The test is not rejected (at the 5

percent level). 4 (a) 2X =

2 2 21 1( ) 180 20* 4 100n n

i i i iX X X nX= =Σ − = Σ − = − = So the MLE of µ is 2 while that of 2σ is 5. (b) The log-likelihood is

2 2 2

2 2 1 11 2 2 2 2

( )( ) log(2 ) log(2 )

2 22 2 2

n nn i i i i ii

X X Xn n nlµ µµθ πσ πσ

σ σ σ σ= =

=

− Σ Σ= − − Σ = − − − +

180 80 80( ) 10log(2 5) 10 10log(10 ) 44.473110 10 5

l θ π π= − − − + = − = −

180 20 40( ) 10log(2 4) 47.24178 8 4

l θ π= − − − + = −

The LR test statistic is 5.5372, which is less than the critical value for a 2χ distribution, which is 5.99. The hypothesis is accepted. (c) The Wald statistic is

( ) ( )1 15 0 2 1 5 0 1

20 2 1 5 4 20 1 1 4.40 50 5 4 0 50 1

W− −−

= − − = = −

Again, the hypothesis is accepted. (d) The LM statistic is

( )4 0 51 5 1.25 7.500 32 1.2520

LM = =

and the hypothesis is now rejected.