## 统计代写|随机过程代写stochastic process代考|Branching processes

In inference for branching processes, the parameters of interest will usually be the mean of the offspring distribution, which determines whether or not extinction is certain, and the probability of eventual extinction.

Typically, the number of offspring born to each individual will not be observed. Instead, we will simply observe the size of the population at each generation. Suppose that given a fixed, initial population $z_0$, we observe the population sizes of $n$ generations of a branching process, say $Z_1=z_1, \ldots, Z_n=z_n$. Then, for certain parametric distributions of the number of offspring, Bayesian inference is straightforward.
Example 3.14: Assume that the number of offspring born to an individual has a geometric distribution
$$P(X=x \mid p)=p(1-p)^x, \quad \text { for } x=0,1,2, \ldots$$ with $E[X \mid p]=\frac{1-p}{p}$. Now, for $p \geq 0.5, E[X \mid p]<1$ and extinction is certain. Otherwise, from (3.2), the probability of extinction can be shown to be $$\pi=\frac{p}{1-p} .$$ Given a beta prior distribution $p \sim \operatorname{Be}(\alpha, \beta)$ and the sample data, and recalling that the sum of geometric distributed random variables has a negative binomial distribution, it is easy to see that $$p \mid \mathbf{z} \sim \operatorname{Be}\left(\alpha+z-z_n, \beta+z-z_0\right),$$ where $z=\sum_{i=0}^n z_i$. Therefore, the predictive mean of the offspring distribution is $$E[X \mid \mathbf{z}]-E\left[\frac{1-p}{p} \mid \mathbf{z}\right]-\frac{\beta+z-z_0}{\alpha+z-z_n-1} .$$ The predictive probability that the population dies out in the next generation is $$P\left(Z_{n+1}=0 \mid \mathbf{z}\right)=E\left[p^{z_n} \mid \mathbf{z}\right]=\frac{B\left(\alpha+z, \beta+z-z_0\right)}{B\left(\alpha+z-z_n, \beta+z-z_0\right)}$$ and the predictive probability of eventual extinction is \begin{aligned} E[\pi \mid \mathbf{z}]=& P(p>0.5 \mid \mathbf{z})+\int_0^{0.5}\left(\frac{p}{1-p}\right)^{z_n} f(p \mid \mathbf{z}) \mathrm{d} z \ =& I B\left(0.5, \beta+z-z_0, \alpha+z-z_n\right)+\ & \frac{B\left(\alpha+z, \beta+z-z_0-z_n\right)}{B(\alpha, \beta)} I B\left(0.5, \alpha+z, \beta+z-z_0-z_n\right), \end{aligned}
where $I B(x, a, b)=\int_0^x \frac{1}{R(a, b)} x^{a-1}(1-x)^{b-1} \mathrm{~d} x$ is the incomplete beta function. $\Delta$
Conjugate inference is also straightforward when, for example, binomial, negative binomial or Poisson distributions are assumed (see, e.g., Guttorp, 1991).

## 统计代写|随机过程代写stochastic process代考|Hidden Markov models

