examples.pdf - Some Examples of(Markov Chain Monte Carlo Methods Ryan R Rosario What is a Monte Carlo method Monte Carlo methods rely on repeated

# examples.pdf - Some Examples of(Markov Chain Monte Carlo...

• 10

This preview shows page 1 - 3 out of 10 pages.

Some Examples of (Markov Chain) Monte Carlo Methods Ryan R. Rosario What is a Monte Carlo method? Monte Carlo methods rely on repeated sampling to get some computational result. Monte Carlo methods originated in Physics, but no Physics knowledge is required to learn Monte Carlo methods! The name “Monte Carlo” was the codename applied to some computational methods developed at the Los Alamos Lab while working on nuclear weapons. Yes, the motivation of the codename was the city in Monaco, but does not come directly from gambling. Monte Carlo methods all follow a similar pattern: 1. Define some domain of inputs. This just means we have some set of variables and what values they can take on, or we have some observations that are part of a dataset. 2. Generate inputs (the values of the variables, or sets of observations) randomly, governed by some probability distribution. 3. Perform some computation on these inputs. 4. Repeat 2 and 3 over and over either an infinite number of times (a very large number of times usually 10000), or until convergence. 5. Aggregate the results from the previous step into some final computation. The result is an approximation to some true but unknown quantity, which is no big deal since that is all we ever do in Statistics! A Motivating Example with Code: The Bootstrap Suppose we have a small sample and we want to predict y using x . If we fit a standard linear regression model, we may not be able to trust the parameter estimates, and particularly that standard error of these estimates (SE( ˆ β 1 )). To estimate the standard error, we can use the bootstrap. Step 1 from the little algorithm above is already done for us. The domain of inputs is just the observations in the sample. 2. Draw a random sample (with replacement) of size n from the data. This is called a bootstrap sample . (generate inputs) 3. Fit a linear regression model and get the value of ˆ β 1 from it. Store this value, as we will need it. (do something) 4. Repeat steps 1 and 2, say 10,000 times (like with any good shampoo, repeat). 5. Once we have finished the 10,000th iteration, we have a nice collection of ˆ β 1 s, a sampling distribution . Recall from Stats 10 that the standard deviation of a sampling distribution is called the standard error . Thus, if we take the standard deviation of our collection of ˆ β 1 s, we can approximate the standard error of ˆ β 1 . (aggregate) 1 Subscribe to view the full document.

Again, this is just an example. If you are not familiar with the bootstrap, it’s not a problem. It’s a pretty cool method though, so you may want to take a look at... In this class we will be programming in R. There are a couple of things from your PIC 10A class we will use. Of course, in R land, not C++ land. These Monte Carlo methods rely on repeatedly drawing samples. So we need a loop. There are a few different kinds of loops. Let’s look at two that you will need for this class.  • Spring '14
• Wu,Y

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern