### 统计代写|贝叶斯分析代写Bayesian Analysis代考|The posterior distribution

statistics-lab™ 为您的留学生涯保驾护航 在代写贝叶斯分析Bayesian Analysis方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写贝叶斯分析Bayesian Analysis代写方面经验极为丰富，各种代写贝叶斯分析Bayesian Analysis相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• Advanced Probability Theory 高等概率论
• Advanced Mathematical Statistics 高等数理统计学
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 统计代写|贝叶斯分析代写Bayesian Analysis代考|The posterior distribution

Bayesian inference requires determination of the posterior probability distribution of $\theta$. This task is equivalent to finding the posterior pdf of $\theta$, which may be done using the equation
$$f(\theta \mid y)=\frac{f(\theta) f(y \mid \theta)}{f(y)} .$$
Here, $f(y)$ is the unconditional (or prior) pdf of $y$, as given by $f(y)=\int f(y \mid \theta) d F(\theta)= \begin{cases}\int_{\theta} f(\theta) f(y \mid \theta) d \theta & \text { if } \theta \text { is continuous } \ \sum_{\theta} f(\theta) f(y \mid \theta) & \text { if } \theta \text { is discrete. }\end{cases}$
Note: Here, $\int f(y \mid \theta) d F(\theta)$ is a Lebesgue-Stieltjes integral, which may need evaluating by breaking the integral into two parts in the case where $\theta$ has a mixed distribution. In the continuous case, think of $d F(\theta)$ as $\frac{d F(\theta)}{d \theta} d \theta=f(\theta) d \theta$

Consider six loaded dice with the following properties. Die A has probability $0.1$ of coming up 6, each of Dice B and C has probability $0.2$ of coming up 6, and each of Dice D, E and F has probability $0.3$ of coming up $6 .$
A die is chosen randomly from the six dice and rolled twice. On both occasions, 6 comes up.

What is the posterior probability distribution of $\theta$, the probability of 6 coming up on the chosen die.

## 统计代写|贝叶斯分析代写Bayesian Analysis代考|The proportionality formula

Observe that $f(y)$ is a constant with respect to $\theta$ in the Bayesian equation
$$f(\theta \mid y)=f(\theta) f(y \mid \theta) / f(y),$$
which means that we may also write the equation as
$$f(\theta \mid y)=\frac{f(\theta) f(y \mid \theta)}{k}$$
or as
$$f(\theta \mid y)=c f(\theta) f(y \mid \theta),$$
where $k=f(y)$ and $c=1 / k$.
We may also write
$$f(\theta \mid y) \propto f(\theta) f(y \mid \theta),$$
where $\propto$ is the proportionality sign.

Equivalently, we may write
$$f(\theta \mid y)^{\theta} \propto f(\theta) f(y \mid \theta)$$
to emphasise that the proportionality is specifically with respect to $\theta$.
Another way to express the last equation is
$$f(\theta \mid y) \propto f(\theta) \times L(\theta \mid y),$$
where $L(\theta \mid y)$ is the likelihood function (defined as the model density $f(y \mid \theta)$ multiplied by any constant with respect to $\theta$, and viewed as a function of $\theta$ rather than of $y$ ).
The last equation may also be stated in words as:
The posterior is proportional to the prior times the likelihood.
These observations indicate a shortcut method for determining the required posterior distribution which obviates the need for calculating $f(y)$ (which may be difficult).

This method is to multiply the prior density (or the kernel of that density) by the likelihood function and try to identify the resulting function of $\theta$ as the density of a well-known or common distribution.
Once the posterior distribution has been identified, $f(y)$ may then be obtained easily as the associated normalising constant.

## 统计代写|贝叶斯分析代写Bayesian Analysis代考|Continuous parameters

The examples above have all featured a target parameter which is discrete. The following example illustrates Bayesian inference involving a continuous parameter. This case presents no new problems, except that the prior and posterior densities of the parameter may no longer be interpreted directly as probabilities.

