MY-ASSIGNMENTEXPERT™可以为您提供sydney DATA5711 Bayesian Analysis贝叶斯分析课程的代写代考和辅导服务!
这是悉尼大学贝叶斯分析课程的代写成功案例。
DATA5711课程简介
Increased computing power has meant that many Bayesian methods can now be easily implemented and provide solutions to problems that have previously been intractable. Bayesian methods allow researchers to incorporate prior knowledge into their statistical models. This unit is made up of three distinct modules, each focusing on a different niche in the application of Bayesian statistical methods to complex data in, for example, geophysics, ecology and hydrology. These include (but are not restricted to) Bayesian methods and models; statistical inversion; approximate Bayesian inference for semiparametric regression. Across all modules you will develop expertise in Bayesian computational statistics. On completion of this unit you will be able to apply appropriate Bayesian methods to a variety of applications in science, and other data-heavy disciplines to develop a better understanding of the information inherent in complex datasets.
Prerequisites
At the completion of this unit, you should be able to:
- LO1. Demonstrate a coherent and advanced understanding of key concepts in computational statistics.
- LO2. Apply fundamental principles and results in statistics to solve given problems.
- LO3. Distinguish and compare the properties of different types of statistical models and statistical methods applicable to them.
- LO4. Identify assumptions required for various statistical methods to be valid and devise methods for testing these assumptions.
- LO5. Devise statistical solutions to complex problems.
- LO6. Adapt various computational techniques to build software for solving particular statistical problems.
- LO7. Communicate coherent statistical arguments appropriately to student and expert audiences, both orally and through written work.
DATA5711 Bayesian Analysis HELP(EXAM HELP, ONLINE TUTOR)
We are interested in the mean, $\lambda$, of a Poisson distribution. We have a prior distribution for $\lambda$ with density
$$
f^{(0)}(\lambda)=\left{\begin{array}{cc}
0 & (\lambda \leq 0) \
k_0(1+\lambda) e^{-\lambda} & (\lambda>0)
\end{array} .\right.
$$
(a) i. Find the value of $k_0$.
ii. Find the prior mean of $\lambda$.
iii. Find the prior standard deviation of $\lambda$.
(b) We observe data $x_1, \ldots, x_n$ where, given $\lambda$, these are independent observations from the Poisson $(\lambda)$ distribution.
i. Find the likelihood.
ii. Find the posterior density of $\lambda$.
iii. Find the posterior mean of $\lambda$.
(a) i.
$$
\begin{aligned}
\int_0^{\infty} f^{(0)}(\lambda) d \lambda & =k_0\left{\int_0^{\infty} e^{-\lambda} d \lambda+\int_0^{\infty} \lambda e^{-\lambda} d \lambda\right} \
& =k_0{1+1}=2 k_0
\end{aligned}
$$
Hence $k_0=1 / 2$.
ii.
$$
\begin{aligned}
\mathrm{E}_0(\lambda)=\int_0^{\infty} \lambda f^{(0)}(\lambda) d \lambda & =\frac{1}{2}\left{\int_0^{\infty} \lambda e^{-\lambda} d \lambda+\int_0^{\infty} \lambda^2 e^{-\lambda} d \lambda\right} \
& =\frac{1}{2}{1+2}=\frac{3}{2}=1.5
\end{aligned}
$$
iii.
$$
\begin{aligned}
\mathrm{E}_0\left(\lambda^2\right)=\int_0^{\infty} \lambda^2 f^{(0)}(\lambda) d \lambda & =\frac{1}{2}\left{\int_0^{\infty} \lambda^2 e^{-\lambda} d \lambda+\int_0^{\infty} \lambda^3 e^{-\lambda} d \lambda\right} \
& =\frac{1}{2}{2+6}=\frac{8}{2}
\end{aligned}
$$
So
$$
\operatorname{var}_0(\lambda)=\frac{8}{2}-\left(\frac{3}{2}\right)^2=\frac{16-9}{4}=\frac{7}{4}
$$
and
$$
\text { std.dev } 0(\lambda)=\sqrt{\frac{7}{4}}=\frac{\sqrt{7}}{2}=1.323 .
$$
(b) i. Likelihood
$$
L=\prod_{i=1}^n \frac{e^{-\lambda} \lambda^{x_i}}{x_{i} !}=\frac{e^{-n \lambda} \lambda \sum x_i}{\prod x_{i} !}=\frac{e^{-n \lambda} \lambda^S}{\prod x_{i} !}
$$
where
$$
S=\sum_{i=1}^n x_i
$$
ii. Posterior density proportional to
$$
\begin{aligned}
f^{(0)}(\lambda) L & \propto(1+\lambda) e^{-\lambda} e^{-n \lambda} \lambda^S \
& \propto e^{-(n+1) \lambda} \lambda^S+e^{-(n+1) \lambda} \lambda^{S+1}
\end{aligned}
$$
The posterior density is
$$
f^{(1)}(\lambda)=k_1\left{e^{-(n+1) \lambda} \lambda^S+e^{-(n+1) \lambda} \lambda^{S+1}\right}
$$
where
$$
\int_0^{\infty} f^{(1)}(\lambda) d \lambda=1=k_1\left{\frac{\Gamma(S+1)}{(n+1)^{S+1}}+\frac{\Gamma(S+2)}{(n+1)^{S+2}}\right} .
$$
Hence
$$
k_1=\left{\frac{\Gamma(S+1)}{(n+1)^{S+1}}+\frac{\Gamma(S+2)}{(n+1)^{S+2}}\right}^{-1}
$$
and
$$
f^{(1)}(\lambda)=\left{\frac{\Gamma(S+1)}{(n+1)^{S+1}}+\frac{\Gamma(S+2)}{(n+1)^{S+2}}\right}^{-1}\left{e^{-(n+1) \lambda} \lambda^S+e^{-(n+1) \lambda} \lambda^{S+1}\right} .
$$
iii. Posterior mean
$$
\begin{aligned}
\mathrm{E}_1(\lambda) & =\int_0^{\infty} \lambda f^{(1)}(\lambda) d \lambda \
& =k_1\left{\int_0^{\infty} \lambda^{S+1} e^{-(n+1) \lambda} d \lambda+\int_0^{\infty} \lambda^{S+2} e^{-(n+1) \lambda} d \lambda\right} \
& =k_1\left{\frac{\Gamma(S+2)}{(n+1)^{S+2}}+\frac{\Gamma(S+3)}{(n+1)^{S+3}}\right} \
& =\frac{\left{\frac{(S+1)}{(n+1)}+\frac{(S+1)(S+2)}{(n+1)^2}\right}}{\left{1+\frac{(S+1)}{(n+1)}\right}}
\end{aligned}
$$
We are interested in the parameter, $\theta$, of a binomial $(n, \theta)$ distribution. We have a prior distribution for $\theta$ with density
$$
f^{(0)}(\theta)=\left{\begin{array}{cc}
k_0\left{\theta^2(1-\theta)+\theta(1-\theta)^2\right} & (0<\theta<1) \
0 & \text { (otherwise) }
\end{array} .\right.
$$
(a) i. Find the value of $k_0$.
ii. Find the prior mean of $\theta$.
iii. Find the prior standard deviation of $\theta$.
(b) We observe $x$, an observation from the binomial $(n, \theta)$ distribution.
i. Find the likelihood.
ii. Find the posterior density of $\theta$.
iii. Find the posterior mean of $\theta$.
(a) i.
$$
\begin{aligned}
\int_0^1 f^{(0)}(\theta) d \theta & =k_0\left{\int_0^1 \theta^2(1-\theta) d \theta+\int_0^1 \theta(1-\theta)^2 d \theta\right} \
& =k_0\left{\frac{\Gamma(3) \Gamma(2)}{\Gamma(5)}+\frac{\Gamma(2) \Gamma(3)}{\Gamma(5)}\right} \
& =2 k_0 \frac{\Gamma(3) \Gamma(2)}{\Gamma(5)}=2 k_0 \frac{2 ! 1 !}{4 !}=\frac{k_0}{6}
\end{aligned}
$$
Hence $k_0=6$.
ii. Prior mean
$$
\begin{aligned}
\mathrm{E}_0(\theta) & =\int_0^1 \theta f^{(0)}(\theta) d \theta=k_0\left{\int_0^1 \theta^3(1-\theta) d \theta+\int_0^1 \theta^2(1-\theta)^2 d \theta\right} \
& =k_0\left{\frac{\Gamma(4) \Gamma(2)}{\Gamma(6)}+\frac{\Gamma(3) \Gamma(3)}{\Gamma(6)}\right} \
& =k_0\left{\frac{3 ! 1 !+2 ! 2 !}{5 !}\right}=k_0\left{\frac{6+4}{120}\right}=\frac{1}{2}
\end{aligned}
$$
iii.
$$
\begin{aligned}
\mathrm{E}_0\left(\theta^2\right) & =\int_0^1 \theta^2 f^{(0)}(\theta) d \theta \
& =k_0\left{\int_0^1 \theta^4(1-\theta) d \theta+\int_0^1 \theta^3(1-\theta)^2 d \theta\right} \
& =k_0\left{\frac{\Gamma(5) \Gamma(2)}{\Gamma(7)}+\frac{\Gamma(4) \Gamma(3)}{\Gamma(7)}\right} \
& =k_0\left{\frac{4 ! 1 !+3 ! 2 !}{6 !}\right}=\left{\frac{24+12}{5 \times 24}\right}=\frac{3}{10}
\end{aligned}
$$
Hence
$$
\operatorname{var}_0(\theta)=\frac{3}{10}-\left(\frac{1}{2}\right)^2=\frac{6-5}{20}=\frac{1}{20}
$$
and
$$
\text { std.dev }(\theta)=\frac{1}{\sqrt{20}}=0.2236 .
$$
(b) i. Likelihood
$$
L=\left(\begin{array}{c}
n \
x
\end{array}\right) \theta^x(1-\theta)^{n-x} .
$$
ii. Posterior density $f^{(1)}(\theta)$ proportional to $f^{(0)}(\theta) L$. Hence
$$
\begin{aligned}
f^{(1)}(\theta) & =k_1\left{\theta^2(1-\theta)+\theta(1-\theta)^2\right} \theta^x(1-\theta)^{n-x} \
& =k_1\left{\theta^{x+2}(1-\theta)^{n-x+1}+\theta^{x+1}(1-\theta)^{n-x+2}\right}
\end{aligned}
$$
Now
$$
\begin{aligned}
\int_0^1 f^{(1)}(\theta) d \theta=1 & =k_1\left{\int_0^1 \theta^{x+2}(1-\theta)^{n-x+1} d \theta+\int_0^1 \theta^{x+1}(1-\theta)^{n-x+2} d \theta\right} \
& =k_1\left{\frac{\Gamma(x+3) \Gamma(n-x+2)}{\Gamma(n+5)}+\frac{\Gamma(x+2) \Gamma(n-x+3)}{\Gamma(n+5)}\right} .
\end{aligned}
$$
Hence
$$
k_1=\left{\frac{\Gamma(x+3) \Gamma(n-x+2)}{\Gamma(n+5)}+\frac{\Gamma(x+2) \Gamma(n-x+3)}{\Gamma(n+5)}\right}^{-1}
$$
and
$$
\begin{aligned}
f^{(1)}(\theta)= & \left{\frac{\Gamma(x+3) \Gamma(n-x+2)}{\Gamma(n+5)}+\frac{\Gamma(x+2) \Gamma(n-x+3)}{\Gamma(n+5)}\right}^{-1} \
& \times\left{\theta^{x+2}(1-\theta)^{n-x+1}+\theta^{x+1}(1-\theta)^{n-x+2}\right} .
\end{aligned}
$$
iii. Posterior mean
$$
\begin{aligned}
\mathrm{E}_0(\theta) & =\int_0^1 \theta f^{(1)}(\theta) d \theta \
& =k_1\left{\int_0^1 \theta^{x+3}(1-\theta)^{n-x+1} d \theta+\int_0^1 \theta^{x+2}(1-\theta)^{n-x+2} d \theta\right} \
& =k_1\left{\frac{\Gamma(x+4) \Gamma(n-x+2)}{\Gamma(n+6)}+\frac{\Gamma(x+3) \Gamma(n-x+3)}{\Gamma(n+6)}\right} \
& =\frac{\left{\frac{\Gamma(x+4) \Gamma(n-x+2)}{\Gamma(n+6)}+\frac{\Gamma(x+3) \Gamma(n-x+3)}{\Gamma(n+6)}\right}}{\left{\frac{\Gamma(x+3) \Gamma(n-x+2)}{\Gamma(n+5)}+\frac{\Gamma(x+2) \Gamma(n-x+3)}{\Gamma(n+5)}\right}} \
& =\frac{1}{n+5}\left{\frac{\Gamma(x+4) \Gamma(n-x+2)+\Gamma(x+3) \Gamma(n-x+3)}{\Gamma(x+3) \Gamma(n-x+2)+\Gamma(x+2) \Gamma(n-x+3)}\right} \
& =\frac{1}{n+5}\left{\frac{\Gamma(x+4)+\Gamma(x+3)(n-x+2)}{\Gamma(x+3)+\Gamma(x+2)(n-x+2)}\right} \
& =\left(\frac{(x+3)(x+2)+(x+2)(n-x+2)}{(x+2)+(n-x+2)}\right} \
& =\frac{x+2}{n+4}\left{\frac{(x+3)+(n-x+2)}{(x+2)+(n-x+2)}\right}
\end{aligned}
$$
We are interested in the parameter $\theta$, of a $\operatorname{binomial}(n, \theta)$ distribution. We have a prior distribution for $\theta$ with density
$$
f^{(0)}(\theta)=\left{\begin{array}{cc}
k_0 \theta^2(1-\theta)^3 & (0<\theta<1) \
0 & \text { (otherwise) }
\end{array} .\right.
$$
(a) i. Find the value of $k_0$.
ii. Find the prior mean of $\theta$.
iii. Find the prior standard deviation of $\theta$.
(b) We observe $x$, an observation from the $\operatorname{binomial}(n, \theta)$ distribution.
i. Find the likelihood.
ii. Find the posterior density of $\theta$.
iii. Find the posterior mean of $\theta$.
(a) i.
$$
\int_0^1 f^{(0)}(\theta) d \theta=k_0 \int_0^1 \theta^2(1-\theta)^3 d \theta=k_0 \frac{\Gamma(3) \Gamma(4)}{\Gamma(7)} .
$$
Hence
$$
k_0=\frac{\Gamma(7)}{\Gamma(3) \Gamma(4)}=\frac{6 !}{2 ! 3 !}=\frac{6 \times 5 \times 4}{2}=60 .
$$
ii. Prior mean
$$
\begin{aligned}
\mathrm{E}_0(\theta) & =\int_0^1 \theta f^{(0)}(\theta) d \theta=k_0 \int_0^1 \theta^3(1-\theta)^3 d \theta \
& =\frac{\Gamma(4) \Gamma(4)}{\Gamma(8)} \frac{\Gamma(7)}{\Gamma(3) \Gamma(4)}=\frac{3}{7}=0.4286 .
\end{aligned}
$$
iii.
$$
\begin{aligned}
\mathrm{E}_0\left(\theta^2\right) & =\int_0^1 \theta^2 f^{(0)}(\theta) d \theta=k_0 \int_0^1 \theta^4(1-\theta)^3 d \theta \
& =\frac{\Gamma(5) \Gamma(4)}{\Gamma(9)} \frac{\Gamma(7)}{\Gamma(3) \Gamma(4)}=\frac{4 \times 3}{8 \times 7}=\frac{3}{14}
\end{aligned}
$$
Hence
$$
\operatorname{var}_0(\theta)=\frac{3}{14}-\left(\frac{3}{7}\right)^2=\frac{21-18}{98}=\frac{3}{98}
$$
and
$$
\text { std.dev } \operatorname{dev}_0(\theta)=\sqrt{\frac{3}{98}}=0.1750 .
$$
(b) i. Likelihood
$$
L(\theta)=\left(\begin{array}{c}
n \
x
\end{array}\right) \theta^x(1-\theta)^{n-x} .
$$
ii. Posterior density
$$
f^{(1)}(\theta) \propto f^{(0)}(\theta) L(\theta)=k_1 \theta^{x+2}(1-\theta)^{n-x+3} .
$$
Now
$$
\int_0^1 f^{(1)}(\theta) d \theta=1=k_1 \int_0^1 \theta^{x+2}(1-\theta)^{n-x+3} d \theta n=k_1 \frac{\Gamma(x+3) \Gamma(n-x+4)}{\Gamma(n+7)} .
$$
Hence
$$
k_1=\frac{\Gamma(n+7)}{\Gamma(x+3) \Gamma(n-x+4)}
$$
and
$$
f^{(1)}(\theta)=\frac{\Gamma(n+7)}{\Gamma(x+3) \Gamma(n-x+4)} \theta^{x+2}(1-\theta)^{n-x+3} \quad(0<\theta<1) .
$$
iii. Posterior mean
$$
\begin{aligned}
\mathrm{E}_1(\theta) & =\int_0^1 \theta f^{(1)}(\theta) d \theta=k_1 \int_0^1 \theta^{x+3}(1-\theta)^{n-x+3} d \theta \
& =\frac{\Gamma(n+7)}{\Gamma(x+3) \Gamma(n-x+4)} \frac{\Gamma(x+4) \Gamma(n-x+4)}{\Gamma(n+8)}=\frac{x+3}{n+7}
\end{aligned}
$$
MY-ASSIGNMENTEXPERT™可以为您提供SYDNEY DATA5711 BAYESIAN ANALYSIS贝叶斯分析课程的代写代考和辅导服务!