Hello. Could I call your attention to the difference between
E
(
X
n
)
=
E
[
E
(
X
n
|
θ
)
]
=
E
(
θ
)
=
μ
{\displaystyle E({\frac {X}{n}})=E[E({\frac {X}{n}}|\theta )]=E(\theta )=\mu }
v
a
r
(
X
n
)
=
E
[
v
a
r
(
X
n
|
θ
)
]
+
v
a
r
[
E
(
X
n
|
θ
)
]
{\displaystyle \mathrm {var} ({\frac {X}{n}})=E[\mathrm {var} ({\frac {X}{n}}|\theta )]+\mathrm {var} [E({\frac {X}{n}}|\theta )]}
=
E
[
(
1
n
)
θ
(
1
−
θ
)
|
μ
,
M
]
+
v
a
r
(
θ
|
μ
,
M
)
{\displaystyle =E[({\frac {1}{n}})\theta (1-\theta )|\mu ,M]+\mathrm {var} (\theta |\mu ,M)}
=
1
n
(
μ
(
1
−
μ
)
)
+
n
i
−
1
n
i
(
μ
(
1
−
μ
)
)
M
+
1
{\displaystyle ={\frac {1}{n}}(\mu (1-\mu ))+{\frac {n_{i}-1}{n_{i}}}{\frac {(\mu (1-\mu ))}{M+1}}}
=
μ
(
1
−
μ
)
n
(
1
+
n
−
1
M
+
1
)
.
{\displaystyle ={\frac {\mu (1-\mu )}{n}}(1+{\frac {n-1}{M+1}}).}
E
(
X
n
)
=
E
[
E
(
X
n
|
θ
)
]
=
E
(
θ
)
=
μ
{\displaystyle E\left({\frac {X}{n}}\right)=E\left[E\left({\frac {X}{n}}|\theta \right)\right]=E(\theta )=\mu }
v
a
r
(
X
n
)
=
E
[
v
a
r
(
X
n
|
θ
)
]
+
v
a
r
[
E
(
X
n
|
θ
)
]
{\displaystyle \mathrm {var} \left({\frac {X}{n}}\right)=E\left[\mathrm {var} \left({\frac {X}{n}}|\theta \right)\right]+\mathrm {var} \left[E\left({\frac {X}{n}}|\theta \right)\right]}
=
E
[
(
1
n
)
θ
(
1
−
θ
)
|
μ
,
M
]
+
v
a
r
(
θ
|
μ
,
M
)
{\displaystyle =E\left[\left({\frac {1}{n}}\right)\theta (1-\theta )|\mu ,M\right]+\mathrm {var} \left(\theta |\mu ,M\right)}
=
1
n
(
μ
(
1
−
μ
)
)
+
n
i
−
1
n
i
(
μ
(
1
−
μ
)
)
M
+
1
{\displaystyle ={\frac {1}{n}}\left(\mu (1-\mu )\right)+{\frac {n_{i}-1}{n_{i}}}{\frac {(\mu (1-\mu ))}{M+1}}}
=
μ
(
1
−
μ
)
n
(
1
+
n
−
1
M
+
1
)
.
{\displaystyle ={\frac {\mu (1-\mu )}{n}}\left(1+{\frac {n-1}{M+1}}\right).}
I changed the former to the latter in Beta-binomial model . Michael Hardy 20:14, 19 October 2006 (UTC) Reply
I am not great with the MathML and editing the wikipedia so I will take a look at this more carefully. I'll try to take more care in the presentation. Please understand that this is a work in progress and it would also be helpful to check the derivations since I could make a mistake.
Thanks
Charlesmartin14 22:32, 19 October 2006 (UTC) Reply
The link from the Empirical Bayes Page to here seems to be broken now?
Charlesmartin14 22:43, 19 October 2006 (UTC) Reply