程序代写案例-MAS371/MAS6071
时间:2022-03-16
MAS371/MAS6071 Applied Probability 1
MAS371/MAS6071 Applied Probability
Problems
Revision of Poisson processes
1. A critical component on a submarine has an effective lifetime that is exponentially dis-
tributed with mean 24 months. As soon as the component fails it is replaced by a new one
with the same lifetime distribution. Lifetimes of successive components are independent.
What is the smallest number of spare components that the submarine should carry if it is
leaving for a one year voyage (during which it will not be re-supplied) and the aim is to
ensure that the probability of running out of the components is no more than 0.02?
2. Major floods on a stretch of river are believed to occur on average once every five years.
Assume that the floods follow a basic Poisson process.
(a) Find the probability that there are no floods on the stretch of river in the years 2022
to 2031 (inclusive).
(b) Find the probability that there are at least two floods on the stretch of river in 2022.
(c) Find the conditional probability, given that there are exactly two floods between 2022
and 2031 (inclusive), that both occur in the same calendar year. (Assume that all
years have the same length.)
Discrete time Markov chains
3. Give an example of an everyday phenomenon that you would expect not to show the
Markov property. Explain. (More precisely: Give an example of a phenomenon that it
would be reasonable to expect would not be modelled by a Markov process.)
4. The following is a simple model for the spread of a disease. The total population size is
N . Some members of the population are diseased and the others are healthy. Encounters
between people occur between pairs of individuals. The basic time interval is chosen small
enough for there to be a chance p≪ 1 that exactly one pair of individuals encounter each
other in an interval but the probability of more than one encounter is negligible. It is
assumed that an encounter between any one pair of individuals is as likely as between any
other. It is assumed also that when a diseased and a non-diseased individual encounter each
other there is a probability δ that the non-diseased individual will become diseased. Write
down the transition probabilities in a discrete time Markov chain model for the number of
diseased individuals. The state space should be {0, 1, 2, . . . , N}.
5. According to a Markov chain model for the weather at a specific place, if it is fine on a given
day the probabilities of fine weather, rain or snow the following day are 0.6, 0.3 and 0.1.
If it is raining, the probabilities are 0.3, 0.4, 0.3 and if it is snowing they are 0.3, 0.5, 0.2.
Given that it is snowing on Monday, what are the probabilities
(a) that it will be snowing on Wednesday;
(b) that it will both snow on Wednesday and be fine on Thursday;
(c) that it will be fine on at least one of Wednesday and Thursday.
MAS371/MAS6071 Applied Probability 2
What are the long-run relative frequencies of the three types of weather?
After how many days from the Monday on which it was snowing will the weather have
forgotten the fact that it was snowing then (in the sense that the probabilities of the three
types of weather are within, say, 0.001 of each other whatever the weather on the Monday)?
Suggestion: use the nstep or spect functions for the last part.
6. For the random walk on a triangle example in Example 2 of the notes, investigate numer-
ically the convergence of the n-step transition probabilities to their limit distribution for
the cases p = 0.5 and p = 0.05. How quickly is the limit distribution approached? What
are the eigenvalues of the one-step transition matrix in the two cases and how are they
related to the speed of convergence?
The R function spect described in the notes and available on the course webpage is relevant.
The function trirw available also on the course webpage may be used to set up the one-step
transition matrix P . Double click on it to read it into R, then in the Commands Window
type P <- trirw(p), replacing p by the desired number.
Likelihood and inference
7. A random sample of 10 £2 coins contained seven with the motto on the milled edge arranged
anti-clockwise when the clock was face up, and three with it arranged in the other sense.
Plot the log-likelihood for the probability p that a £2 coin has motto anti-clockwise, find
(graphically) a 95% confidence interval for p based on the log relative likelihood statisticW
and compare the interval with that obtained from approximate normality of the maximum
likelihood estimator pˆ, and indicate the interval on your plot. Optionally: carry out some
simulations in R to investigate
8. Suppose observations r1, . . . , rn are modelled as realizations of independent random vari-
ables with a Poisson Po(λ) distribution. Calculate J(λ) and J(λˆ), where λˆ is the maximum
likelihood estimate of λ.
Obtain an approximate 95% confidence interval for λ.
9. Derive the form of a Generalized Likelihood Ratio test to compare the weekly accident
rates in a organization before and after the introduction of a new safety code. Assume that
numbers of accidents each week can be modelled by independent Poisson random variables,
and that data are available for equal numbers of weeks before and after the introduction
of the new code.
Inference for discrete time Markov chains
10. Consider the random walk on a triangle of question 6, with vertices labelled A,B,C and
transition matrix
P = (pij) =
 0 p 1− p1− p 0 p
p 1− p 0
 .
