![]() We use the laws of probability to understand the chances of successful outcomes in our uncertain world. Oh wait… nobody understand those….What is the probability of rolling any pair of numbers with two dice? Let’s first solve this and then confirm our calculated probability by simulating 500 dice rolls with a spreadsheet! In this post, we will focus on understanding basic probability concepts and then discover how with spreadsheets, we can actually see whether our calculated probability holds true! And for our friends in social sciences, you can use Monte Carlo simulation for everything from modeling how fast information moves on a social network to teenager trends in high school. In the sciences, the same techniques can be used for natural events. The same concepts can be used to test the likelihood of successfully launching a product or getting a rigorous estimate of how long it will take to generate significant sales. I’ve used Monte Carlo simulation for financial modeling, looking at the likelihood of a company running out of cash. You could have implemented other constraints like the availability of raw materials, orders, or storage space. You could have includes factors such as setup time, downtime / maintenance, and random failures or supply problems. If you can simulate the process in code, you’re in business.įor the industrial example above, we could have incorporated other factors into the model such as operating conditions or worker skill level. The beauty of using Monte Carlo Simulation in R to explore a problem is you’re able to explore very complicated problems with limited statistical effort. Other Applications of Monte Carlo Simulation The next step (in the real world) would be to do some physical trials to ensure everything works as expected. The new piece of equipment sped up packaging, so we’re now limited by the speed of our paper roll winding machine. Well that certainly made a difference! Production per hour is up 1000 units. Running some virtual hours of production, we see this changes the game. Results = rbind(results, ame(rolls, bags, cases, ultraflow, total)) Total = min (rolls, bags + ultraflow, cases + ultraflow) # improved process - Monte Carlo Simulator in R With a couple of small adjustments to the calculations, we can simulate the performance of the redesigned production line…. ![]() Better yet, you can install it next to the bagger, the device that was slowing down your line so that any excess production is goes to this second machine. It’s an Ultraflow wrapper, an early version, which can make shrink wrapped bundles of paper towels. Walking back to your office, you see an older piece of packaging equipment sitting idle. The speed of the overall manufacturing line is limited to the speed of putting the bags onto the rolls. Looking at the three components, the case packer is flying. So after we run the line for 1000 (virtual) hours, we take a peek at the data: >head(results) Results = rbind(results, ame(rolls, bags, cases, total)) We can build this out into a larger vector of results through iteration. Thus our model looks like (with some iterations): # Monte Carlo Simulation in R Example We can generate values from the uniform distribution in R using the runif probability function.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |