23. The densities of U, V, and T:

advertisement
23. The densities of U, V, and T:
V sample: 100000
V sample: 100000
1.5
1.5
1.0
1.0
0.5
0.5
0.0
0.0
-0.5
0.0
0.5
-0.5
1.0
T sample: 100000
1.0
0.75
0.5
0.25
0.0
0.0
0.5
1.0
-1.0
0.0
1.0
2.0
estimated values for the cdf of T at the values t, i.e., P(T<=t).
Note: in the BUGS code, syntax ‘I.2 <- step (0.2-T)’ means I.2 = 1 when 0.2 – T>=0, otherwise I.2 = 0.
Hence the cdf of T at the values of t is estimated by nodes I.2, I.4,I.6,I.8,I1.0..I2.0.
Here is the statistics of these nodes:
node
I.2
mean
sd
0.02005 0.1402
MC error 2.5%
4.371E-4 0.0
median 97.5%
0.0
0.0
start
1
sample
100000
I.4
0.07908 0.2699
8.451E-4 0.0
0.0
1.0
1
100000
I.6
0.1806
0.3847
0.001211 0.0
0.0
1.0
1
100000
I.8
0.3202
0.4666
0.001496 0.0
0.0
1.0
1
100000
I1.0
0.5017
0.5
0.00163 0.0
1.0
1.0
1
100000
I1.2
0.6805
0.4663
0.001475 0.0
1.0
1.0
1
100000
I1.4
0.8197
0.3845
0.001178 0.0
1.0
1.0
1
100000
I1.6
0.9191
0.2727
8.145E-4 0.0
1.0
1.0
1
100000
I1.8
0.98
0.1398
4.354E-4 1.0
1.0
1.0
1
100000
I2.0
1.0
0.0
3.162E-131.0
1.0
1.0
1
100000
So the estimated values for the cdf of T at these values would be
t
0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
1.6
1.8
2.0
P(T<=t)
0
0.020
0.09
0.18
0.32
0.50
0.68
0.82
0.92
0.98
1.0
24.
i). Consider U~exp(1), V~exp(1), T = U*V*I(U<1,V<1)
The BUGS code
model {
U~dexp(1)
V~dexp(1)
U.1 <- step(1.0 - U)
V.1 <- step(1.0 - V)
T<-U.1*V.1
}
The densities of U, V and T would be:
U sample: 100000
V sample: 100000
1.0
0.75
0.5
0.25
0.0
T sample: 100000
1.0
0.75
0.5
0.25
0.0
0.0
5.0
2.0
1.5
1.0
0.5
0.0
0.0
10.0
5.0
10.0
0.0
20.0
40.0
25. a) The priori distribution is:š‘“(š‘) = 1, And f(x = k|p) = (š‘›š‘˜)š‘š‘˜ (1 − š‘)š‘›−š‘˜ , where n = 5, k = 0,1,..5
The posterior distribution of p|x
ļƒ¦5 ļƒ¶
f (p | x ļ€½ k) ļ‚µ f(x ļ€½ k | p) f(p) ļ€½ ļƒ§ ļƒ· p k (1 ļ€­ p)5ļ€­k ļ‚µ p(k ļ€«1)ļ€­1 (1 ļ€­ p)(6ļ€­k) ļ€­1 , where k = 0,1,2,3,4,5
ļƒØkļƒø
This is Beta distribution (k+1,6-k)
b).
node
p
mean
0.4286
sd
0.1749
MC error 2.5%
5.577E-4 0.1187
median 97.5%
0.4209 0.7759
start
1
sample
100000
95% CI for p: (0.1749,0.7759)
26. Summary of Tstar:
> summary(Tstar)
Min. 1st Qu. Median
Mean 3rd Qu.
0.1800 0.6500 0.8600 0.8514 1.0400
# calculate the standard deviation
> sd(Tstar)
[1] 0.2173325
Max.
2.1200
# same result if apply sd formula
> sqrt(sum((Tstar-mean(Tstar))^2)/(10000-1))
[1] 0.2173325
Hence: ET20 =0.8514.
VarT20 =0.2173
From the quantile result list, the first deciles is 0.59, and 9th deciles is 1.135
27. summary of statistic of parameter bootstrapping
> summary(Tstar)
Min. 1st Qu. Median
0.1800 0.6250 0.7750
> sd(Tstar)
[1] 0.2479007
Mean 3rd Qu.
0.8035 0.9550
Max.
1.9850
Hence: ET20 =0.8035.
VarT20 =0.2479
c) The summary of statistic for mean = 1.0 using parametric bootstrapping is:
> summary(Tstar)
Min. 1st Qu. Median
0.1650 0.5600 0.6950
Mean 3rd Qu.
0.7174 0.8500
Max.
1.7750
5
0
1
2
3
4
I(x,y)
MSE for alpha = 1/2
MSE for alpha = 2/3
0
1
2
mu
3
4
Download