Consider the HMM outlined in Section 3.2.5. Given the sample data, $\mathbf{y}=\left(y_0, \ldots, y_n\right)$, the likelihood function is
$$l(\boldsymbol{\theta}, \boldsymbol{P} \mid \mathbf{y})=\sum_{x_0, \ldots, x_n} \pi\left(x_0\right) f\left(y_0 \mid \boldsymbol{\theta}{x_0}\right) \prod{j=1}^n p_{x_{j-1} x_j} f\left(y_j \mid \boldsymbol{\theta}{x_j}\right),$$ which contains $K^{n+1}$ terms. In practice, this will usually be impossible to compute directly. A number of approaches can be taken in order to simplify the problem. Suppose that the states, $\mathbf{x}$, of the hidden Markov chain were known. Then, the likelihood simplifies to \begin{aligned} l(\boldsymbol{\theta}, \boldsymbol{P} \mid \mathbf{x}, \mathbf{y}) &=\pi\left(x_0\right) \prod{j=1}^n p_{x_{j-1} x_j} \prod_{i=1}^n f\left(y_i \mid \boldsymbol{\theta}{x_i}\right) \ &=l_1(\boldsymbol{P} \mid \mathbf{x}) l_2(\boldsymbol{\theta} \mid \mathbf{x}, \mathbf{y}), \end{aligned} where $l_1(\boldsymbol{P} \mid \mathbf{x})=\pi\left(x_0 \mid \boldsymbol{P}\right) \prod{j=1}^n p_{x_{j-1} x_j}$ and $l_2(\boldsymbol{\theta} \mid \mathbf{x}, \mathbf{y})=\prod_{i=0}^n f\left(y_i \mid \boldsymbol{\theta}_{x_i}\right)$. Given the usual matrix beta prior distribution for $\boldsymbol{P}$, then a simple rejection algorithm could be used to sample from $f(\boldsymbol{P} \mid \mathbf{x})$ as in Section 3.3.6. Similarly, when $Y \mid \boldsymbol{\theta}$ is a standard exponential family distribution, then a conjugate prior for $\theta$ will usually be available and, therefore, drawing a sample from each $\theta_i \mid \mathbf{x}, \mathbf{y}$ will also be straightforward.

Also, letting $\mathbf{x}{-t}=\left(x_0, x_1, \ldots, x{t-1}, x_{t+1}, \ldots, x_n\right)$, it is straightforward to see that, for $i=1, \ldots, K$,
$P\left(x_0=i \mid \mathbf{x}{-0}, \mathbf{y}\right) \propto \pi(i) p{i x_1} f\left(y_1 \mid \boldsymbol{\theta}i\right)$ $P\left(x_t=i \mid \mathbf{x}{-t}, \mathbf{y}\right) \propto p_{x_{t-1} i} p_{i x_{t+1}} f\left(y_t \mid \theta_i\right)$ for $1<t<n$
$P\left(x_n=i \mid \mathbf{x}{-n}, \mathbf{y}\right) \propto p{x_{n-1} i} f\left(y_n \mid \boldsymbol{\theta}_i\right)$
so that a full Gibbs sampling algorithm can be set up.
A disadvantage of this type of algorithm is that the generated sequences $\mathbf{x}^{(s)}$ can be highly autocorrelated, particularly when there is high dependence amongst the elements of $\mathbf{x}$ in their posterior distribution. In many cases, it is more efficient to sample directly from $P(\mathbf{x} \mid \mathbf{y})$. The standard approach for doing this is to use the forward-backward or Baum-Welch formulas (Baum et al., 1970).

First, note that $P\left(x_n \mid x_{n-1}, \mathbf{y}\right)=P\left(x_n \mid x_{n-1}, y_n\right) \propto p_{x_{n-1} x_n} f\left(y_n \mid x_n\right) \equiv P_n^{\prime}\left(x_n \mid x_{n-1}, \mathbf{y}\right)$ which is the unnormalized conditional density of $x_n \mid x_{n-1}, \mathbf{y}$. Also, it is easy to show that we have a backward recurrence relation
$$P\left(x_t \mid x_{t-1}, \mathbf{y}\right) \propto p_{x_{t-1} x_t} f\left(y_t \mid x_t\right) \sum_{i=1}^K p_{t+1}^{\prime}\left(i \mid x_t, \mathbf{y}\right) \equiv P_t^{\prime}\left(x_t \mid x_{t-1}, \mathbf{y}\right)$$
and, finally,
$$P\left(x_0 \mid \mathbf{y}\right) \propto \pi\left(x_0\right) f\left(y_0 \mid x_0\right) \sum_{i=1}^K P_1^{\prime}\left(i \mid x_0, \mathbf{y}\right) \equiv P_0^{\prime}\left(x_0 \mid \mathbf{y}\right) .$$

