### 统计代写|随机过程代写stochastic process代考|For a Markov chain

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

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

## 统计代写|随机过程代写stochastic process代考|For a Markov chain

EXERCISE 1.1. For a Markov chain with a one-step transition probability matrix $\left[\begin{array}{ccc}0.2 & 0.3 & 0.5 \ 0.8 & 0.1 & 0.1\end{array}\right]$
we compute:
(a) $P\left(X_{3}=2 \mid X_{0}=1, X_{1}=2, X_{2}=3\right)=P\left(X_{3}=2 \mid X_{2}=3\right.$ ) (by the Markov property) $=P_{32}=0.1$.
(b) $P\left(X_{4}=3 \mid X_{0}=2, X_{3}=1\right)=P\left(X_{4}=3 \mid X_{3}=1\right) \quad$ (by the Markov property) $=P_{13}=0.3$.
(c) $P\left(X_{0}=1, X_{1}=2, X_{2}=3, X_{3}=1\right)=P\left(X_{3}=1 \mid X_{0}=1, X_{1}=2, X_{2}=3\right) P\left(X_{2}=3 \mid X_{0}=1\right.$, $\left.X_{1}=2\right) P\left(X_{1}=2 \mid X_{0}=1\right) P\left(X_{0}=1\right)$ (by conditioning)
$=P\left(X_{3}=1 \mid X_{2}=3\right) P\left(X_{2}=3 \mid X_{1}=2\right) P\left(X_{1}=2 \mid X_{0}=1\right) P\left(X_{0}=1\right)$ (by the Markov property) $=P_{31} P_{23} P_{12} P\left(X_{0}=1\right)=(0.8)(0.5)(0.4)(1)=0.16$.
(d) We first compute the two-step transition probability matrix. We obtain
$$\mathbf{P}^{(2)}=\left[\begin{array}{lll} 0.3 & 0.4 & 0.3 \ 0.2 & 0.3 & 0.5 \ 0.8 & 0.1 & 0.1 \end{array}\right]\left[\begin{array}{ccc} 0.3 & 0.4 & 0.3 \ 0.2 & 0.3 & 0.5 \ 0.8 & 0.1 & 0.1 \end{array}\right]=\left[\begin{array}{lll} 0.41 & 0.27 & 0.32 \ 0.52 & 0.22 & 0.26 \ 0.34 & 0.36 & 0.30 \end{array}\right]$$
Now we write
\begin{aligned} &P\left(X_{0}=1, X_{1}=2, X_{3}=3, X_{5}=1\right)=P\left(X_{5}=1 \mid X_{0}=1, X_{1}=2, X_{3}=3\right) P\left(X_{3}=3 \mid X_{0}=1,\right. \ &\left.X_{1}=2\right) P\left(X_{1}=2 \mid X_{0}=1\right) P\left(X_{0}=1\right) \text { (by conditioning) } \ &=P\left(X_{5}=1 \mid X_{3}=3\right) P\left(X_{3}=3 \mid X_{1}=2\right) P\left(X_{1}=2 \mid X_{0}=1\right) P\left(X_{0}=1\right) \text { (by the Markov property) } \ &=P_{31}^{(2)} P_{23}^{(2)} P_{12} P\left(X_{0}=1\right)=(0.34)(0.26)(0.4)(1)=0.03536 . \end{aligned}
EXERCISE 1.2. (a) We plot a diagram of the Markov chain.

###### specifying transition probability matrix

tm<- matrix (c $(1,0,0,0,0,0.5,0,0,0,0.5,0.2,0,0,0,0.8$,
$0,0,1,0,0,0,0,0,1,0)$, nrow=5, ncol=5, byrow=TRUE)

###### transposing transition probability matrix

$t m . t r<-t(t m)$

###### specifying transition probability matrix

tm<- matrix(c(1, 0, 0, $0,0,0.5,0,0,0,0.5,0.2,0,0,0,0.8$,
$0,0,1,0,0,0,0,0,1,0)$, nrow=5, ncol=5, byrow=TRUE)

tm.tr<- t(tm)

###### plotting diagram

library(diagram)
plotmat(tm.tr, arr.length=0.25, arr.width=0.1, box. col= 1 ight blue”,
box.lwd=1, box.prop=0.5, box.size=0.12, box.type=”circle”, cex. txt=0.8,
lwd=1, self.cex=0.3, self. shiftx=0.01, self. shifty=0.09)

###### plotting diagram

library (diagram)
plotmat (tm.tr, arr.length=0.25, arr.width=0.1, box. col=”light blue”,
box. 1 wd=1, box. prop=0.5, box. size=0.12, box.type=”circle”, cex.txt=0.8,
lwd=1, self, cex=0.3, self. shiftx=0.01, self.shifty=0.09)

## 统计代写|随机过程代写stochastic process代考|The R output supports these findings

State 2 is reflective. The chain leaves that state in one step. Therefore, it forms a separate transient class that has an infinite period.

Finally, states 3,4 , and 5 communicate and thus belong to the same class. The chain can return to either state in this class in $3,6,9$, etc. steps, thus the period is equal to 3 . Since there is a positive probability to leave this class, it is transient.
The R output supports these findings.

###### creating Markov chain object

library (markovchain)
mc<- new (“markovchain”, transitionMatrix=tm, states=c(“1”, “2”, “3”, “4”, “5”))

