Exercises - University of Warwick

Lectures on Coupling (Exercises)
EPSRC/RSS GTP course, September 2005
Wilfrid Kendall
[email protected]
Department of Statistics, University of Warwick
12th–16th September 2005
Exercises
Introduction
The Coupling Zoo
Coupling and Monotonicity
Perfection (CFTP I)
Representation
Perfection (CFTP II)
Approximation using coupling
Perfection (FMMR)
Mixing of Markov chains
Sundry further topics in CFTP
“You are old,” said the youth, “and your programs don’t run,
And there isn’t one language you like;
Yet of useful suggestions for help you have none –
Have you thought about taking a hike?”
“You are old,” said the youth, “and your programs don’t run,
And there isn’t one language you like;
Yet of useful suggestions for help you have none –
Have you thought about taking a hike?”
“Since I never write programs,” his father replied,
“Every language looks equally bad;
Yet the people keep paying to read all my books
And don’t realize that they’ve been had.”
I do hate sums. There is no greater mistake than to
call arithmetic an exact science. There are
permutations and aberrations discernible to minds
entirely noble like mine; subtle variations which
ordinary accountants fail to discover; hidden laws of
number which it requires a mind like mine to perceive.
For instance, if you add a sum from the bottom up,
and then again from the top down, the result is always
different.
— Mrs. La Touche (19th cent.)
“ . . . I told my doctor I got all the exercise I needed
being a pallbearer for all my friends who run and do
exercises!”
— Winston Churchill
Summary
This is the online version of exercises for the
GTP Lectures on Coupling.
These exercises are meant to be suggestive rather than
exhaustive: try to play around with the basic ideas given here!
Any errors are entirely intentional: their correction is part of the
exercise.
Many exercises suggest calculations to be carried out in R ;
with appropriate modifications one could use any one of Splus,
APL or J, Mathematica, or Python . . . .
Introduction
“You are old,” said the youth, “as I mentioned before,
And make errors few people could bear;
You complain about everyone’s English but yours –
Do you really think this is quite fair?”
Introduction
Exercise on Top Card shuffle
Exercise on Riffle Card Shuffle
Exercise on Doeblin coupling (I)
Exercise on Doeblin coupling (II)
Exercise on Doeblin coupling (III)
Introduction
“You are old,” said the youth, “as I mentioned before,
And make errors few people could bear;
You complain about everyone’s English but yours –
Do you really think this is quite fair?”
“I make lots of mistakes,” Father William declared,
“But my stature these days is so great
That no critic can hurt me – I’ve got them all scared,
And to stop me it’s now far too late.”
Introduction
Exercise on Top Card shuffle
Exercise on Riffle Card Shuffle
Exercise on Doeblin coupling (I)
Exercise on Doeblin coupling (II)
Exercise on Doeblin coupling (III)
Exercise 1.1 on Top Card shuffle: I
Show that mean time to equilibrium for the Top Card Shuffle is
order of n log(n).
LECTURE
ANSWER
Exercise 1.2 on Riffle Card Shuffle: I
Use coupling to argue that the “probability of not yet being in
equilibrium” after k riffle shuffles is greater than
1
2
n−1
1 − 1 × 1 − k × 1 − k × ... × 1 −
.
2
2
2k
R
Compare log coupling probability to log(1 − 2−k x) d x to
deduce one needs about 2 log2 n riffle shuffles . . .
Use R to find the median number of riffle shuffles required for a
pack of 52 cards. (Outer products are useful here!)
LECTURE
ANSWER
Exercise 1.3 on Doeblin coupling (I): I
An example of Doeblin’s coupling for Markov chains: consider
the utterly simple chain with transition matrix and equilibrium
distribution
1 1
0.9 0.1
;
π =
P =
2
2 .
0.1 0.9
Use R to compare convergence to equilibrium against coupling
time distribution.
LECTURE
ANSWER
Exercise 1.4 on Doeblin coupling (II): I
Repeat the previous exercise but with a more interesting
Markov chain! Try for example the chain given by symmetric
simple random walk on {1, 2, 3, 4, 5} and (because of
periodicity!) compare walks begun at 1 and 5. Take account of
the barriers at 1, 5 by replacing all transitions 1 → 0 by 1 → 1,
and 5 → 6 by 5 → 5 (these are reflecting boundary conditions
preserving reversibility!).
Since the coupling time distribution is less easy to calculate
explicitly, approximate it by the time taken for the random walk
to move from 1 to 5 (the Doeblin coupling certainly must have
occurred by the time that happens!).
LECTURE
ANSWER
Exercise 1.5 on Doeblin coupling (III): I
Obtain better bounds by analyzing the derived Markov chain
which represents the Doeblin coupling as a new Markov chain
e , keeping track of the states of two coupled copies of the
X, X
random walk. You will need to write an R function which takes
the transition matrix of the original chain and returns the
transition matrix of the Doeblin coupling chain. Then use this
new transition matrix to compute the probability that the Doeblin
coupling chain has hit (and therefore stays in!) the region
e by time t.
X =X
LECTURE
ANSWER
“I don’t think so,” said Rene Descartes. Just then, he
vanished.
Coupling and Monotonicity
There has been an alarming increase in the number of
things we know nothing about.
Coupling and Monotonicity
Exercise on Binomial monotonicity
Exercise on Percolation
Exercise on Epidemic comparison
Exercise on FKG inequality
Exercise on FK representation
Exercise 2.1 on Binomial monotonicity: I
(Elementary!) Consider the following R script, which generates
a Binomial(100,p) random variable X as a function of p, using
100 independent Uniform(0, 1) random variables stored in
randomness. Use R to check
(a) monotonic dependence on p;
(b) correct distribution of X for fixed p.
LECTURE
ANSWER
Exercise 2.2 on Percolation: I
Suppose a rectangular array of nodes (i, j) defines a
rectangular network through which fluid may flow freely, except
that each node nij independently is blocked (nij = 0) with
probability 1 − p (otherwise nij = 1). Consider the percolation
probability of fluid being able to flow from the left-hand side to
the right-hand side of the network.
(a) Show that this probability is an increasing function of p,
(b) and write a R script to simulate the extent of percolation, as
a preliminary to estimation of the dependence of the
percolation probability on the value of p.
LECTURE
ANSWER
Exercise 2.3 on Epidemic comparison: I
Verify that censoring reduces number of eventual removals in
the coupling proof of Whittle’s Theorem.
(The coupling approach can be used to extend Whittle’s
theorem, for example to case where duration of infectious
interval is not exponentially distributed . . . )
LECTURE
ANSWER
Exercise 2.4 on FKG inequality: I
e to prove the FKG inequality,
Use coupled Markov chains Y , Y
by
I
observing that the joint distribution of Y1 , Y2 , . . . , Yn is the
equilibrium distribution of a reversible Markov chain
“switching” values of the Yi independently,
I
and exploiting the way in which conditioning the equilibrium
distribution on a certain set B corresponds to restricting the
Markov chain to lie in B only.
If you examine the proof, you should be able to formulate an
extension to case where the Yi “interact attractively”.
LECTURE
ANSWER
Exercise 2.5 on FK representation: I
Recall the FK random cluster representation of the Ising model.
Consider the conditional distribution of sign Si of site i, given
bond and sign configuration everywhere except at i and v
bonds connecting i to the rest of the graph. Show
P [Si = +1| . . .]
∝
1
(1−p)v −x (1−(1−p)x )+(1−p)v × ×2 ,
2
where x is the number of neighbours of i with spin +1, and
deduce that the construction of the FK-representation at least
has the correct one-point conditional probabilities.
Probability models (on a finite set of “sites”), whose one-point
conditional probabilities agree and are positive, must be equal.
Proof: Gibbs’ sampler for regular Markov chains!
LECTURE
ANSWER
With every passing hour our solar system comes
forty-three thousand miles closer to the globular
cluster M13 in the constellation Hercules, and still
there are some misfits who continue to insist that
there is no such thing as progress.
— Ransom K. Ferm
Representation
Somewhere, something incredible is waiting to be
known.
– Carl Sagan
Representation
Exercise on Lindley equation (I)
Exercise on Lindley equation (II)
Exercise on Loynes’s coupling
Exercise on Strassen’s theorem (I)
Exercise on Strassen’s theorem (II)
Exercise on Strassen’s theorem (III)
Exercise on Small sets
Exercise 3.1 on Lindley equation (I): I
In the notation of Lindley’s equation, suppose Var [ηi ] < ∞.
Show W∞ will be finite only if E [ηi ] < 0 or ηi ≡ 0.
We don’t need Var [ηi ] < ∞ for the above to be true . . .
LECTURE
ANSWER
Exercise 3.2 on Lindley equation (II): I
Use R to check out Lindley’s equation for the case where the ηi
are differences
ηn = Sn − Xn+1 = Uniform(0, 1) − Uniform(0, 1.5): you need to
compare the long-run distribution of the chain
Wn+1 = max{0, Wn + ηn } with the distribution of the supremum
max{0, η1 , η1 + η2 , . . . , η1 + η2 + . . . + ηm , . . .}.
LECTURE
ANSWER
Exercise 3.3 on Loynes’s coupling: I
Use R to carry out Loynes’ construction for a queue with
independent Exponential(3) service times and independent
Uniform(0, 1) inter-arrival times. (Simplify matters by
considering only the times at which services finish; this allows
you to use the waiting time representation employed in the
previous exercise!) Adjust the service and inter-arrival time
parameters to get a good picture.1
Repeat the simulation several times to get a feel for the
construction — and its limitations! Notice that you can never be
sure that you have started far enough back for all subsequent
runs to deliver the same result by time zero!
LECTURE
ANSWER
1
But keep the queue sub-critical:
mean service time should be less than mean inter-arrival time!
Exercise 3.4 on Strassen’s theorem (I): I
Consider two planar probability distributions
(a) P placing probability mass 1/4 on each of (1, 1), (1, −1),
(−1, 1), (−1, −1);
(b) Q placing probability mass 1/5 on each of (1.1, 1),
(1, −1.1), (−1.1, 1), (−1, −1.1) and (100, 100).
Suppose you want to construct a close-coupling of P and Q:
random variables X with distribution P, Y with distribution Q, to
minimize the probability P [|X − Y | > 0.11]. Show how to use
Strassen’s theorem to find out what is the smallest such
probability.
LECTURE
ANSWER
Exercise 3.5 on Strassen’s theorem (II): I
Repeat the above exercise but reversing the rôles of P and Q.
LECTURE
ANSWER
Exercise 3.6 on Strassen’s theorem (III): I
Show that the condition of Strassen’s theorem is symmetric in
P and Q when ε0 = ε, by applying the theorem itself!
LECTURE
ANSWER
Exercise 3.7 on Small sets: I
Work out the details of the procedure at the head of the section
on split chains (compute α, compute the three densities used
for random draws) when P is Uniform(x − 1, x + 1) and Q is
Uniform(−1, +1).
LECTURE
ANSWER
Remember to never split an infinitive.
Approximation using coupling
In Riemann, Hilbert or in Banach space
Let superscripts and subscripts go their ways.
Our asymptotes no longer out of phase,
We shall encounter, counting, face to face.
– Stanislaw Lem, ”Cyberiad”
Approximation using coupling
Exercise on Skorokhod (I)
Exercise on Skorokhod (II)
Exercise on Central Limit Theorem
Exercise on Stein-Chen (I)
Exercise on Stein-Chen (II)
Exercise on Stein-Chen (III)
Exercise on Stein-Chen (IV)
Exercise on Stein-Chen (V)
Exercise 4.1 on Skorokhod (I): I
Employ the method indicated in the section on the Skorokhod
representation to convert the following sequence of
distributions into an almost surely convergent sequence and so
identify the limit:
the nth distribution is a scaled Geometric distribution with
probability mass function
P [Xn = k/n] = e−(k−1)/n 1 − e−1/n for k = 1, 2, . . . .
LECTURE
ANSWER
Exercise 4.2 on Skorokhod (II): I
Using the representation of the previous exercise, show that the
limit distribution of Gn is Gamma(1, r ), where Gn is a scaled
hypergeometric distribution with probability mass function
r
k −(k−r )/n P [Yn = k/n] =
e
1 − e−1/n
r
for k = r , r + 1, . . . .
LECTURE
ANSWER
Exercise 4.3 on Central Limit Theorem: I
In this exercise we see how to represent a zero-mean random
variable X of finite variance as X = B(T ).
1. Begin with the case when X has a two-point distribution,
supported on {−a, b} where −a < 0 < b. Deduce the
probabilities P [X = −a], P [X = b] from E [X ] = 0. Use the
fact that B is a martingale (so that E [BT ] = 0 whenever T
is a stopping time such that B|[0,T ] is bounded) to deduce
BT has the distribution of X if T is the time at which B first
hits {−a, b}.
2. Hence find a randomized stopping time T such that BT is
distributed as X when this distribution is symmetric about
zero.
Exercise 4.3 on Central Limit Theorem: II
3. (Harder: taken from Breiman 1992, §13.3 Problem 2)
Suppose for simplicity X has probability density f .
Compute the joint density of x, y if x is drawn from
distribution of X and y is then drawn from size-biased
distribution of X conditioned to have opposite sign from x:
density proportional to |y|f (y ) if xy < 0.
4. Hence show that BT has the distribution of X if T is the
randomized stopping time at which B first hits {x, y},
where x, y are constructed as above.
LECTURE
ANSWER
Exercise 4.4 on Stein-Chen (I): I
Here are a sequence of exercises to check the details of
Stein-Chen approximation.
Check the formula for g(n + 1) solves the relevant equation.
LECTURE
ANSWER
Exercise 4.5 on Stein-Chen (II): I
Show that
h
i
f =n+1
g(n + 1) × P W
=
h
i h
i
f ∈ A, W
f <n+1 P W
f ≥n+1
P W
n+1
i h
i
f
f ≥n+1 P W
f <n+1
P W ∈ A, W
h
−
n+1
LECTURE
ANSWER
Exercise 4.6 on Stein-Chen (III): I
Use the Stein Estimating Equation to establish
|g(n + 1) − g(n)| ≤
1 − e−λ
λ
for all n
P
In an obvious notation, g(n + 1) = j∈A gj (n + 1).
1. First of all use the results of an earlier exercise to deduce
gj (n + 1) is negative when j ≥ n + 1, otherwise positive.
2. Now show if j < n + 1 then gj (n + 1) is decreasing in n.
3. Hence (apply a previous exercise twice) show
gj (n+1)−gj (n)
≤
gj (j+1)−gj (j)
≤
1 1 − e−λ
min{ ,
}.
j
λ
LECTURE
ANSWER
Exercise 4.7 on Stein-Chen (IV): I
Use Stein-Chen to approximate W =
binary Ii with P [Ii = 1] = pi .
P
i Ii
for independent
LECTURE
ANSWER
Exercise 4.8 on Stein-Chen (V): I
Try out the result of the previous exercise in R using 100
independent binary random variables, half of which have mean
0.01, half of which have mean 0.02. Use simulation to estimate
the difference between (a) the sum of these 100 random
variables being even, and (b) a comparable Poisson random
variable being even.
LECTURE
ANSWER
Mixing of Markov chains
Your analyst has you mixed up with another patient.
Don’t believe a thing he tells you.
Mixing of Markov chains
Exercise on Coupling Inequality
Exercise on Mixing (I)
Exercise on Slice (I)
Exercise on Strong stationary times (I)
Exercise on Strong stationary times (I)
Exercise 5.1 on Coupling Inequality: I
Prove the Coupling Inequality,
disttv (L (Xn ) , π)
≤
max{P Tx,y > n } ,
y
where
disttv (L (Xn ) , π)
=
1 X P [Xn = j] − πj ,
2
j
and π is the equilibrium distribution of the chain X , and Tx,y is
the random time under some coupling at which coupling occurs
for the chains started at x and y .
LECTURE
ANSWER
Exercise 5.2 on Mixing (I): I
Deduce from coupling inequality that mixing in the mixing
example occurs before time n log(n)/2 for large n.
LECTURE
ANSWER
Exercise 5.3 on Slice (I): I
Implement a slice sampler in R for the standard normal density.
LECTURE
ANSWER
Exercise 5.4 on Strong stationary times (I): I
Verify the inductive claim, given number of checked cards,
positions in pack of checked cards, list of values of cards;
the map of checked card to value is uniformly random.
LECTURE
ANSWER
Exercise 5.5 on Strong stationary times (I): I
Verify E [T ] ≈ 2n log n as suggested in the section.
LECTURE
ANSWER
The Coupling Zoo
Did you hear that two rabbits escaped from the zoo and so far
they have only recaptured 116 of them?
The Coupling Zoo
Exercise on The zoo (I)
Exercise on The zoo (II)
Exercise on The zoo (III)
Exercise 6.1 on The zoo (I): I
Define synchronized and reflection couplings (X , Y ) for
reflecting symmetric random walk on {1, 2, 3, 4, 5}. (Suppose X
and Y start from extreme ends of the state-space.) Conduct
simulations in R to compare coupling times.
LECTURE
ANSWER
Exercise 6.2 on The zoo (II): I
The Ornstein coupling can be used to build a non-adapted
coupling for Markov chains, by coupling times of excursions
from a fixed state. Suppose X is an aperiodic Markov chain on
a finite state space which always returns with probability 1 to a
reference state x. Suppose you know how to simulate a
random excursion as follows:
I
draw the time-length N of the excursion;
I
conditional on N = n, draw the excursion X0 = x, X1 = x1 ,
. . . , Xn−1 = xn−1 , Xn = x where none of the xi equal x.
Show how to use Ornstein coupling to couple X begun at x and
Y begun at y 6= x.
LECTURE
ANSWER
Exercise 6.3 on The zoo (III): I
By definition a function f (Xt , t) is space-time harmonic if
f (Xt , t)
=
E [f (Xt+1 , t + 1)|Xt , Xt−1 , . . .] .
Suppose f (Xt , t) is bounded space-time harmonic; by scaling
and adding constants we can assume 0 ≤ f (Xt , t) ≤ 1. By
considering the expectation of f (Xt , t) − f (Yt , t), show that all
couplings X , Y succeed only if all bounded space-time
harmonic functions are constant.
(This is half of the relationship between space-time harmonic
functions and successful couplings. The other half is harder . . . )
LECTURE
ANSWER
“Why be a man when you can be a success?”
— Bertold Brecht
Perfection (CFTP I)
People often find it easier to be a result of the past
than a cause of the future.
Perfection (CFTP I)
Exercise on CFTP (I)
Exercise on CFTP (II)
Exercise on CFTP (III)
Exercise on CFTP (IV)
Exercise on CFTP (V)
Exercise on Falling Leaves
Exercise 7.1 on CFTP (I): I
The following exercises examine the consequences of failing to
follow the details of the CFTP algorithm.
Use R to demonstrate that CFTP applied to the simple
reflecting random walk on {1, 2, 3, 4} (reflection as specified in
the previous exercise 1.4) delivers the correct uniform
distribution on {1, 2, 3, 4}.
LECTURE
ANSWER
Exercise 7.2 on CFTP (II): I
Use R to check that the forwards version of CFTP (continue
forwards in time by adding more blocks of innovations, stop
when you get coalescence!) does not return the equilibrium
distribution for the reflecting random walk of the previous
exercise.
LECTURE
ANSWER
Exercise 7.3 on CFTP (III): I
Use R to check that the failure to re-use randomness where
applicable will mean CFTP does not return a draw from the
equilibrium distribution. (Use the reflecting random walk of the
previous exercises).
LECTURE
ANSWER
Exercise 7.4 on CFTP (IV): I
Modify your R implementation to give true CFTP (extending
innovation run backwards in time if coalescence fails).
LECTURE
ANSWER
Exercise 7.5 on CFTP (V): I
Modify your R implementation to deal with a general aperiodic
irreducible finite state-space Markov chain. The chain should
be specified by a random map. You will have to check
coalescence the hard way, by looking at outputs arising from all
inputs! (So this implementation will be practicable only for small
state space . . . )
LECTURE
ANSWER
Exercise 7.6 on Falling Leaves: I
Consider the falling leaves example of “occlusion-CFTP”. Work
out a (coupling) argument to show that the “forward-time”
algorithm exhibits bias in general.
HINT: suppose that the leaves are of variable size, and the
largest possible leaf (“super-leaf”) can cover the window
completely.
LECTURE
ANSWER
There’s no future in time travel
“I have seen the future and it is just like the present,
only longer.”
— Kehlog Albran, “The Profit”
Perfection (CFTP II)
Exercise on Small set CFTP
Exercise 8.1 on Small set CFTP: I
Suppose we carry out Small-set CFTP using the triangular
kernel p(x, y ) described in the relevant section. Show that the
equilibrium density can be written in the form
Z 1
∞
X
1
−n+1
π(x) =
2
r (n) (u, x)p( , u) d u
2
0
n=0
where r (n) (u, x) is the n-fold convolution integral
Z 1
Z 1
(n)
r (u, x) =
r (u, a1 ) . . .
r (an , y ) d an . . . d a1
0
0
of the “residual kernel” r (x, y) = 2p(x, y) − p(1/2, y).
HINT: show the time till coalescence has a Geometric
distribution!
LECTURE
ANSWER
Perfection (FMMR)
The Modelski Chain Rule:
1. Look intently at the problem for several minutes.
Scratch your head at 20-30 second intervals. Try
solving the problem on your Hewlett-Packard.
2. Failing this, look around at the class. Select a
particularly bright-looking individual.
3. Procure a large chain.
4. Walk over to the selected student and threaten to beat
him severely with the chain unless he gives you the
answer to the problem. Generally, he will. It may also
be a good idea to give him a sound thrashing anyway,
just to show you mean business.
Perfection (FMMR)
Exercise on Siegmund (I)
Exercise on Siegmund (II)
Exercise 9.1 on Siegmund (I): I
Prove the construction of the Siegmund dual Y really does
require Y to be absorbed at 0.
LECTURE
ANSWER
Exercise 9.2 on Siegmund (II): I
Carry out the exercise from lectures: show that the Siegmund
dual of simple symmetric random walk X on the non-negative
integers, reflected at 0, is simple symmetric random walk Y on
the non-negative integers, absorbed at 0.
What happens if the simple random walk X is not symmetric?
LECTURE
ANSWER
Sundry further topics in CFTP
A conclusion is simply the place where someone got
tired of thinking.
Sundry further topics in CFTP
Exercise on Realizable monotonicity
Exercise 10.1 on Realizable monotonicity: I
When designing multishift couplings, be aware that difficulties
can arise which are related to issues of realizable monotonicity
(Fill and Machida 2001). For example (based on Kendall and
Møller 2000, §5.4), suppose a gambler agrees to a complicated
bet: There will be presented some non-empty subset of n
horses, and the gambler must bet on one. However the choice
must be made ahead of time (so for each possible subset
{i1 , . . . , ik } the gambler must commit to a choice irk ). Moreover
the choices must be coupled: if irk is chosen in {i1 , . . . , ik } then
it must be chosen in any sub-subset which contains irk .
It is not possible to do this so that all choices are distributed
uniformly over their respective subsets. Show this to be true for
the case n = 3.
LECTURE
ANSWER
Answers to exercises in Introduction
Answers to exercises in Introduction
Answer to Exercise on Top Card Shuffle
Answer to Exercise on Riffle Card Shuffle
Answer to Exercise on Doeblin coupling (I)
Answer to Exercise on Doeblin coupling (II)
Answer to Exercise on Doeblin coupling (III)
Answer to Exercise 1.1 on Top Card Shuffle: I
LECTURE
Look at successive times T1 , T2 , . . . when a card is placed
below the original bottom card. Time Tk − Tk −1 is Geometric
with success probability k/n, hence E [Tk − Tk−1 ] = n/k . Now
use
n
X
1
≈ log(n) .
k
1
So for n = 52 we expect to need about 205 shuffles.
LECTURE
EXERCISE
Answer to Exercise 1.2 on Riffle Card Shuffle: I
LECTURE
By the coupling argument of the HINT, the effect of k riffle
shuffles is to assign a random binary sequence of length k to
each card. The chance that each card receives a different
binary is the chance of placing n objects in different locations, if
each object is placed independently at random in one of 2k
locations. This gives the result. For
P [“being in equilibrium”]
h
i
≤ P n objects in 2k different locations
≤ P [choose first arbitrarily, second different from first, . . . ]
1
2
n−1
2k
.
= k × 1 − k × 1 − k × ... × 1 −
2
2
2
2k
Notice k > log2 n for a positive lower bound!
Answer to Exercise 1.2 on Riffle Card Shuffle: II
Log coupling probability is approximately
Z
0
n
x log 1 − k d x =
2
2
∼
Z
1
1−n2−k
"
=
k
k
2
1−
log(u) d u
#
n
1
− n2−k
log
1 − 2nk
2k
...
=
−n2 2−k
getting close to 1 as k increases past 2 log2 n. This is a cut-off
phenomenon. See Diaconis (1988, §4D) for (a lot) more on this.
(Sample R code on next page.)
LECTURE
EXERCISE
R code for Exercise 1.2
The R calculation can be carried out as below.
n <- 52
t <- 20
cc <- array((1:n) - 1)
k <- array(1:t)
plot(1-apply(1-(cc %o% (1/(2ˆk))),2,prod))
Answer to Exercise 1.3 on Doeblin coupling (I): I
LECTURE
Convergence to equilibrium is obtained using matrix algebra as
in the following R example. The coupling time distribution is
easy to calculate in this symmetric case: there is a chance 1/2
of immediate coupling, and a chance
1/2 × (0.92 + 0.12 )k−1 × (2 × 0.9 × 0.1) of coupling at time
k > 0. Notice that the coupling time distribution doesn’t match
the convergence rate exactly (most easily seen by taking logs
as in the R example).
(Sample R code on next page.)
LECTURE
EXERCISE
R code for Exercise 1.3
n <- 20
p <- matrix(c(0.9,0.1, 0.1,0.9),2,2)
pp <- matrix(c(1,0, 0,1),2,2)
r <- numeric(n)
for (i in 1:n)
pp <- pp%*%p
r[i] <- pp[1,1]
plot(r-0.5,type="b")
s <- 0.5*((0.9ˆ2+0.1ˆ2)ˆ(0:(n-1)))*(2*0.9*0.1)
s <- 1-cumsum(append(0.5,s))
points(s,pch=19)
plot(-log(r-0.5),type="b")
points(-log(s),pch=19)
Answer to Exercise 1.4 on Doeblin coupling (II): I
LECTURE
Convergence to equilibrium is obtained using matrix algebra;
note that the equilibrium distribution is πi = 0.2 for all i, by
reversibility.
(Sample R code on next pages.)
LECTURE
EXERCISE
R code for Exercise 1.4
n <- 40
p <- matrix(c(0.5,0.5,0,0,0,
0.5,0 ,0.5,0,0,
0, 0.5,0 ,0.5,0,
0, 0, 0.5,0, 0.5,
0, 0, 0, 0.5,0.5),5,5)
pp <- matrix(c(1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0,
0,0,0,1,0, 0,0,0,0,1),5,5)
r <- numeric(n)
for (i in 1:n)
pp <- pp%*%p
r[i] <- pp[1,1]
plot(r-0.2,type="b")
R code for Exercise 1.4 ctd.
Calculate approximation to coupling time distribution by
modifying the transition matrix to stop the chain once it reaches
state 5
p <- matrix(c(0.5,0.5,0,0,0,
0.5,0, 0.5,0, 0,
0, 0.5,0, 0.5,0,
0, 0, 0.5,0, 0.0,
0, 0, 0, 0.5,1.0),5,5)
pp <- matrix(c(1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0,
0,0,0,1,0, 0,0,0,0,1),5,5)
r <- numeric(n+1)
r[1] <- 0
for (i in 1:n)
pp <- pp%*%p
r[i+1] <- pp[1,5]
points(1-r,pch=19)
Answer to Exercise 1.5 on Doeblin coupling (III): I
LECTURE
Exercise in manipulating matrices in R!
LECTURE
EXERCISE
Answers to exercises in Coupling and Monotonicity
Answers to exercises in Coupling and Monotonicity
Answer to Exercise on Binomial monotonicity
Answer to Exercise on Percolation
Answer to Exercise on Epidemic comparison
Answer to Exercise on FKG inequality
Answer to Exercise on FK representation
Answer to Exercise 2.1 on Binomial monotonicity: I
LECTURE
(a) Try plot(sapply(seq(0,1,by=0.05),bin)).
(b) Simple approach: try a QQ-plot (but bear in mind the
implicit normal approximation).
(c) More sophisticated: use a chi-square test.
(Sample R code on next page.)
LECTURE
EXERCISE
R code for Exercise 2.1
randomness <- runif(100)
bin <- function(p)
sum(ceiling(randomness-(1-p)))
p <- 0.4
y <- bin(p)
for (i in 2:1000)
randomness <- runif(100)
y[i] <- bin(p)
qqnorm(y)
qqline(y)
range=min(y):(max(y)-1)
d=table(y)
pmf <- dbinom(range,100,p)/sum(dbinom(range,100,p))
chisq.test(d,p=pmf,simulate.p.value=TRUE,B=2000)
Answer to Exercise 2.2 on Percolation: I
LECTURE
(a) Follows from coupling in the Exercise on Binomial
monotonicity: replace total number of unblocked nodes by
network function f ({nij }), indicating whether fluid can flow from
left to right. If [nij = 1] = [Zij ≤ p] then f (so E [f ]) is increasing
function of nij , thus of p.
(b) The following computes t, the extent of fluid flow. Use this
in a function replacing bin in the Exercise on Binomial
monotonicity above, for (slow) estimation of the required
percolation probability . . .
(Sample R code on next page.)
LECTURE
EXERCISE
R code for Exercise 2.2
free <- matrix(ceiling(randomness-(1-p)),10,10)
t0 <- matrix(0,10,10)
tn <- cbind(1,matrix(0,10,9))
while(!identical(t0,tn))
t0 <- tn
tr <- cbind(1,t0[1:10,1:9])*free
tl <- cbind(t0[1:10,1:9],0)*free
tu <- rbind(0,t0[1:9,1:10])*free
td <- rbind(t0[1:9,1:10],0)*free
tn <- pmax(t0,tl,tr,tu,td)
Answer to Exercise 2.3 on Epidemic comparison: I
LECTURE
Look at times at which individuals get infected:
Hiepi =
time of infection of i in epidemic ,
Hibd
time of infection of i in birth-death process.
=
Result follows if Hiepi ≥ Hibd for all i; true for i = 1, . . . , i0 .
Induction: suppose true for i = 1, . . . , j − 1. Set
epi
Mj−1
(t) =
number directly infected by 1, . . . , j − 1
in epidemic by t
(include original infectives) ,
bd
Mj−1
(t)
=
number directly infected by 1, . . . , j − 1
in birth-death process by t
(include original infectives) .
Answer to Exercise 2.3 on Epidemic comparison: II
epi
bd (t) for all t, since by induction H epi ≥ H bd
(t) ≤ Mj−1
Then Mj−1
i
i
for all i < j and future birth-death infections by such i must
include future epidemic infections for i. Thus at any t the first
j − 1 individuals infect more in birth-death process than in
epidemic. So:
epi
(t) = j} ,
Hjepi = inf{t : Mj−1
bd
Hjbd = inf{t : Mj−1
(t) = j} .
Hence Hjepi ≥ Hjbd .
LECTURE
EXERCISE
Answer to Exercise 2.4 on FKG inequality: I
LECTURE
The Markov chain Y acts independently on each of the yi :
switching (Yi = 0) → (Yi = 1) at rate pi /(1 − pi ), and
(Yi = 1) → (Yi = 0) at rate 1. Use detailed balance to check:
π[Yi = 0] ×
pi
1 − pi
=
π[Yi = 1] × 1 .
In notation of the FKG inequality Theorem, consider a second
e , coupled to Y but constrained to stay in the
Markov chain Y
increasing event B:
e (0) to lie in B but to dominate Y (0)
I initially choose Y
e (0) equal to 1).
componentwise (eg: set all coordinates of Y
I
e evolves by using the same jumps as Y at coordinates yi
Y
where they are equal, so long as the jump does not lead to
e ∈ B;
a violation of the constraint Y
Answer to Exercise 2.4 on FKG inequality: II
I
e dominates Y we subject Y
e to a
at coordinates yi where Y
e
e
transition (Yi = 1) → (Yi = 0) at rate 1 so long as the jump
e ∈ B;
does not lead to a violation of the constraint Y
if B is an increasing event then the above rules never lead
e by Y at any coordinate.
to domination of Y
e stays above Y for all time. Using convergence to
Then Y
e follows from B
equilibrium (NB: regularity of Markov chain Y
I
being increasing!) we deduce
h
i
e ∈A
P [A|B] = lim P Y
≥
t→∞
lim P [Y ∈ A] = P [A] .
t→∞
LECTURE
EXERCISE
Answer to Exercise 2.5 on FK representation: I
LECTURE
We condition on the random graph obtained from the random
cluster model by deleting i and connecting bonds. Then
P [Si = +1| . . .]
=
P [connects to some +1 nbr, doesn’t connect to any −1 nbr| . . .] +
+ P [doesn’t connect to any nbr at all, assigned +1| . . .]
1
∝ (1 − p)v −x (1 − (1 − p)x ) + (1 − p)v × × 2
2
1
v −x
∝ (1 − p)
∝
.
(1 − p)x
Answer to Exercise 2.5 on FK representation: II
Notice (a) not connecting to neighbours will increase
component count by 1, leading to factor 2 which cancels with
probability 1/2 of assigning +1; (b) the factor (1 − p)v is a
constant depending on i, so can be absorbed into constant of
proportionality.
Answer to Exercise 2.5 on FK representation: III
Now compare similar calculation for Ising model:


P [Si = +1| . . .]
1
exp  β
2
∝
=
X
Sj 
j nbr i
1
exp β#(nbrs assigned spin +) − βv
2
.
Hence agreement if 1 − p = e−β .
LECTURE
EXERCISE
Answers to exercises in Representation
Answers to exercises in Representation
Answer to Exercise on Lindley equation (I)
Answer to Exercise on Lindley equation (II)
Answer to Exercise on Loynes’s coupling
Answer to Exercise on Strassen’s theorem (I)
Answer to Exercise on Strassen’s theorem (II)
Answer to Exercise on Strassen’s theorem (III)
Answer to Exercise on Small sets
Answer to Exercise 3.1 on Lindley equation (I): I
LECTURE
Clearly W∞ ≡ 0 if ηi ≡ 0. The strong law of large numbers
(SLLN) states, if E [|ηi |] < ∞ then
η1 + . . . + ηn
→ E [ηi ]
n
almost surely.
So if E [ηi ] < 0 then η1 + . . . + ηn < 0 for all large enough n, so
W∞ is finite. On the other hand if E [ηi ] > 0 then
η1 + . . . + ηn → ∞ and so W∞ is infinite.
Answer to Exercise 3.1 on Lindley equation (I): II
In the critical case E [ηi ] = 0 we can apply the Central Limit
Theorem (CLT): make adroit use of
Z ∞
h
i
1
u2
1/2
P ηm + . . . + ηm+n > n
> (1−ε) √
exp − 2 d u
2σ
2πσ 2 1
(for all large enough n) to show η1 + . . . + ηn takes on arbitrarily
large positive values for large n.
LECTURE
EXERCISE
Answer to Exercise 3.2 on Lindley equation (II): I
LECTURE
First consider empirical distribution of N replicates of
max{0, η1 , η1 + η2 , . . . , η1 + η2 + . . . + ηn } for adequately large n.
Now compare to evolution of Wn+1 = max{0, Wn + ηn }.
(Some experimentation required with values of n, m to get good
enough accuracy to see the fit!)
(Sample R code on next page.)
LECTURE
EXERCISE
R code for Exercise 3.2
N <- 10000
n <- 300
z <- numeric(N+1)
for (i in 1:N)
z[i+1] <- max(0, cumsum(runif(n,0,1)-runif(n,0,1.5)))
plot(density(z))
y <- numeric(N+1)
eta <- runif(N,0,1)-runif(N,0,1.5)
for (i in 1:N)
y[i+1] <- max(0,y[i]+eta[i])
lines(density(y),col=2)
ks.test(z,y)
Answer to Exercise 3.3 on Loynes’s coupling: I
LECTURE
Construct a long run of innovations
(waiting time − interarrival time), and simulate a queue run from
empty at times −T for T = 2, 4, 8, . . . .
(Sample R code on next page.)
LECTURE
EXERCISE
R code for Exercise 3.3
lnN <- 6
N <- 2ˆlnN
eta <- rexp(N,3)-runif(N,0,1)
plot((-1:0), xlim=N*(-1:0), ylim=6*(0:1))
for (c in 1:lnN)
Time <- 2ˆc
y=rep(0,Time+1)
for (t in (2:Time+1))
y[t] <- max(0,y[t-1]+eta[N-Time+t-1])
lines(cbind((-Time:0),y),col=c)
Answer to Exercise 3.4 on Strassen’s theorem (I): I
LECTURE
Strassen’s theorem tells us to compute
sup (P(B) − Q[x : dist(x, B) < 0.11])
B
=
1 1
4×
−
4 5
=
(Use B = {(1, 1), (1, −1), (−1, 1), (−1, −1)}.)
LECTURE
EXERCISE
1
.
5
Answer to Exercise 3.5 on Strassen’s theorem (II): I
LECTURE
Now calculate
sup (Q(B) − P[x : dist(x, B) < 0.11])
B
=
1
.
5
(Use B = {(100, 100)}.)
LECTURE
EXERCISE
Answer to Exercise 3.6 on Strassen’s theorem (III): I
LECTURE
Suppose for all B
P[B]
≤
Q[x : dist(x, B) < ε] + ε .
Then by Strassen’s theorem we know there are X -valued
random variables X , Y with distributions P, Q and such that
P [dist(X , Y ) > ε]
≤
ε.
But this clearly is symmetric in X and Y , so apply Strassen’s
theorem again but exchanging rôles of P and Q to deduce for
all B
Q[B] ≤ P[x : dist(x, B) < ε] + ε .
LECTURE
EXERCISE
Answer to Exercise 3.7 on Small sets: I
LECTURE
By direct computation,
α
=
(
1 − |x|/2
0
when |x| ≤ 2,
otherwise.
The f ∧ g density is undefined if |x| > 2, and is
Uniform(x − 1, 1) if x > 0, otherwise Uniform(1, 1 + x). The
other two densities are
I
Uniform(x − 1, x + 1), Uniform(−1, +1) if |x| > 2,
I
or Uniform(−1, x − 1), Uniform(+1, +1 + x) if 2 > x ≥ 0,
I
or Uniform(x − 1, −1), Uniform(+1 + x, +1) if −2 < x < 0.
LECTURE
EXERCISE
Answers to exercises in Approximation using coupling
Answers to exercises in Approximation using coupling
Answer to Exercise on Skorokhod (I)
Answer to Exercise on Skorokhod (II)
Answer to Exercise on Central Limit Theorem
Answer to Exercise on Stein-Chen (I)
Answer to Exercise on Stein-Chen (II)
Answer to Exercise on Stein-Chen (III)
Answer to Exercise on Stein-Chen (IV)
Answer to Exercise on Stein-Chen (V)
Answer to Exercise 4.1 on Skorokhod (I): I
LECTURE
The
nth
distribution function is
Fn (k/n)
=
P [X ≤ k/n]
=
1 − e−k/n
for k = 0, 1, 2, . . . , with appropriate interpolation.
Thus the Skorokhod representation Fn−1 (U) can be viewed as
follows: discretize 1 − U to values 0, 1/n , 2/n, . . . , 1 − 1/n.
Then take the negative logarithm.
It follows, Xn = Fn−1 (U) → − log(1 − U) almost surely (in fact
surely!) and so the limit is the Exponential distribution of rate 1.
LECTURE
EXERCISE
Answer to Exercise 4.2 on Skorokhod (II): I
LECTURE
Easiest approach is to identify Gn as the sum of r independent
random variables each of distribution Fn . Hence we may
represent Yn = Xn,1 + Xn,2 + . . . + Xn,r , where
Xn,j = Fn−1 (Uj ) → − log(1 − Uj ). Hence Yn converges to the
sum of r independent Exponential random variables of rate 1,
hence the result.
LECTURE
EXERCISE
Answer to Exercise 4.3 on Central Limit Theorem: I
LECTURE
1. Note that E [X ] = −a P [X = −a] + b P [X = b] = 0 and also
P [X = −a] + P [X = b] = 1. Solve and deduce
P [X = −a] =
b
;
a+b
P [X = b] =
a
.
a+b
Exactly the same calculations can be carried out for BT :
E [BT ] = −a P [BT = −a] + b P [BT = b] = 0 and also
P [BT = −a] + P [BT = b] = 1. The result follows.
2. Define T as follows: draw x from the distribution of |X | and
let T be the time at which B first hits {−x, x}. Arguing from
above or directly,
P [BT = |X |]
and the result follows.
=
P [BT = −|X |]
=
1
,
2
Answer to Exercise 4.3 on Central Limit Theorem: II
3. Joint density is proportional to f (x)|y|f (y) over xy < 0.
Computing the normalizing constant by integration, using
Z
0
Z
|y|f (y) d y
−∞
∞
|y |f (y ) d y
=
0
(consequence of E [Y ] = 0), we see joint density is
f (x)|y|f (y)
R∞
.
0 |u|f (u) d u
Answer to Exercise
R 4.3 on Central Limit Theorem: III
4. Setting c −1 =
convenience,
∞
0 |u|f (u) d u,
and taking x > 0 for
P [BT ∈ (a, a + d a)] =
Z
|y|
c
|y |f (y ) d y × f (a) d a+
y<0 |y | + a
Z
|x|
+c
f (x) d x × |a|f (a) d a
|x|
+a
x<0
Z
|y |2 + |y|a
= c
|y|f (y) d y f (a) d a
|y| + a
y<0
=
f (a) d a
as required!
LECTURE
EXERCISE
Answer to Exercise 4.4 on Stein-Chen (I): I
LECTURE
We can prove this by induction. Verify directly that it holds for
g(1). Substitute for g(n):
h
i
f=n
λg(n + 1) P W
=
h
i
h
i h
i
f ∈ A, W
f <n −P W
f∈A P W
f<n
P W
h
i h
i
f∈A P W
f=n
+ I [n ∈ A] − P W
h
i
h
i
f ∈ A, W
f < n + I [n ∈ A] P W
f=n
= P W
h
i h
i
h
i h
i
f∈A P W
f <n −P W
f∈A P W
f=n
−P W
h
i
h
i h
i
f ∈ A, W
f <n+1 −P W
f∈A P W
f <n+1
= P W
Answer to Exercise 4.4 on Stein-Chen (I): II
which leads to the formula as required, if we use
h
i
λ
f=n
P W
n+1
=
h
i
f =n+1
P W
(Poisson probabilities!)
LECTURE
EXERCISE
Answer to Exercise 4.5 on Stein-Chen (II): I
LECTURE
Simply use
h
i
f ∈ A, W
f <n+1
P W
=
h
i h
i
f ∈ A, W
f <n+1 P W
f ≥n+1
P W
h
i h
i
f ∈ A, W
f <n+1 P W
f <n+1 .
+P W
LECTURE
EXERCISE
Answer to Exercise 4.6 on Stein-Chen (III): I
LECTURE
h
i
f = j, W
f < n + 1 = 0 so the
1. If j ≥ n + 1 we have P W
positive part vanishes, conversely if j < n + 1 then the
negative part vanishes.
2. We have
h
i
f ≥n+1
P W
f=j
h
i
gj (n + 1) = P W
f =n+1
(n + 1) P W
h
i 1 2
λ
λ
f=j
= P W
+
+ ... .
1+
n+1
n + 2 (n + 2)(n + 3)
h
i
But this decreases as n increases (compare
term-by-term!).
Answer to Exercise 4.6 on Stein-Chen (III): II
3. First note gj (n + 1) − gj (n) is positive only if n = j. Then
expand:
gj (j + 1) − gj (j)
=
j−1
∞
1 X λr e−λ 1 X λr e−λ
+
λ
r!
j
r!
r =0
r =j+1


j
∞
e−λ  X λr
1 X r λr 
+
λ
r!
j
r!
r =1
r =j+1
1 1 − e−λ
,
.
≤ min
j
λ
=
Answer to Exercise 4.6 on Stein-Chen (III): III
CaseP1: introduce factor r /j ≥ 1 to terms of first summand,
r −λ /r !) = λ;
use ∞
r =0 r (λ e
Case 2: removeP
factor r /j ≤ 1 from terms of second
r −λ /r ! = 1.
summand, use ∞
r =0 λ e
LECTURE
EXERCISE
Answer to Exercise 4.7 on Stein-Chen (IV): I
LECTURE
P
Using the P
notation of of the subsection,
P set Ui = j Ij and
Vj + 1 = ( Pj6=i Ij ) + 1. Notice λ = i pi , while
Var [W ] = i pi (1 − pi ).
P
Clearly Uj ≥ Vj , so the sum
pi E [|Ui − Vi |] collapses giving a
bound
h
i
X
X
f
(pi −pi (1−pi )) =
pi2 .
P
[W
∈
A]
−
P
W
∈
A
≤
i
i
(Sample R code on next page.)
LECTURE
EXERCISE
Answer to Exercise 4.8 on Stein-Chen (V) I
LECTURE
n <- 10000
mean((rbinom(n,50,0.01)+rbinom(n,50,0.02))%%2)
lambda <- 50*0.01+50*0.02
mean(rpois(n,lambda)%%2)
(1-exp(-lambda)/lambda)*(50*0.01ˆ2+50*0.02ˆ2)
LECTURE
EXERCISE
Answers to exercises in Mixing of Markov chains
Answers to exercises in Mixing of Markov chains
Answer to Exercise on Coupling Inequality
Answer to Exercise on Coupling Inequality
Answer to Exercise on Coupling Inequality
Answer to Exercise on Coupling Inequality
Answer to Exercise on Coupling Inequality
Answer to Exercise on Coupling Inequality
Answer to Exercise on Coupling Inequality
Answer to Exercise on Mixing (I)
Answer to Exercise on Slice (I)
Answer to Exercise on Strong stationary times
Answer to Exercise on Strong stationary times
Answer to Exercise 5.1 on Coupling Inequality:
LECTURE
Let
X∗
be the process started in equilibrium.
disttv (L (Xn ) , π)
=
1 X P [Xn = j] − πj 2
=
j
LECTURE
EXERCISE
Answer to Exercise 5.1 on Coupling Inequality:
LECTURE
Let
X∗
be the process started in equilibrium.
disttv (L (Xn ) , π)
1 X P [Xn = j] − πj 2
=
=
j
=
sup{P [Xn ∈ A]−π(A)}
A
(Use
P
j
P [Xn = j] =
P
i
πj = 1 and A = {j : P [Xn = j] > πj }!)
LECTURE
EXERCISE
Answer to Exercise 5.1 on Coupling Inequality:
LECTURE
Let
X∗
be the process started in equilibrium.
disttv (L (Xn ) , π)
1 X P [Xn = j] − πj 2
=
=
j
=
sup{P [Xn ∈ A]−π(A)}
A
(Use
P
j
P [Xn = j] =
=
sup{P [Xn ∈ A]−P [Xn∗ ∈ A]}
A
P
i
πj = 1 and A = {j : P [Xn = j] > πj }!)
LECTURE
EXERCISE
Answer to Exercise 5.1 on Coupling Inequality:
LECTURE
Let
X∗
be the process started in equilibrium.
disttv (L (Xn ) , π)
1 X P [Xn = j] − πj 2
=
=
j
=
sup{P [Xn ∈ A]−π(A)}
A
=
P
j
sup{P [Xn ∈ A]−P [Xn∗ ∈ A]}
A
A, Xn∗
sup{P [Xn ∈
A
(Use
=
P [Xn = j] =
P
i
6= Xn ] − P [Xn 6= Xn∗ , Xn∗ ∈ A]}
πj = 1 and A = {j : P [Xn = j] > πj }!)
LECTURE
EXERCISE
Answer to Exercise 5.1 on Coupling Inequality:
LECTURE
Let
X∗
be the process started in equilibrium.
disttv (L (Xn ) , π)
1 X P [Xn = j] − πj 2
=
=
j
=
sup{P [Xn ∈ A]−π(A)}
A
=
sup{P [Xn ∈
≤
P
j
sup{P [Xn ∈ A]−P [Xn∗ ∈ A]}
A
A, Xn∗
A
(Use
=
6= Xn ] − P [Xn 6= Xn∗ , Xn∗ ∈ A]}
P [Xn∗ 6= Xn ]
P [Xn = j] =
P
i
πj = 1 and A = {j : P [Xn = j] > πj }!)
LECTURE
EXERCISE
Answer to Exercise 5.1 on Coupling Inequality:
LECTURE
Let
X∗
be the process started in equilibrium.
disttv (L (Xn ) , π)
1 X P [Xn = j] − πj 2
=
=
j
=
sup{P [Xn ∈ A]−π(A)}
A
=
=
sup{P [Xn ∈ A]−P [Xn∗ ∈ A]}
A
A, Xn∗
sup{P [Xn ∈
A
≤
P [Xn∗ 6= Xn ]
6= Xn ] − P [Xn 6= Xn∗ , Xn∗ ∈ A]}
X
≤
πy P Tx,y > n
y
(Use
P
j
P [Xn = j] =
P
i
πj = 1 and A = {j : P [Xn = j] > πj }!)
LECTURE
EXERCISE
Answer to Exercise 5.1 on Coupling Inequality:
LECTURE
Let
X∗
be the process started in equilibrium.
disttv (L (Xn ) , π)
1 X P [Xn = j] − πj 2
=
=
j
=
sup{P [Xn ∈ A]−π(A)}
A
=
=
sup{P [Xn ∈ A]−P [Xn∗ ∈ A]}
A
A, Xn∗
sup{P [Xn ∈
A
≤
P [Xn∗ 6= Xn ]
6= Xn ] − P [Xn 6= Xn∗ , Xn∗ ∈ A]}
X
≤
πy P Tx,y > n
y
≤
(Use
P
j
P [Xn = j] =
P
i
max{P Tx,y > n } .
y
πj = 1 and A = {j : P [Xn = j] > πj }!)
LECTURE
EXERCISE
Answer to Exercise 5.2 on Mixing (I): I
LECTURE
Coupling occurs at a random time which is the maximum of n
independent Exponential(2/n) random variable. By the
coupling inequality it suffices to consider
P [max{T1 , . . . , Tn } ≤ t] = (P [T1 ≤ t])n =
1 − e−2t/n
n
.
Answer to Exercise 5.2 on Mixing (I): II
Setting t = n log(αn)/2 we see
1 n
1−
αn
→ exp(−1/α) .
P [max{T1 , . . . , Tn } ≤ n log(αn)/2]
=
So the coupling has to occur around time n log(n)/2, and
mixing must happen before this.
LECTURE
EXERCISE
Answer to Exercise on Slice (I) I
LECTURE
Refer to pseudo-code:
def mcmc_slice_move(x):
y = uniform(0, x)
return uniform(g0(y), g1(y))
LECTURE
EXERCISE
Answer to Exercise 5.4 on Strong stationary times: I
LECTURE
You are referred to (Diaconis 1988, §10.B, Example 4) —
though even here you are expected to do most of the work
yourself!
LECTURE
EXERCISE
Answer to Exercise 5.5 on Strong stationary times: I
LECTURE
We know Tm+1 − Tm is Geometrically distributed with success
probability (n − m)(m + 1)/n2 . So mean of T is
E
" n−1
X
#
(Tm − Tm−1 ) =
m=0
n−1
X
m=0
n2
n+1
1
1
+
n−m m+1
≈ 2n log n .
LECTURE
EXERCISE
Answers to exercises in The Coupling Zoo
Answers to exercises in The Coupling Zoo
Answer to Exercise on The zoo (I)
Answer to Exercise on The zoo (II)
Answer to Exercise on The zoo (III)
Answer to Exercise 6.1 on The zoo (I): I
LECTURE
Suppose initially X = 1, Y = 5. We need only specify the jump
probabilities till X = Y .
The synchronized coupling (X , Y ) is obtained by setting
(X , Y ) → (X + 1, (Y + 1) ∧ 5)
with probability 1/2,
(X , Y ) → ((X − 1) ∨ 1, Y − 1)
with probability 1/2. Coupling occurs when Y hits 1 or X hits 5.
Answer to Exercise 6.1 on The zoo (I): II
The reflection coupling is obtained by setting
(X , Y ) → (X + 1, Y − 1)
with probability 1/2,
(X , Y ) → ((X − 1) ∨ 1, (Y + 1) ∧ 5)
with probability 1/2. Coupling occurs when X = Y = 3. (Notice
that this coupling is susceptible to periodicity problems:
consider what happens if {1, 2, 3, 4, 5} is replaced by
{1, 2, 3, 4}!)
It should be apparent that reflection coupling is faster here!
Check this out by simulation . . . .
LECTURE
EXERCISE
Answer to Exercise 6.2 on The zoo (II): I
LECTURE
First note time ∆ when Y first hits x. Now simultaneously
sample successive excursion times N1 , N2 , . . . for X and M1 ,
M2 , . . . for Y as follows: fix constant k > 0 then
I
Draw Mi ;
I
If Mi > k then set Ni = Mi ;
or use rejection sampling to draw Ni conditional on Ni ≤ k .
P
Study cumulative difference ∆ + i (Ni − Mi ). The Ni − Mi are
symmetric bounded random
variables
P so random walk theory
P
shows eventually ∆ + Ni equals
Mi . At this time
X = Y = x. Eliminate periodicity issues by noting: when k is
large enough there is a positive probability of Ni − Mi = ±1, say.
I
LECTURE
EXERCISE
Answer to Exercise 6.3 on The zoo (III): I
LECTURE
If 0 ≤ f (Xt , t) ≤ 1 is a non-constant bounded space-time
harmonic function then consider a coupling X , Y such that
f (X0 , 0) > f (Y0 , 0). Taking iterated conditional expectations,
E [f (Xt+1 , t + 1)|Xt , Xt−1 , . . .] − E [f (Yt+1 , t + 1)|Yt , Yt−1 , . . .]
=
f (Xt , t) − f (Yt , t)
and so
E [f (Xt+1 , t + 1)]−E [f (Yt+1 , t + 1)]
=
f (X0 , 0)−f (Y0 , 0) > 0 .
If the coupling X and Y meet then they stay together. A simple
expectation inequality shows X and Y may never meet . . . .
LECTURE
EXERCISE
Answers to exercises in Perfection (CFTP I)
Answers to exercises in Perfection (CFTP I)
Answer to Exercise on CFTP (I)
Answer to Exercise on CFTP (II)
Answer to Exercise on CFTP (III)
Answer to Exercise on CFTP (IV)
Answer to Exercise on CFTP (V)
Answer to Exercise on Falling Leaves
Answer to Exercise 7.1 on CFTP (I): I
LECTURE
χ2 -tests
Use, for example,
on the output of many iterations of
the following.
First define the length of the first run of innovations:
Time <- 2**10
This length Time is far more than sufficient to ensure
coalescence will always be achieved (this is a handy way of
avoiding tricky iterations!)
In principle we should extend a CFTP cycle till coalescence is
achieved. For ease of programming, we simply start at time
Time, and return a NA answer if coalescence is not achieved!
(Sample R code on next pages.)
LECTURE
EXERCISE
R code for Exercise 7.1
simulate <- function (innov)
upper <- 4
lower <- 1
for (i in 1:length(innov))
upper <- min(max(upper+innov[i],1),4)
lower <- min(max(lower+innov[i],1),4)
if (upper!=lower) return(NA)
upper
R code for Exercise 7.1 ctd.
Now iterate a number of times (with different innovations in
innov!)2 and carry out statistical tests on the answer data to
detect whether there is departure from the uniform distribution
over {1, 2, 3, 4}.
data <- rep(NA,100)
for (i in 1:length(data))
data[i] <- simulate(2*rbinom(Time,1,1/2)-1)
chisq.test(tabulate(data),p=rep(0.25,4))
2
All this is very clumsy. Could you do better?!
Answer to Exercise 7.2 on CFTP (II): I
LECTURE
Examine the output of many iterations of an appropriate
modification of your answer to the previous exercise. Here is a
recursive form (try it with Time=5 for example!): There should
be a substantial deviation from the equilibrium distribution
(uniform on {1, 2, 3, 4})!
(Sample R code on next page.)
LECTURE
EXERCISE
R code for Exercise 7.2
simulate2 <- function (innov)
upper <- 4
lower <- 1
for (i in 1:length(innov))
upper <- min(max(upper+innov[i],1),4)
lower <- min(max(lower+innov[i],1),4)
if (upper!=lower)
return(simulate2(c(innov,2*rbinom(Time,1,1/2)-1)))
upper
Answer to Exercise 7.3 on CFTP (III): I
LECTURE
χ2 -tests
Use, for example,
on the output of many iterations of
an appropriate modification of your answer to the previous
exercises. Your modification should first try CFTP for an
innovation run of length short enough for the probability of
coalescence to be about 1/2. In the event of coalescence
failure, true CFTP would extend the innovation run back in time.
Your modification should deviate from this by then trying a
completely new longer innovation run.
Answer to Exercise 7.3 on CFTP (III): II
Here is a recursive form (try it with Time=5 for example!). You
should find it informative to examine the output from the short
innovation run and note the kind of bias which would be
obtained by looking only at the cases where coalescence has
occurred. With further thought you should be able to see
intuitively why an extension of the innovation run backwards in
time will correct this bias.
(Sample R code on next page.)
LECTURE
EXERCISE
R code for Exercise 7.3
simulate3 <- function (innov)
upper <- 4
lower <- 1
for (i in 1:length(innov))
upper <- min(max(upper+innov[i],1),4)
lower <- min(max(lower+innov[i],1),4)
if (upper!=lower)
return(simulate3(2*rbinom(2*length(innov),1,1/2)-1))
upper
Answer to Exercise 7.4 on CFTP (IV): I
LECTURE
There is a recursive form on next page (try it with Time=5 for
example!) . . .
(Sample R code on next page.)
LECTURE
EXERCISE
R code for Exercise 7.4
simulate4 <- function (innov)
upper <- 4
lower <- 1
for (i in 1:length(innov))
upper <- min(max(upper+innov[i],1),4)
lower <- min(max(lower+innov[i],1),4)
if (upper!=lower)
return(simulate4((2*rbinom(Time,1,1/2)-1,innov)))
upper
Answer to Exercise 7.5 on CFTP (V): I
LECTURE
This tests your ability to use R to compute with matrices!
LECTURE
EXERCISE
Answer to Exercise 7.6 on Falling Leaves: I
LECTURE
Consider the event A that the final pattern consists of a single
super-leaf covering the whole window.
For a given set of n falling leaves we have three possibilities:
1. The window is not covered;
2. The window is covered, but none of the leaves is a
super-leaf;
3. The window is covered, and at least one leaf is a
super-leaf.
For large n the case 3 is of vanishingly small probability. In
case 2 we know A cannot occur.
Answer to Exercise 7.6 on Falling Leaves: II
In case 3 we know A occurs for CFTP exactly when the first leaf
is a super-leaf. However A will occur in the forward-time variant
not only in this case but also when the window is not
completely covered until a super-leaf falls. Hence
P [A| CFTP]
<
P [A| forward-time variant ] .
A variation on this argument shows that in general the
forward-time variant is more likely than CFTP (and hence
equilibrium) to cover a patch of the window by a single leaf –
strictly more likely to do so whenever the patch can be so
covered.
LECTURE
EXERCISE
Answers to exercises in Perfection (CFTP II)
Answers to exercises in Perfection (CFTP II)
Answer to Exercise on Small set CFTP
Answer to Exercise 8.1 on Small set CFTP: I
LECTURE
At each time-step there is a chance 1/2 of being captured by
the small set. So the CFTP construction shows the density π(x)
results from going back N time steps to the most recent
coalescence (where P [N = n] = 2−n+1 for n = 0, 1 . . . ),
drawing from p(1/2, ·), then running forwards to time 0 using
the residual kernel, which is the kernel conditioned on not
coalescing:
r (x, y )
=
p(x, y) − p(1/2, y)/2
= 2p(x, y ) − p(1/2, y ) .
1 − 1/2
LECTURE
EXERCISE
Answers to exercises in Perfection (FMMR)
Answers to exercises in Perfection (FMMR)
Answer to Exercise on Siegmund (I)
Answer to Exercise on Siegmund (II)
Answer to Exercise 9.1 on Siegmund (I): I
LECTURE
Take y = 0 in
P [Xt ≥ y |X0 = x]
=
P [Yt ≤ x|Y0 = y ]
and note that the left-hand side is then equal to 1. Set x = 0 to
get the absorption result P [Yt ≤ 0|Y0 = 0] = 1.
LECTURE
EXERCISE
Answer to Exercise 9.2 on Siegmund (II): I
LECTURE
Work with
P [Xt ≥ y |X0 = x]
P [Yt ≤ x|Y0 = y ] .
=
I
Take y = x + 2 to deduce P [Yt ≤ x|Y0 = x + 2] = 0, so Y
cannot jump by less than −1.
I
Similarly take y = x − 2, y = x − 1 to deduce
P [Yt ≤ x|Y0 = x − 2]
=
P [Yt ≤ x|Y0 = x − 1] ,
so Y cannot jump by more than +1.
Answer to Exercise 9.2 on Siegmund (II): II
I
Similarly deduce
P [Yt = x|Y0 = x + 1]
=
P [Xt ≥ x + 1|X0 = x]−P [Xt ≥ x + 1|X0 = x − 1]
=
1
2
=
0
as long as x ≥ 0.
I
Similarly deduce
P [Yt = x + 1|Y0 = x + 1]
=
P [Xt ≥ x + 1|X0 = x + 1]−P [Xt ≥ x + 1|X0 = x]
as long as x ≥ 0.
This is sufficient to identify Y as required.
LECTURE
EXERCISE
Answers to exercises in sundry further topics in CFTP
Answers to exercises in sundry further topics in CFTP
Answer to Exercise on Realizable monotonicity
Answer to Exercise 10.1 on Realizable monotonicity: I
LECTURE
Consider horses 1, 2, 3. Horse 1 is to be chosen in {1, 2, 3}
with probability 1/3, in {1, 2} with probability 1/2, in {1, 3} with
probability 1/2, and in {1} with probability 1.
The coupling must specify
1. the choice i from {1, 2, 3},
2. the choice j 6= i to be made from the subset {1, 2, 3} \ {i}.
Answer to Exercise 10.1 on Realizable monotonicity: II
Each distinct ordered pair (i, j) has probability pij . We require
1
,
3
1
.
2
pij + pik =
pij + pik + pji + pki =
But then pji + pki = 1/6. This would lead to
2×(p12 +p13 +p21 +p23 +p31 +p32 )
=
1 1 1
1 1 1
3
+ + + + + =
3 3 3
6 6 6
2
contradicting
p12 + p13 + p21 + p23 + p31 + p32
=
1.
LECTURE
EXERCISE
“You are old, Father William,” the young man said,
“All your papers these days look the same;
Those William’s would be better unread –
Do these facts never fill you with shame?”
“You are old, Father William,” the young man said,
“All your papers these days look the same;
Those William’s would be better unread –
Do these facts never fill you with shame?”
“In my youth,” Father William replied to his son,
“I wrote wonderful papers galore;
But the great reputation I found that I’d won,
Made it pointless to think any more.”
“You are old, Father William,” the young man said,
“All your papers these days look the same;
Those William’s would be better unread –
Do these facts never fill you with shame?”
“In my youth,” Father William replied to his son,
“I wrote wonderful papers galore;
But the great reputation I found that I’d won,
Made it pointless to think any more.”
“You are old,” said the youth, “and I’m told by my peers
That your lectures bore people to death.
Yet you talk at one hundred conventions per year –
Don’t you think that you should save your breath?”
“You are old, Father William,” the young man said,
“All your papers these days look the same;
Those William’s would be better unread –
Do these facts never fill you with shame?”
“In my youth,” Father William replied to his son,
“I wrote wonderful papers galore;
But the great reputation I found that I’d won,
Made it pointless to think any more.”
“You are old,” said the youth, “and I’m told by my peers
That your lectures bore people to death.
Yet you talk at one hundred conventions per year –
Don’t you think that you should save your breath?”
“I have answered three questions and that is enough,”
Said his father, “Don’t give yourself airs!
Do you think I can listen all day to such stuff?
Be off, or I’ll kick you downstairs!”
Bibliography
This is a rich hypertext bibliography. Journals are linked to their homepages, and stable
URL links (as provided for example by JSTOR
or Project Euclid
) have been
added where known. Access to such URLs is not universal: in case of difficulty you
should check whether you are registered (directly or indirectly) with the relevant
linking to homepage locations are
provider. In the case of preprints, icons , , ,
inserted where available: note that these are probably less stable than journal links!.
Breiman, L. (1992).
Probability, Volume 7 of Classics in Applied Mathematics.
Philadelphia, PA: Society for Industrial and Applied Mathematics (SIAM).
Corrected reprint of the 1968 original.
Diaconis, P. (1988).
Group Representations in Probability and Statistics, Volume 11 of IMS Lecture
Notes Series.
Hayward, California: Institute of Mathematical Statistics.
Fill, J. A. and M. Machida (2001).
Stochastic monotonicity and realizable monotonicity.
The Annals of Probability 29(2), 938–978,
.
Kendall, W. S. and J. Møller (2000, September).
Perfect simulation using dominating processes on ordered state spaces, with
application to locally stable point processes.
Advances in Applied Probability 32(3), 844–865,
; Also University of Warwick
Department of Statistics Research Report 347 .