# 随机过程代考

## 统计代写|随机过程代写随机过程代考|分支过程

$$P(X=x \mid p)=p(1-p)^x, \quad \text { for } x=0,1,2, \ldots$$ with $E[X \mid p]=\frac{1-p}{p}$。现在，对于$p \geq 0.5, E[X \mid p]<1$和灭绝是肯定的。否则，由(3.2)可知，灭绝概率为$$\pi=\frac{p}{1-p} .$$给定beta先验分布$p \sim \operatorname{Be}(\alpha, \beta)$和样本数据，回想几何分布随机变量的和具有负二项分布，很容易看出$$p \mid \mathbf{z} \sim \operatorname{Be}\left(\alpha+z-z_n, \beta+z-z_0\right),$$其中$z=\sum_{i=0}^n z_i$。因此，后代分布的预测均值为$$E[X \mid \mathbf{z}]-E\left[\frac{1-p}{p} \mid \mathbf{z}\right]-\frac{\beta+z-z_0}{\alpha+z-z_n-1} .$$。种群在下一代中灭绝的预测概率为$$P\left(Z_{n+1}=0 \mid \mathbf{z}\right)=E\left[p^{z_n} \mid \mathbf{z}\right]=\frac{B\left(\alpha+z, \beta+z-z_0\right)}{B\left(\alpha+z-z_n, \beta+z-z_0\right)}$$，最终灭绝的预测概率为\begin{aligned} E[\pi \mid \mathbf{z}]=& P(p>0.5 \mid \mathbf{z})+\int_0^{0.5}\left(\frac{p}{1-p}\right)^{z_n} f(p \mid \mathbf{z}) \mathrm{d} z \ =& I B\left(0.5, \beta+z-z_0, \alpha+z-z_n\right)+\ & \frac{B\left(\alpha+z, \beta+z-z_0-z_n\right)}{B(\alpha, \beta)} I B\left(0.5, \alpha+z, \beta+z-z_0-z_n\right), \end{aligned}
，其中$I B(x, a, b)=\int_0^x \frac{1}{R(a, b)} x^{a-1}(1-x)^{b-1} \mathrm{~d} x$为不完全贝塔函数。$\Delta$

## 统计代写|随机过程代写随机过程代考|隐马尔可夫模型

