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

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

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

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

In a statistical context, by inference, one usually means estimation of parameters, tests of hypotheses, and prediction of future observations. With the Bayesian approach, all inferences are based on the posterior distribution of the parameters, which in turn is based on the sample, via the likelihood function and the prior distribution. We have seen the role of the prior density and likelihood function in determining the posterior distribution, and presently will focus on the determination of point and interval estimation of the model parameters, and later will emphasize how the posterior distribution determines a test of hypothesis. Finally, the role of the predictive distribution in testing hypotheses and in goodness of fit will be explained.

When the model has only one parameter, one would estimate that parameter by listing its characteristics, such as the posterior mean, media, and standard deviation and plotting the posterior density. However, if there are several parameters, one would determine the marginal posterior distribution of the relevant parameters and, as above, calculate its characteristics (e.g., mean, median, mode, standard deviation, etc.) and plot the densities. Interval estimates of the parameters are also usually reported and are called credible intervals.

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

Inferences for the normal $(\mu, \tau)$ population are somewhat more demanding, because both parameters are unknown. Assuming the vague prior density $\xi(\mu, \tau) \propto 1 / \tau$, the marginal posterior distribution of the population mean $\mu$ is a $t$-distribution with $n-1$ degrees of freedom, mean $\bar{x}$, and precision $n / s^{2}$; thus, the mean and the median are the same and provide a natural estimator of $\mu$, and because of the symmetry of the $t$-density, a $(1-\alpha)$ credible interval for $\mu$ is $\bar{x} \pm t_{\alpha / 2, n-1} S / \sqrt{n}$, where $t_{\alpha / 2, n-1}$ is the upper 100 $\alpha / 2$ percent point of the $t$-distribution with $n$-1degrees of freedom. To generate values from the $t\left(n-1, \bar{x}, n / S^{2}\right)$ distribution, generate values from Student’s $t$-distribution with $n-1$ degrees of freedom, multiply each by $S / \sqrt{n}$, and then add $\bar{x}$ to each. Suppose $n-30$,

\begin{aligned} &x=(7.8902,4.8343,11.0677,8.7969,4.0391,4.0024,6.6494,8.4788,0.7939,5.0689, \ &6.9175,6.1092,8.2463,10.3179,1.8429,3.0789,2.8470,5.1471,6.3730,5.2907,1.5024, \ &3.8193,9.9831,6.2756,5.3620,5.3297,9.3105,6.5555,0.8189,0.4713) \text {, then } \ &\bar{x}=5.57 \text { and } S=2.92 \end{aligned}
Using the same dataset, the following WinBugs code is used to analyze the problem.
BC $2.1$
Model;
${$ for ( i in 1:30) ${x[i] \sim \operatorname{dnorm}(\mathrm{mu}, \mathrm{tau})}$
mu $\sim$ dnorm $(0.0,0001)$
tau $\sim$ dgamma(. $0001, .0001)$
sigma $<-1 /$ tau $}$
list $(\mathrm{x}=\mathrm{c}(7.8902,4.8343,11.0677,8.7969,4.0391,4.0024,6.6494,8.4788,0.7939,5.0689$, $6.9175,6.1092,8.2463,10.3179,1.8429,3.0789,2.8470,5.1471,6.3730,5.2907,1.5024$, $3.8193,9.9831,6.2756,5.3620,5.3297,9.3105,6.5555,0.8189,0.4713))$
$\operatorname{list}(\mathrm{mu}=0, \mathrm{tau}=1)$
Note, that a somewhat different prior was employed here, compared to previously, in that $\mu$ and $\tau$ are independent and assigned properly, but noninformative distributions. The corresponding analysis gives the following as shown in Table 2.2.

Upper and lower refer to the lower and upper $21 / 2$ percent points of the posterior distribution. Note a $95 \%$ credible interval for mu is $(4.47,6.65)$ and the estimation error is $.003566$. See the Appendix for the details on executing the WinBUGS statements above.

The program generated 30,000 samples from the joint posterior distribution of $\mu$ and $\sigma$ using a Gibbs sampling algorithm, and used 29,000 for the posterior moments and graphs, with a refresh of 100 .

