Classwork MCMC Fall 2008

  • Unless noted otherwise, each classwork counts ten points.
  • 1. To be completed August 28 (e-mail date):
    Integrate the program pmar.f into your STMC classwork folder. Set iseed2 to your number on the sign-up sheet. Run the program and e-mail your first and eights random number with five digits accuracy to the instructor.
  • 2. To be completed August 30 (e-mail date):
    Download the compressed archive 0830dice.tgz and integrate it into your classwork folder of STMC. Use your seed for the random number generator and make two figures of the probability distribution of a dice, relying on (a) 12 and (b) 12000 events. E-mail pdf files of the two figures to the instructor.
  • 3. To be completed September 4 (e-mail date):
    Download the program pi_v1.f and run it to obtain a MC estimator of pi relying on one million events. Set your seed of the random number generator and record the estimate of pi to six digits. E-mail your estimate and its difference to the analytical pi.
    Modify the program into pi_scatter.f, which covers the full circle and creates a data file of the accepted coordinates (use 10^5 trials). Create the scatter plot with gnuplot and e-mail the pdf file. (This is a preparation for homework 2).
  • September 4 or 6 (no points):
    Download a0106_02a.tgz and integrate it into STMC/Assignments.
  • 4. To be completed September 9 (e-mail date):
    Consider the function G(y)=10**4*exp[y*ln(10**4)], where y is a uniformly distribution random number in [0,1). Calculate mean and median of G(y) analytically.
    Next, use the program mean_med.f to check your analytical result numerically. E-mail both, the analytical and numerical values (only mean and median) together with a plot (pdf) of the peaked cumulative distribution function of the data.
  • September 11 (no points):
    Download 0911polls.tgz , integrate it into your classwork folder and reproduce the results discussed in the lecture.
  • 5. To be completed September 16 (e-mail date):

    5 points: Extend the program pi_v1.f (above) to include and error bar estimate for your mean value relying on steb0.f. E-mail your mean estimate with error bar.

    1 points: Perform the Gaussian difference tests between the estimates 928 (15) and 970 (13) and e-mail the Q (at least two relevant digits).

    1 points: Perform the Gaussian difference tests between the exact pi and your estimate. E-mail the Q (at least two relevant digits).

  • 6. To be completed September 18 (e-mail date):

    1 points: Repeat the above for the Student difference test assuming that each estimates relies on only 2 data points.

    2 points: Error bars are 1:sqrt(2) relying on 10 independent Gaussian events
    per estimate. Is this statistically significant? Answer the same question for estimates relying each on 100 independent events.

    3 points: Perform the Gaussian difference tests for the fish oil study. E-mail the result plus (correct!) interpretation.

  • 7. To be completed September 23 (e-mail date):

    2 points: Download and install a modernized version of STMC: STMC0new.tgz . Compare the bootstrap confidence levels of pi estimates to those obtained by Gaussian error analysis. E-mail your results.

  • 8. To be completed October 2 (e-mail date, 6 points):

    Download and install STMC1new.tgz for the following tasks.

    (a) Assignment a0303_01: Reproduce Figure 3.4 and e-mail the pdf file (1 point).

    (b) Plot the exact energy per spin function for an Ising model n the range 0.01 le beta le 0.8 on a 40x40 lattice using the program ferdinand.f of ForProg/Ferdinand.

    (c) Use the programs of assignment a0303_06 to produce MC data on this lattice at ten beta-values. Use your random number generator seed, start with beta=0.06 and increase beta in increments of 0.06. For each data point include the energy estimate and its error bar into the plot (a).

    (d) Calculate the differences between the analytical results and the data and plot them together with their error bars. E-mail the pdf files of the (b) and (c) plots to the instructor (5 points).

  • 9. To be completed October 7 (e-mail date, 4 points):

    (e) At beta=0.36, 0.42 and 0.48 perform Gaussian difference tests between the energy estimates and the analytical energy values. Make a table with the columns beta, energy estimate (with error bars), analytical energy, Q of the Gaussian difference test, and e-mail the table to the instructor (1 point).

    (f) Use the beta-value of (e) to perform MC runs on a 20x20 lattice. Use Gaussian difference tests to decide, whether finite size effects are visible within the statistical error bars. Extend the table of (e) and e-mail it with your comments to the instructor (3 points).

  • 10. To be completed October 14 (e-mail date, 4 points):
    Integrate the folder a0305_05 into STMC1new and reproduce Fig.3.10 of the (new) handout for homework 5.

  • 11. To be completed October 23 (e-mail):
    Integrate the archive cl11.tgz into STMC (original version).
    Vary the parameter a of the program tau_int.f in the range 0.5 to 20.
    Record for each run your estimate of the integrated autocorrelation time (error bar), ittest, and the acceptance rate of the Metropolis updating.
    Before end of class mail a table to the instructor and:
    Give a value of the parameter a, which is about optimal.
    Describe the relationship between acceptance rate and integrated autocorrelation time. Which acceptance rate is about optimal?
    If time allows, make plots of the the integrated autocorrelation time versus the parameter a, as well as versus the acceptance rate and e-mail them too.
    Solution as a figure .

  • 12. To be completed October 28 (e-mail, 3 points):
    Start the Metropolis generation of Gaussian random number with x=-100 and plot the time series until equilibrium (by visual inspection) is reached. E-mail the plot.

  • 13. To be completed October 30 (e-mail, 2 points):
    Use the program tau_int1.f to caclculate the integrated autocorrelation time for the time series on data.d . Plot with tau_int.plt and comment on the a automatic estimate from the program versus the estimate you would take from the data file of the plot. The program belongs into the new STMC.

  • 14. To be completed October 30 / November 3 (e-mail, 1+9 points):

    Integrate the folder a0402_01.tgz into the new STMC. Change to your seeds. Run the preset Ising simulation on a 5x5 lattice, calculate the integrated autocorrelation time tau_int and e-mail the estimate together with the next classwork.

    Continue as homework with deadline November 3. Extend the calculations to lattices of size 10x10, 20x20, 40x40, 80x80 and 160x160. Mail tau_int estimates with their error bars. On which lattice do you find the largest tau_int? Try to give a physics explanation (2 of the points if correct).

  • 15. To be completed October 30 (e-mail, 4 points):

    Integrate the folder a0402_01b.tgz into the new STMC. Change to your seeds and calculate tau_int as in the previous classwork (1 point). The difference in the code is random versus sequential updating. Which of the two has the smaller tau_int (1 point). Give a heuristic explanation for the difference (1 point). Compare the CPU times needed for the two MCMC production runs (1 point).

  • 17. To be completed November 18:

    E-mail a plot of MUCA data for the entropy of the 2D Ising model on a 20x20 lattice versus the exact Ferdinand-Fisher result (assignments a0501_01 and a0501_03 of the old STMC). (2 points).

  • 18. To be completed November 20:

    E-mail a plot of MUCA data for the entropy of the 2D 10-state Potts model on a 20x20 lattice (assignments a0501_02 and a0501_05 of the old STMC). (2 points).

    Integrate the following archive into your classwork MPIclassdemo.tgz . Compile the program with mpif77 and run with ./runmpi. Answer the following questions:

    1. What does the program do? Explain the printout (2 points).
    2. Double the array size. What happens (1 point)?

    If you succeed to fix the encountered problem before next class you get ten extra point (the fix has to work on the classroom machines). Solution: MPI_OPEN_demo.tgz .

  • 19. To be completed November 25 (last classwork):

    E-mail the CPU times found for equilibration runs with four MPI processes: (A) Using one classroom PC. (B) Using two classroom PCs. (C) Using four classroom PCs. (2 points).

    Record and e-mail the CPU times found for initial parallel tempering runs equilibration runs with eight MPI processes: (A) Using two classroom PCs. (B) Using four classroom PCs. (2 points).



Back to MCMC main page.