It is believed that a sequence of observations can be modelled by a random walk on a
triangle, but the probability p is not known. Let nAB be the number of transitions observed
from A to B in the sequence, and similarly for the other possible transitions. Working
conditionally on the starting position, derive the maximum likelihood estimate of p based
on counts of observed transitions in the sequence.
MAS371/MAS6071 Applied Probability 3
11. A random number generator was written to produce random numbers from the set {1, 2, 3, 4}.
The transition counts from a sequence of 1000 numbers produced by the generator were
[,1] [,2] [,3] [,4]
[1,] 86 58 72 63
[2,] 63 54 48 62
[3,] 71 45 70 65
[4,] 59 70 61 52
Find an approximate 95% confidence interval for the probability p22 of a transition 2→ 2.
12. Assess the quality of the random number generator in question 11.
13. The transition counts between wet and dry days at Snoqualmie Falls in Decembers 1948–
1983 were:
dry
wet
(
139 140
145 656
)
The counts for Januaries over the same period were
dry
wet
(
186 123
128 643
)
How strong is the evidence that different Markov chain models are needed to represent
January and December?
14. In a paper entitled ‘Are stock returns predictable?’ (J. Finance 1991), G. McQueen and S.
Thorley analysed data on the weekly performance of a value-weighted portfolio of stocks.
They classified each weekly return between April 1975 and December 1987 as high or low
relative to a long-term average. Over the 663 weeks in their data set, 362 weeks were
recorded as high. Pairs of consecutive weeks were classified as:
This Week
Low High
Low 138 163Last Week
High 163 199
Use the data in the table to test the assertion that stocks fluctuate independently from
week to week. Why is this test preferable to a test based on the numbers of pairs in
consecutive non-overlapping weeks?
Continuous time Markov chains
15. Let S be an exponentially-distributed random variable with rate parameter λ. Show that
P (S ∈ (t, t+ h) | S > t) = 1− e−λh = λh+ o(h), (1)
as h→ 0, for any t > 0. If S represents the duration of an activity, interpret property (1)
in terms of the probability that the activity ends at a particular time.
MAS371/MAS6071 Applied Probability 4
16. Elephants are sociable animals who move about in groups. When two groups of elephants
meet they may join together to form a single larger group. From time to time, too, groups
are observed to split. To model the dynamics of grouping, Holgate (Math. Gazette 1967)
considered a population of k elephants and assumed that if at a particular time the pop-
ulation consisted of i groups, i = 2, . . . , k, then in the next short time interval δt there
would be a probability µ(i− 1)δt+ o(δt) that two of the groups would merge, leaving i− 1
groups; and, for i = 1, . . . , k − 1, a probability λ(k − i)δt + o(δt) that one of the groups
would split, giving i+1 groups, where λ and µ are unknown parameters. He assumed that
all other changes had probabilities of smaller order than δt.
If the number of groups in the population is modelled as a continuous-time Markov chain,
write down the form of the chain’s infinitesimal generator matrix G.
17. A homogeneous continuous-time Markov chain on states {1, 2, 3} has generator matrix
G =
−6 5 11 −2 1
4 0 −4

(a) Obtain an expression in terms of t for the transition matrix P (t). (Suggestion: use
the spectral decomposition of G.)
(b) Find the unique stationary distribution of the chain.
18. A drop-in clinic has two doctors who work separately, seeing patients one at a time. A
patient who arrives when both doctors are busy, waits until one becomes free, and a
patient who arrives to find a doctor free is seen immediately. Patients leave the clinic after
being seen by a doctor. In a model for the number of patients in the clinic it is assumed
that there is a probability λδt + o(δt) that a new patient will arrive in each short time
interval (t, t+ δt), and that doctors’ consultation times are independent and exponentially
distributed with mean 1/µ so that a consultation going on at time t comes to an end in
the interval (t, t+ δt) with probability µδt+ o(δt). Let Qt denote the number of patients
in the clinic (those waiting and those currently with a doctor) at time t.
(a) Considering Qt as a birth-death process, what are the arrival rates λn and the depar-
ture rates µn for each n ∈ {0, 1, 2, 3, . . .}?
(b) Letting pn(t) = P (Qt = n), show that, for n ≥ 2,
dpn(t)
dt
= λpn−1(t) + 2µpn+1(t)− (λ+ 2µ)pn(t)
and derive similar differential equations for n = 0 and n = 1.
(c) Show that the equations for a stationary distribution (πn) are
2µπn+1 − (2µ+ λ)πn + λπn−1 = 0 for n ≥ 2,
2µπ2 − (µ+ λ)π1 + λπ0 = 0
and µπ1 = λπ0.
(d) Setting ρ = λ/µ, show that if ρ < 2, there is a stationary distribution satisfying
πn =
ρn
2n−1
π0
for n ≥ 1.
MAS371/MAS6071 Applied Probability 5
19. For the continuous-time Markov chain in question 17, write down
(a) the distribution of the holding time in state 1,
(b) the probability, given that the chain is in state 1, that it will jump next to state 3,
(c) the probability, given that the chain is in state 3, that it will jump next to state 1.
20. How you would estimate the parameters for the clinic model in question 18?
21. For the model for elephant groups in question 16
(a) Write down the mean of the length of time until the next change in number of groups
following an instant when there are i groups. Show also that the probability of this
change being an increase in the number of groups is g+i /gi and the probability of its
being a decrease is g−i /gi, where g
+
i = λ(k − i), g−i = µ(i− 1) and gi = g+i + g−i .
(b) Suppose that during [0, t] the population consist of i groups for a total time ai, i =
1, . . . , k, and that the numbers of transitions from i groups to i+ 1 and i− 1 groups
respectively were n+i and n

