Hi, I'm Sergei Savon and I would like to welcome you to week 4 of our course on Modeling Risk and Realities. Continues for building distributions like normal distribution or uniform distribution over a convenient way of summarizing historical data and describing uncertainty of future outcomes. At the same time, using continuous distributions may make it difficult to employ optimization toolkit for identifying the best decision. In Week 4, we'll look at simulation as a way of enabling comparison between different alternatives in settings where uncertainty is described using continuous distributions. The focus for our discussions this week will be the simulation toolkit. In Session 1, we will talk about making decisions in high uncertainty settings where random inputs are described by continuous probability distributions. We'll use an example of a company that needs to design its new apartment building in the face of the uncertain demand for different types of apartments. In Session 2, we'll setup and run a simulation model that generates a distribution of profit values associated with a particular design of the apartment building. In Session 3, we will analyze simulation output and discuss how we can use it to compare alternative decisions. Just a reminder, when we looked at the decision making and uncertainty in Week 2, we have used the scenario approach to modelling random variables. Under the scenario approach, we have used a number of potential realizations of the random variable with the probability attached to each realization. For example, we have used 20 equally likely scenarios, to describe a daily return on the stock price. One of the attractive features of this approach to modeling random variables is that it is easy under the scenario approach to calculate precise values of various parameters that decision makers care about. Such as the expected value we used as the reward measure or the standard deviation, we used as a measure of risk. Or probability of a loss, or in general of a substandard return quantities that can also be used as risk measures. The ability to calculate the exact values for the reward and risk measures enables us to search for the course of action, that for example, maximizes reward while keeping the risk measures at the acceptable levels. The key feature here is that the number of scenarios considered is finite and often rather small. But what do we do if the number of potential values that are random variable modeling can take is infinite? Such as when the random variable has a continuous distribution, normal, uniform etcetera. How do we calculate various performance measures, such as measures of reward and risk, if the number of scenarios we have to account for is infinite? Simulation is the approach that can be used in such cases. Simulation works as follows. We can use Excel to generate instances of random variables coming from a number of continuous distributions, like normal distribution. One instance, two instances, a thousand of instances if necessary. If we use these instances as scenarios, we can generate estimates for the risk and reward measures associated with any course of action. For example, the value of the average profit calculated using a finite number of scenarios generated from a continuous distribution will, of course, be an approximation and the estimate of the true expected profit. Because that true value can be obtained only if we use infinite number of scenarios covering the entire continuous distribution. But the largest of the scenarios we use, the closer we should expect the estimate to be to the true expected value. Okay. With this in mind, let's look at an example. We're looking at the case of a real estate development company that is planning a new building. There will be two kind of apartments in this building and 15 floors. The way the company plans to build is to allocate each of the floors to one kind of apartment. Either regular or luxury. A regular floor will have 8 apartments and a luxury floor, 4. The ultimate question is how many floors of each kind to build. The company plans to sell apartments over the period of the next year. Apartments will be priced competitively and the company estimates that the price that it plans to charge, the profit he will earn for a regular apartment sold during the next year will be $500,000. And the profit it will earn for their luxury apartment, sold during the next year, will be $900,000. On the other hand, while the company can control the price that it charges for the apartments, it cannot really control the demand for the apartments. In particular, it is possible that it may not be able to sell all of the apartments over the next year. At that point, the company will sell all of the remaining apartments to a real estate investor at the much reduced profits. In particular, if there are regular apartments left, they will be disposed of at a profit of $100,00 each. And if there are luxury apartments left, they will be sold at the profit of $150,000 each. Based on the analysis of historical trends and expert estimates, Stargrove believes that the demand for the regular apartments can be modeled as a normally distributed random variable with mean of 90 and a standard deviation of 25. In other words, it expects to have 90 buyers for regular apartments, but also thinks that the actual number of buyers they will see next year, can be quite far away from that expectation. As for the demand for luxury apartments, the company will model it using a normal random variable with a mean of 10 and a standard deviation of 3. In other words, it expects 10 buyers but it also projects that the actual number of buyers can be quite uncertain. The two kinds of demand, I assume to be independent random variables. This in particular means, that the correlation between random demands for regular and luxury apartments is 0. Now, there are a couple of caveats to use in a normal distribution to model non negative integer demand values. The instances of normal random variable can take fractional as well as negative values and we need to be a bit careful with those normal random values if we were to use them to model the demand. We will look at this issue again when we set up our simulation. The company assumes that if it runs out of the apartments to sell, of either kind, the extra customers will be lost to competition. The company also thinks that its regular and luxury customers are two very distinct groups. In particular, Stargrove thinks that there will be no switching of regular customers to luxury apartments or of the luxury customers to regular apartments. The regular customers will not be able to afford a luxury apartment and luxury customers will not settle for a regular apartment. This assumptions will help Stargrove to calculate how many apartments of each kind it will sell during the next year for any combination of the demand and the number of apartments it decides to build. It will also help the company to calculate the number of apartments, if any, it will have to sell to the real estate investor at the reduced profit. For regular apartments, if Stargrove builds R of them, and the demand for the regular apartments turns out to be DR, it can calculate both the numbers of apartments sold at the high profit of $500,000 and at the low profit of $100,000. For the high profit sales, Stargrove cannot sell more than what it builds, R. And they cannot sell more than what's demanded, that's DR. So, it will sell the minimum of the two numbers. For example, if Stargrove builds 96 regular apartments, that's 12 regular floors with 8 apartments on each floor, and the number of buyers of regular apartments turns out to be 90. The number of high profit sales the company will make is minimum of (96, 90) = 90. If on the other hand, the company builds 96 regular apartments and the number of potential buyers turns out to be 100, Stargrove will manage to sell 96, which is the minimum of 96 and 100. The number of the regular apartments that the company will have to sell at the low profit value, is the difference between what it builds R and what it sells at the high profit value, which is the minimum of (R, Dr). For example, if the company builds 96 regular apartments and the demand for regular apartments is 90, then the company will have to sell 96- 90, 6 apartments to the real estate investor at low profit. On the other hand, if it builds 96 regular apartments and the demand for those apartments turns out to be 100, it will sell all 96 apartments at the high profit and will not have to resort to low profit sales. The corresponding calculation for the luxury apartments is similar. In particular the number of the apartment sold at the high profit of $900,000 is determined by the minimum of the number of apartments the company builds, L, and the demand for those apartments, DL. Also, the number of luxury apartments that have to be sold at the low profit of $150,000 is the difference between the number of apartments the company builds and the number of apartments it sells at high profit, which is the minimum of L and DL. In order to see how to use simulation to make the best decisions, we will first look at how simulation can be used to evaluate a particular decision. Suppose that Stargrove decides to build 12 regular floors and 3 luxury floors, so it will have 96 regular apartments, and 12 luxury apartments. The company is interested in figuring out the profitability of this decision. Given that the demand for each apartment type is random, company's profit pi will also be random. So, let's select the expected profit as a reward that the company would like to maximize, and the probability that the actual profit falls below $45 million as a measure of risk. As you can see, we have decided to use in our analysis not a standard deviation of profits, but a different risk measure. In other words, we're considering a situation where a company does not really worry about the standard deviation of its profits, but rather has a profitability goal it wants to meet, and it wants to make sure that a chance that it will miss this goal is not too high. Let's talk a little bit about the terminology associated with simulations. As I mentioned, in our example, the company profits depend on two random variables that represent the demands for regular and luxury apartments at the price levels that the company sets. Because those demands are random, the company's profits can also be random. In algebraic terms, the profit as a function of these two random demands can be expressed as follows. Pi = $500,000 times the minimum of (DR,R) + $900,000 times minimum (DL,L) + $100,000 times the remaining of regular apartments + $150,000 times the remaining luxury apartments. In this expression, we have four terms, two terms for each kind of demand. The first two terms express the profits Stargrove gets from high profit sales. $500,000 for each regular apartment it sells during the next year and $900,000 for each luxury apartment it sells during the next year. The third and fourth terms express the low profit sales to the real estate investor. The random variables for the demand values for DR and DL, are called random inputs into a simulation. They represent the factors that the decision maker does not fully control. The random profit value is called random output of a simulation. It represents the random quantity that a decision maker is interested in. The simulation is based on generating instances of the random inputs and calculating the corresponding instances of their random outputs. In other words, simulation is a mechanism that uses the probability distribution of the random inputs to approximate the probability distribution of the random output. So, if we have an algebraic formula that expresses the random output pi as the function of random inputs DR and DL, the task of the simulation is to figure out what the distribution of pi is in particular. We want to use simulation to figure out what is the reward, the expected value of pi, and risk, the probability that pi falls below a threshold associated with a particular decision, R and L. Well, we can look at that and ask ourselves, if we want to know what the expected profit is, can't we just plug in the expected values for DR and DL into that formula? In other words, if we want to get the expected value of the random output, can we just use the expected values of the random inputs in the formula that connects random inputs and random outputs? The answer is, in general, not really. It is a tempting thing to do, as we do not need to run any simulation to do that but the number we get as a result. Maybe quite some distance away from the correct value. The point I'm making here is that in general simulation is a necessary tool for evaluating the reward and risk measures in uncertain settings. And one should be very careful with attempting shortcuts. Like, replacing random quantities by the expected values. In order to appreciate this point, let's have a look at a simple example. Suppose that the demand for regular apartment's DR takes two values, 65, and 115, each with probability of 0.5. And the demand for luxury apartments deal takes the values of 7 and 13, each with probability 0.5. Note that the expected demand on the standard deviation values for both demand distributions are the same as the ones that Stargrove uses for modeling demand distributions using normal distribution form. So, what kind of value for the profit are we going to get if we plug in the expected values for both demands 90 for DR and 10 for DL into the formula for profit. We get 500,000*90 + 900,000*10 + 100,000*6 + 150,000*2, that's $54.9 million. Let's compare this value to actual expected profit value. Since the demand value for regular apartments DR can take two values, 65 and 115, with equal probabilities, and the demand value for luxury apartments can also take two values, 7 and 13, also with equal probabilities. And those demand random variables take these values independently from each other. That's a total of four possibilities for the pair of demand values, DR and DL, each possibility being realized with a probability of 0.5 * 0.5 = 0.25. We'll go with these four possibilities one by one. The first possibility is that both demands simultaneously take the lowest values, 65 for DR, and 7 for DL. In this case, 65 regular apartments are sold at the profit of $500,000 each, and the remaining 31 at the profit of $100,000 each. In a similar fashion, 7 luxury apartments are sold at the profit of $900,000 each, and the remaining 5 at the lower profit of $150,000 each. The profit value in this scenario is $42,650,000. The second possibility is that the demand DR takes the high value, of 115, and DL takes the low value, 7. The profit value in this scenario is, 500,000*96 + 900,000*7 + 100,000 *0+150,000*5 = $55,050,000. The third possibility is for DR to take the low value 65 and for DL to take the high value 13. The profit value in this scenario is 500,000*65 + 900,000*12 + 100,000*31 + 150,000*0 = 46,400,000. Finally, the fourth scenario is when both demands take their highest values. The profit in this case is 500,000*96 + 900,000*12 + 100,000*0 + 150,000*0 which is 58,800,000. The expected profit is the average of the profit values in four scenarios, and that's $50,725,000. As you could see, the true value of the expected profit is much lower than the value we obtain by replacing random variables by the expected values in formula for profit. We devoted session 1 of the fourth week to an introduction to a decision making in settings where future rewards and risks, must be evaluated using continuous probability distributions. Next, we will focus on the mechanics of simulation. We will set up the simulation and run it using Excel.