## 统计代写|贝叶斯分析代写Bayesian Analysis代考|Testing Hypotheses

An important feature of inference is testing hypotheses. Often in stochastic processes, the scientific hypothesis can be expressed in statistical terms and

a formal test implemented. Suppose $\Omega=\Omega_{0} \cup \Omega_{1}$ is a partition of the parameter space, then the null hypothesis is designated as $H_{0}: \theta \in \Omega_{0}$ and the alternative by $H_{1}: \theta \in \Omega_{1}$, and a test of $H_{0}$ versus $H_{1}$ consists of rejecting $H_{0}$ in favor of $H_{1}$ if the observations $x=\left(x_{1}, x_{2}, \ldots, x_{n}\right)$ belong to a critical region C. In the usual approach, the critical region is based on the probabilities of type I errors, namely $\mathrm{P}{\mathrm{r}}(C \mid \theta)$, where $\theta \in \Omega{0}$ and of type II errors $1-P_{r}(C \mid \theta)$, where $\theta \in \Omega_{1}$. This approach to testing hypothesis was developed formally by Neyman and Pearson and can be found in many of the standard references, such as Lehmann. ${ }^{20}$ Lee ${ }^{21}$ presents a good elementary introduction to testing and estimation in a Bayesian context.
In the Bayesian approach, the posterior probabilities
$$p_{0}=\operatorname{Pr}\left(\theta \in \Omega_{0} \mid \text { data }\right)$$
and
$$p_{1}=\operatorname{Pr}\left(\theta \in \Omega_{1} \mid \text { data }\right)$$
are required, and on the basis of the two, a decision is made whether or not to reject $\mathrm{H}$ in favor of $\mathrm{A}$ or to reject $\mathrm{A}$ in favor of $\mathrm{H}$. Also required are the two corresponding prior probabilities
$$\pi_{0}=\operatorname{Pr}\left(\theta \in \Omega_{0}\right)$$
and
$$\pi_{1}=\operatorname{Pr}\left(\theta \in \Omega_{1}\right) .$$
Now consider the prior odds $\pi_{0} / \pi_{1}$ and posterior odds $p_{0} / p_{1}$. In turn, consider the Bayes factor B in favor of $H_{0}$ relative to $H_{1}$, namely
$$B=\left(p_{0} / p_{1}\right) /\left(\pi_{0} / \pi_{1}\right)$$
Then, the posterior probabilities $p_{0}$ and $p_{1}$ can be expressed in terms of the Bayes factor, thus:
$$p_{0}=1 /\left[1+\left(\pi_{1} / \pi_{1}\right) B^{-1}\right]$$
and the Bayes factor is interpreted as the odds in favor of $H_{0}$ relative to $H_{1}$ as implied by the information from the data.

When the hypotheses are simple, that is, $\Omega_{0}=\left{\theta_{0}\right}$ and $\Omega_{1}=\left{\theta_{1}\right}$, note that the odds ratio can be expressed as the likelihood ratio.
$$B=p\left(x \mid \theta_{0}\right) / p\left(x \mid \theta_{1}\right)$$

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

X=(7.8902,4.8343,11.0677,8.7969,4.0391,4.0024,6.6494,8.4788,0.7939,5.0689, 6.9175,6.1092,8.2463,10.3179,1.8429,3.0789,2.8470,5.1471,6.3730,5.2907,1.5024, 3.8193,9.9831,6.2756,5.3620,5.3297,9.3105,6.5555,0.8189,0.4713)， 然后  X¯=5.57 和 小号=2.92

$F○r(一世一世n1:30)$X[一世]∼规范⁡(米在,吨一个在)$米在$∼$dn○r米$(0.0,0001)$吨一个在$∼$dG一个米米一个(.$0001,.0001)$s一世G米一个$<−1/$吨一个在$

## 统计代写|贝叶斯分析代写Bayesian Analysis代考|Testing Hypotheses

p0=公关⁡(θ∈Ω0∣ 数据 )

p1=公关⁡(θ∈Ω1∣ 数据 )

p0=1/[1+(圆周率1/圆周率1)乙−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 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。