i for i = 1, . . . , k (with n
+
k = n

1 = 0). Show that the log
likelihood for λ, µ based on these observations, given the initial number of groups, is
l = −

i
giai +

i
n+i log g
+
i +

i
n−i log g

i .
(c) Deduce that the maximum likelihood estimators of λ and µ are
λ̂ =

i n
+
i∑
i ai(k − i)
, µ̂ =

i n

i∑
i ai(i− 1)
.
(d) Describe briefly (but do not carry out the calculations) how in practice the variances
of these estimates could be estimated.
Patterns of points
22. Let t be a fixed time and let Wt denote the time to the next event after t in an inhomo-
geneous Poisson process with intensity function λ(·). Express the probability that Wt > w
for w > 0 in terms of a probability for the number of events that occur in the interval
(t, t+ w], and hence show that Wt has probability density
fWt(w) = λ(t+ w) exp
{

∫ t+w
t
λ(u)du
}
, w > 0.
Under what condition is this the probability density of an exponential distribution?
23. The arrival of customers at a supermarket in the hour before closing time is modelled by
an inhomogeneous Poisson process with intensity
λ(t) = a+ bt2, 0 ≤ t ≤ t0,
time t = t0 being closing time. Given the number n and times of arrivals vi, i = 1, . . . , n
during [0, t0] on a particular day show that the maximum likelihood estimators of a and b
satisfy
t0 −
n∑
1
1
â+ b̂v2i
= 0
t30
3

n∑
1
v2i
â+ b̂v2i
= 0.
MAS371/MAS6071 Applied Probability 6
(a) Deduce that ât0 + b̂t30/3 = n and hence or otherwise suggest a numerical method for
finding â and b̂.
(b) Given the numerical values of â and b̂ explain how you would use them in conjunction
with the other data to weigh the evidence against an assertion (a) that b = 0, and (b)
that b = 1.
24. Figure 1 shows the end-dates of the 26 eruptive periods of Mount Vesuvius that occurred
in the years 1609–2008.
Figure 1: Mt. Vesuvius, Ends of Eruptive Periods 1609–2008
1650 1700 1750 1800 1850 1900 1950 2000
An inhomogeneous Poisson process model with intensity density λ(t) is considered for the
end-dates.
(a) If the end-dates measured from 1609 are denoted by ti, i = 1, . . . , 26, explain why the
log likelihood function for λ(·) based on these data may be taken to be
l = −
∫ 400
0
λ(u)du+

i
log λ(ti).
(b) If λ(t) = λ0, a constant, for all t, find the maximum likelihood estimator of λ0.
(c) If λ(t) is of the form λ(t) = λ1e−ρt, where λ1 and ρ are positive constants, find
equations satisfied by the maximum likelihood estimators λ̂1 and ρ̂ of λ1 and ρ. Show
that λ̂1 and ρ̂ depend on the ti only through

i ti and the number of eruptive periods,
26.
(d) When the values of λ̂1 and ρ̂ are evaluated numerically and substituted into the log
likelihood, it is found that
l(λ̂1, ρ̂) = −96.0045.
Use this fact and your calculations in (b) to test the hypothesis that the rate of
eruptions has remained constant since 1609, against the alternative that the rate has
been declining exponentially.
25. A Poisson process model has intensity λ(t) = λt, t > 0. If observations over a time interval
[0, t0] were available, explain carefully how you could use them with a time-transformation
to check adequacy of the model.
26. (For a 1-d Poisson process.) If you run a Poisson process backwards, is it still a Poisson
process? Explain your answer.
MAS371/MAS6071 Applied Probability 7
27. Suppose that stars are distributed in space according to a Poisson process of intensity λ.
Let R denote the distance from a fixed star to its nearest neighbour. Show that R has
probability density
fR(r) = 4λπr
2 exp
{−4λπr3
3
}
, r > 0.
28. In the 2-d plane let Cr denote the circle of radius r centred at the origin. For a homogeneous
Poisson process on the plane write down the conditional probability of the event that there
are no points in the annulus Cr \ Cϵ given that there is a point in Cϵ, where r > ϵ. Let
ϵ → 0 and hence derive the probability density function of distance from a point of the
process to its nearest neighbour. Comment on the relation of this distribution to the first
contact distribution for the homogeneous planar Poisson process.

essay、essay代写