ST2195 In this part, you are asked to work with the Markov Chain Monte Carlo algorithm: Coursework Project Assignment, NTU, Singapore

Updated: 6 Feb 2024 Free Assignment Question
Table of Contents

    Need a Custom-Written Answer for This Question?

    Our Singapore-based academic experts write 100% original, Turnitin + Originality.ai checked answers — delivered within your deadline.

    Request Plagiarism-Free Answer

    🔒 100% confidential · No data stored

    Get a 100% Human-Written Answer (AI-Free) Free quote in 10 minutes · 100% confidential
      University Nanyang Technological University (NTU)
      Subject ST2195 Programming for data science

      Part 1
      In this part, you are asked to work with the Markov Chain Monte Carlo algorithm, in particular the Metropolis-Hastings algorithm. The aim is to simulate random numbers for the distribution with the probability density function given below
      ST2195 In this part, you are asked to work with the Markov Chain Monte Carlo algorithm: Coursework Project Assignment, NTU

      Hire a Professional Essay & Assignment Writer for completing your Academic Assessments

      Native Singapore Writers Team

      • 100% Plagiarism-Free Essay
      • Highest Satisfaction Rate
      • Free Revision
      • On-Time Delivery

      where x takes values in the real line and |x| denotes the absolute value of x. More specifically, you are asked to generate x0, x1, . . . , xN values and store them using the following version of the Metropolis-Hastings algorithm (also known as random walk Metropolis) that consists of the steps below: Random walk Metropolis

      Step 1 Set up an initial value x0 as well as a positive integer N and a positive real number s.
      Step 2 Repeat the following procedure for i = 1, . . . , N:
      • Simulate a random number x∗ from the Normal distribution with mean xi−1 and standard deviation s.
      • Compute the ratio
      ST2195 In this part, you are asked to work with the Markov Chain Monte Carlo algorithm: Coursework Project Assignment, NTU

      • Generate a random number u from the uniform distribution between 0 and 1.
      • If u < r (x∗, xi−1), set xi = x∗, else set xi = xi−1.
      (a) Apply the random walk Metropolis algorithm using N = 10000 and s = 1. Use the generated samples (x1, . . . xN ) to construct a histogram and a kernel density plot in the same figure. Note that these provide estimates of f(x).Overlay a graph of f(x) on this figure to visualise the quality of these estimates. Also, report the sample mean and standard deviation of the generated samples (Note: these are also known as the Monte Carlo estimates of the mean and standard deviation respectively).

      Practical tip: To avoid numerical errors, it is better to use the equivalent criterion log u < log r (x∗, xi−1) = log f (x∗) − log f (xi−1) instead of u < r (x∗, xi−1).

      Stuck with a lot of homework assignments and feeling stressed ? Take professional academic assistance & Get 100% Plagiarism free papers

      Get Help By Expert

      Excel in your NTU coursework with our expert support. From top-notch assignment writing service to dedicated Coursework Writing Services in Singapore, we assist you in projects like ST2195 Programming for Data Science. Pay for personalized guidance and navigate academic challenges with confidence, achieving excellence in your coursework.

      Do you need a fresh written answer for this question?

      100% human-written, Turnitin + Originality.ai checked — delivered before your deadline.

      Request Answer →

      Author Bio

      Laura Tan
      Laura Tan

      I am an academic writer since 2003 and associated with Singapore Assignment Help. I have expertise in making dissertation proposal. Till now i helped more than 2000 Singaporean and Malaysian Students in completing their masters dissertations thesis and other academic papers.

      It's your first order?

      Use discount code SAH15 and get 15% off

      Need this question answered?