###### computing Markov chain characteristics

recurrentClasses (mC)

###### creating Markov chain object

library(markovchain)
mc<- new (markovchain”, transitionMatrix=tm, states=c(” 1 “, ” 2 “, ” $3^{n}, ” 4$, ” ” $\left.\left.5^{\prime \prime}\right)\right)$
recurrentclasses (mc)
“1”
transientclasses (mc)
“2”
“3” “4” “5”
absorbingStates (mc)
“1”
“1”
transientClasses (mc)
“2”
$” 3^{\prime \prime} ” 4 ” 5^{\prime \prime}$
absorbingstates (mc)
“1”
(c) Below we simulate three trajectories of the chain that start at a randomly chosen state.

## 统计代写|随机过程代写stochastic process代考|The period

(b) States 1 and 2 form a class and it is recurrent. The period is 2 . Once the chain transitions into this class, it never leaves it and will bounce between the two states.

State 3 is reflecting. The chain leaves this state in one step. This state forms a class of its own. It is a transient class and its period is infinite.
States $4,5,6$, and 7 communicate and thus form a class. Its period is one because of the loops. This class is transient because with positive probability the chain can leave this state and transition into the ${1,2}$ class.
From R, we obtain:

###### creating Markov chain object

library (markovchain)
$” 6 “, \quad ” 7 “))$

###### computing Markov chain characteristics

recurrentClasses (mc)
“1” “2”
transientClasses (mc)
“3”
$” 4 ” 5^{\prime \prime} ” 6$ ” “7”
absorbingstates (mc)
character (0)

###### creating irreducible Markov chain objects

tm. ir<- matrix $(c(0,1,1,0)$, nrow=2, ncol=2, byrow=TRUE)
mc. ir<-new (“markovchain”, transitionMatrix=tm. ir, states=c(“1”, “2”))

period (mc. ir)
2
period (mc. ir)
2

## 统计代写|随机过程代写stochastic process代考|For a Markov chain

(a)磷(X3=2∣X0=1,X1=2,X2=3)=磷(X3=2∣X2=3) （由马尔可夫性质）=磷32=0.1.
(二)磷(X4=3∣X0=2,X3=1)=磷(X4=3∣X3=1)（由马尔可夫财产）=磷13=0.3.
（C）磷(X0=1,X1=2,X2=3,X3=1)=磷(X3=1∣X0=1,X1=2,X2=3)磷(X2=3∣X0=1, X1=2)磷(X1=2∣X0=1)磷(X0=1)（通过调节）
=磷(X3=1∣X2=3)磷(X2=3∣X1=2)磷(X1=2∣X0=1)磷(X0=1)（由马尔可夫财产）=磷31磷23磷12磷(X0=1)=(0.8)(0.5)(0.4)(1)=0.16.
(d) 我们首先计算两步转移概率矩阵。我们获得

###### 指定转移概率矩阵

tm<- 矩阵 (c(1,0,0,0,0,0.5,0,0,0,0.5,0.2,0,0,0,0.8,
0,0,1,0,0,0,0,0,1,0), nrow=5, ncol=5, byrow=TRUE)

###### 指定转移概率矩阵

tm<- 矩阵(c(1, 0, 0,0,0,0.5,0,0,0,0.5,0.2,0,0,0,0.8,
0,0,1,0,0,0,0,0,1,0), nrow=5, ncol=5, byrow=TRUE)

tm.tr<- t(tm)

###### 绘图图

plotmat（tm.tr，arr.length=0.25，arr.width=0.1，box.col=1 深蓝色”，
box.lwd=1，box.prop=0.5，box.size=0.12，box .type=”circle”, cex.txt=0.8,
lwd=1, self.cex=0.3, self.shiftx=0.01, self.shifty=0.09)

###### 绘图图

plotmat（tm.tr，arr.length=0.25，arr.width=0.1，box.col=“浅蓝色”，box.1
wd=1，box.prop=0.5，box.size=0.12， box.type=”circle”, cex.txt=0.8,
lwd=1, self, cex=0.3, self.shiftx=0.01, self.shifty=0.09)

## 统计代写|随机过程代写stochastic process代考|The R output supports these findings

R 输出支持这些发现。

###### 创建马尔可夫链对象

mc<- new (“markovchain”, transitionMatrix=tm, states=c(“1”, “2”, “3”, “4”, “5”))

###### 创建马尔可夫链对象

library(markovchain)
mc<- new (markovchain”, transitionMatrix=tm, states=c(” 1 “, ” 2 “, ”3n,”4, ” ” 5′′))

“1”

“2”
“3” “4” “5”

“1”
“1”

“2”
”3′′”4”5′′

“1”
(c) 下面我们模拟了从随机选择的状态开始的链的三个轨迹。

## 统计代写|随机过程代写stochastic process代考|The period

(b) 状态 1 和状态 2 形成一个类并且是经常性的。周期为 2 。一旦链过渡到这个类，它就永远不会离开它，并且会在两个状态之间反弹。

”6“,”7“))

“1” “2”

“3”
”4”5′′”6” “7”

###### 创建不可约马尔可夫链对象

Tm值。ir<- 矩阵(C(0,1,1,0), nrow=2, ncol=2, byrow=TRUE)
mc. ir<-new (“markovchain”, transitionMatrix=tm.ir, states=c(“1”, “2”))

2

2

## 有限元方法代写

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