Consider the following Bayesian model:
\begin{aligned} &(y \mid \theta) \sim \operatorname{Binomial}(n, \theta) \ &\theta \sim \operatorname{Beta}(\alpha, \beta) \quad \text { (prior). } \end{aligned}
Find the posterior distribution of $\theta$.
Solution to Exercise $1.8$
The posterior density is
\begin{aligned} f(\theta \mid y) & \propto f(\theta) f(y \mid \theta) \ &=\frac{\theta^{\alpha-1}(1-\theta)^{\beta-1}}{B(\alpha, \beta)} \times\left(\begin{array}{l} n \ y \end{array}\right) \theta^{y}(1-\theta)^{n-y} \ & \propto \theta^{\alpha-1}(1-\theta)^{\beta-1} \times \theta^{y}(1-\theta)^{n-y} \quad \text { (ignoring constants which } \ &=\theta^{(\alpha+y)-1}(1-\theta)^{(\beta+n-y)-1}, 0<\theta<1 \end{aligned}
This is the kernel of the beta density with parameters $\alpha+y$ and $\beta+n-y$. It follows that the posterior distribution of $\theta$ is given by
$$(\theta \mid y) \sim \operatorname{Beta}(\alpha+y, \beta+n-y) \text {, }$$
and the posterior density of $\theta$ is (exactly)
$$f(\theta \mid y)=\frac{\theta^{(\alpha+y)-1}(1-\theta)^{(\beta+n-y)-1}}{B(\alpha+y, \beta+n-y)}, 0<\theta<1 .$$
For example, suppose that $\alpha=\beta=1$, that is, $\theta \sim B e t a(1,1)$.
Then the prior density is $f(\theta)=\frac{\theta^{1-1}(1-\theta)^{1-1}}{B(1,1)}=1,0<\theta<1$.
Thus the prior may also be expressed by writing $\theta \sim U(0,1)$.
Also, suppose that $n=2$. Then there are three possible values of $y$, namely 0,1 and 2 , and these lead to the following three posteriors, respectively:
\begin{aligned} &(\theta \mid y) \sim \operatorname{Beta}(1+0,1+2-0)=\operatorname{Beta}(1,3) \ &(\theta \mid y) \sim \operatorname{Beta}(1+1,1+2-1)=\operatorname{Beta}(2,2) \ &(\theta \mid y) \sim \operatorname{Beta}(1+2,1+2-2)=\operatorname{Beta}(3,1) \end{aligned}
These three posteriors and the prior are illustrated in Figure 1.5.

## 统计代写|贝叶斯分析代写Bayesian Analysis代考|The posterior distribution

F(θ∣是)=F(θ)F(是∣θ)F(是).

## 统计代写|贝叶斯分析代写Bayesian Analysis代考|The proportionality formula

F(θ∣是)=F(θ)F(是∣θ)/F(是),

F(θ∣是)=F(θ)F(是∣θ)ķ

F(θ∣是)=CF(θ)F(是∣θ),

F(θ∣是)∝F(θ)F(是∣θ),

F(θ∣是)θ∝F(θ)F(是∣θ)

F(θ∣是)∝F(θ)×大号(θ∣是),

## 统计代写|贝叶斯分析代写Bayesian Analysis代考|Continuous parameters

(是∣θ)∼二项式⁡(n,θ) θ∼贝塔⁡(一个,b) （事先的）。

F(θ∣是)∝F(θ)F(是∣θ) =θ一个−1(1−θ)b−1乙(一个,b)×(n 是)θ是(1−θ)n−是 ∝θ一个−1(1−θ)b−1×θ是(1−θ)n−是 （忽略常数  =θ(一个+是)−1(1−θ)(b+n−是)−1,0<θ<1

(θ∣是)∼贝塔⁡(一个+是,b+n−是),

F(θ∣是)=θ(一个+是)−1(1−θ)(b+n−是)−1乙(一个+是,b+n−是),0<θ<1.

(θ∣是)∼贝塔⁡(1+0,1+2−0)=贝塔⁡(1,3) (θ∣是)∼贝塔⁡(1+1,1+2−1)=贝塔⁡(2,2) (θ∣是)∼贝塔⁡(1+2,1+2−2)=贝塔⁡(3,1)

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。