$$l(\boldsymbol{\theta}, \boldsymbol{P} \mid \mathbf{y})=\sum_{x_0, \ldots, x_n} \pi\left(x_0\right) f\left(y_0 \mid \boldsymbol{\theta}{x_0}\right) \prod{j=1}^n p_{x_{j-1} x_j} f\left(y_j \mid \boldsymbol{\theta}{x_j}\right),$$，其中包含$K^{n+1}$项。在实践中，这通常是不可能直接计算的。为了简化这个问题，可以采取许多方法。假设隐藏马尔可夫链的状态$\mathbf{x}$是已知的。然后，可能性化简为\begin{aligned} l(\boldsymbol{\theta}, \boldsymbol{P} \mid \mathbf{x}, \mathbf{y}) &=\pi\left(x_0\right) \prod{j=1}^n p_{x_{j-1} x_j} \prod_{i=1}^n f\left(y_i \mid \boldsymbol{\theta}{x_i}\right) \ &=l_1(\boldsymbol{P} \mid \mathbf{x}) l_2(\boldsymbol{\theta} \mid \mathbf{x}, \mathbf{y}), \end{aligned}，其中$l_1(\boldsymbol{P} \mid \mathbf{x})=\pi\left(x_0 \mid \boldsymbol{P}\right) \prod{j=1}^n p_{x_{j-1} x_j}$和$l_2(\boldsymbol{\theta} \mid \mathbf{x}, \mathbf{y})=\prod_{i=0}^n f\left(y_i \mid \boldsymbol{\theta}_{x_i}\right)$。给定$\boldsymbol{P}$的通常矩阵beta先验分布，那么可以使用一个简单的拒绝算法从$f(\boldsymbol{P} \mid \mathbf{x})$采样，如第3.3.6节所示。类似地，当$Y \mid \boldsymbol{\theta}$是一个标准指数族分布时，$\theta$的共轭先验通常是可用的，因此，从每个$\theta_i \mid \mathbf{x}, \mathbf{y}$中提取样本也将是直接的 同样，让$\mathbf{x}{-t}=\left(x_0, x_1, \ldots, x{t-1}, x_{t+1}, \ldots, x_n\right)$，很容易看出，对于$i=1, \ldots, K$，
$P\left(x_0=i \mid \mathbf{x}{-0}, \mathbf{y}\right) \propto \pi(i) p{i x_1} f\left(y_1 \mid \boldsymbol{\theta}i\right)$$P\left(x_t=i \mid \mathbf{x}{-t}, \mathbf{y}\right) \propto p_{x_{t-1} i} p_{i x_{t+1}} f\left(y_t \mid \theta_i\right) for 1<t<n P\left(x_n=i \mid \mathbf{x}{-n}, \mathbf{y}\right) \propto p{x_{n-1} i} f\left(y_n \mid \boldsymbol{\theta}_i\right) ，这样就可以建立一个完整的吉布斯采样算法。这类算法的一个缺点是，生成的序列\mathbf{x}^{(s)}可以是高度自相关的，特别是当\mathbf{x}的元素在其后验分布中有高度依赖性时。在许多情况下，直接从P(\mathbf{x} \mid \mathbf{y})取样更有效。做到这一点的标准方法是使用前后向公式或Baum- welch公式(Baum et al.， 1970) 首先，注意P\left(x_n \mid x_{n-1}, \mathbf{y}\right)=P\left(x_n \mid x_{n-1}, y_n\right) \propto p_{x_{n-1} x_n} f\left(y_n \mid x_n\right) \equiv P_n^{\prime}\left(x_n \mid x_{n-1}, \mathbf{y}\right)，它是x_n \mid x_{n-1}, \mathbf{y}的非规范化条件密度。同样，很容易表明我们有一个向后递归关系$$ P\left(x_t \mid x_{t-1}, \mathbf{y}\right) \propto p_{x_{t-1} x_t} f\left(y_t \mid x_t\right) \sum_{i=1}^K p_{t+1}^{\prime}\left(i \mid x_t, \mathbf{y}\right) \equiv P_t^{\prime}\left(x_t \mid x_{t-1}, \mathbf{y}\right) $$，最后，$$ P\left(x_0 \mid \mathbf{y}\right) \propto \pi\left(x_0\right) f\left(y_0 \mid x_0\right) \sum_{i=1}^K P_1^{\prime}\left(i \mid x_0, \mathbf{y}\right) \equiv P_0^{\prime}\left(x_0 \mid \mathbf{y}\right) .$\$

myassignments-help数学代考价格说明

1、客户需提供物理代考的网址，相关账户，以及课程名称，Textbook等相关资料~客服会根据作业数量和持续时间给您定价~使收费透明，让您清楚的知道您的钱花在什么地方。

2、数学代写一般每篇报价约为600—1000rmb，费用根据持续时间、周作业量、成绩要求有所浮动(持续时间越长约便宜、周作业量越多约贵、成绩要求越高越贵)，报价后价格觉得合适，可以先付一周的款，我们帮你试做，满意后再继续，遇到Fail全额退款。

3、myassignments-help公司所有MATH作业代写服务支持付半款，全款，周付款，周付款一方面方便大家查阅自己的分数，一方面也方便大家资金周转，注意:每周固定周一时先预付下周的定金，不付定金不予继续做。物理代写一次性付清打9.5折。

Math作业代写、数学代写常见问题

myassignments-help擅长领域包含但不是全部: