Bhoumik - Econ 7800 - PS3
Bhoumik - Econ 7800 - PS3
Bhoumik - Econ 7800 - PS3
Econ 7800
Lupa Bhoumik
Analytical
1. A) For a matrix to be a left stochastic matrix, each column must sum to 1. So, for the
given (4x4) matrix;
𝑃! = 0.1
𝑃" = 0.8
𝑃# = 0.3
𝑃$ = 0.3
Will make this matrix a proper left-stochastic transition matrix.
b) The probability that the chain state has state value i at time t + 1 is given by the
Chapman-Kolmogorov equation, that sums over the probability of being in a particular
state at the current step and the transition probability from that state into state i . So, after
t periods the transition matrix will be 𝑝% :
p [t] = 𝑃% p [0]
So, at t = 10 and p [0] = (0, 0.3, 0.6, 0.1) we have, the probability mass function of the
system as,
0.1550387 0.1550375 0.1550166 0.1550480 0 0.1550260
0.2652444 0.2652821 0.2652597 0.2652446 0.3 0.2652649
$ 0𝑥$ 0 = $ 0
0.2864115 0.2863055 0.2864036 0.2863958 0.6 0.2863734
0.2933054 0.2933749 0.2933202 0.2933117 0.1 0.2933357
c) Staionary Distribution:
A Markov chain reaches a stationary distribution with transition matrix P is some vector,
such that p∗ = P. p∗ The above matrix has a stationary distribution where it converges to
(0.1550260, 0.2652649, 0.2863734, 0.293357).
R
1.
n <− 20
k <− 14
nsim <− 10000
theta <− c ( )
s <− c ( )
theta [ 1 ] <− 1 . 5
s [ 1 ] <− 1
for ( i in 2 :Nsim){
the ta [ i ] <− rbeta ( 1 , k+s+1,n−(k+s )+2)
s [ i ] <− rbernoulli ( 1 , theta )
}
We can see from the figure below that the distribution of q converges around 0.68 after the burn-
in period. Again, the 2nd figure shows that the plot dies out very rapidly, which means that
autocorrelation in our sampling is negligible.
c ) The posterior mean and 95% HPD region of q is illustrated in the figure below:
d) Comparing the histogram of theta bias and that of burn, we see some differences, because we
calculated the distribution of bias theta excluding the 𝑥"& , i. e., with n = 19. So, the ratio of k to n
changes. We have also found that mean of biased estimate is 0.715 which is slightly higher than
the mean of the theta distribution, 0.68.
2. a)
Figure 1 below shows that the Traceplot for mu and sigma converges for all the four chains.
Figure 2 again shows that the auto-correlation died out very quickly and stayed low in every
chain for both mu and sigma. The 3rd figure illustrates the Geweke statistics which lies between
-2 to 2. From the plot we can see that all of our values for every chain are in that range as we
wanted. Figure 4 shows the density functions for both of the statistics of mu and sigma, where
the density function for the both are approximately the same for all of the four chains.
Figure 1: Traceplot of 𝜇 and 𝜎