Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MAST30001 Assignment 2 - Part 1

Due 11.59pm, Wednesday, October 18

❼ Question 1 of Assignment 2 appears below.  The due date for the Assignment is Wednesday October 18. There will be additional questions, which I will publish in the first week after the mid-semester break.  I am distributing this question early because it requires you to write a short computer program.

❼ All the theoretical knowledge that you need to complete the question has already been covered in lectures.  My strong advice is that you start work on this question early.  We won’t be impressed by requests for extensions based upon the fact that something slowed you down in the last week before the due date.

❼ I don’t mind which computer language you use.   My advice is that you use whichever language you are most comfortable with.  In case it helps, I have posted the Matlab Guide on the Assignments page.

❼ Submit your answers to this question as a separate pdf file from Part 2.  Please include your code and your three histograms in your pdf, scan your file using your mobile phone (we recommend CamScanner App), and then upload it via Gradescope.

❼ The  strict submission deadline is  11.59pm Melbourne time on Wednesday October  18. Late assignments will NOT be accepted.  We recommend you submit at least a day before the due date to avoid any technical delays.   If  there  are  extenuating,  (e.g.    medical) circumstances, please contact the Tutor-in-Charge, A/Prof Sophie Hautphenne.

Question 1 [25 Marks]

In Lectures  (slides 235 and 236), we discussed the Curie-Weiss Model.  In this question you will code a Random Sweep Gibbs Sampler (see slide 233) to sample from the distribution given on slide 235.  Given that the state is x and that we have chosen to update coordinate i, the transition probabilities are as written on slide 236 in the current version of the lecture notes. That is

r(Xi(n + 1) = 1|X(n) = x)   =   1 − r(Xi(n + 1) = −1|X(n) = x)

ixj

=

.

2

(1)

There was a slight mistake in this formula in the lecture that I gave on September 11. It had

r(Xi(n + 1) = 1|X(n) = x)   =   1 − r(Xi(n + 1) = −1|X(n) = x)

ixj

=

.

2

(2)

Please use (1) in this assignment.

(a)  For N = 10, and β equal to each of 0.2, 0.5 and 0.8, simulate 1 million steps of a discrete time Markov chain X(n) with transition probabilities given by (1) and, for each state x, plot the number of time steps that X(n) = x on a histogram.

(b)  Hand up your computer code and three histograms, one for each value of β .

(c)  Comment on what you observe from the histograms.

Comments:

(a)  My Matlab code that does this is only 22 lines long.

(b)  The states x are the vectors of 1s and 1s of length 10.  There are 1024 of them.

(c)  The transition probabilities (1) depend on the full state description.

(d) A way to simulate a Bernouilli random variable V with probability p of being equal to one and probability (1 − p) of being equal to zero, is to generate a continuous uniform random variable U on (0, 1) and put V = 1 if U ≤ p and V = 0 otherwise.

(e) In order to present your results on a histogram, you will need to work out a way of associating an integer with each state.