{"id":183,"date":"2020-03-23T17:41:55","date_gmt":"2020-03-23T17:41:55","guid":{"rendered":"http:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/?p=183"},"modified":"2020-04-28T15:46:19","modified_gmt":"2020-04-28T15:46:19","slug":"censored-demand","status":"publish","type":"post","link":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/2020\/03\/23\/censored-demand\/","title":{"rendered":"Censored demand"},"content":{"rendered":"\n<p>Censored demand happens when a shop \u2014 or any other type of retailer \u2014 runs out of stock. How do they know how much more they could have sold? Having a good handle on this is important for retailers, particularly those that stock perishable goods. &nbsp;This post will explore ways in which mathematical models can help them to do that. <\/p>\n\n\n\n<p><em>As part of our assessments here at STOR-i we have to write a short report on a research topic of our choice (as well as a long one, which I\u2019m working on now). For my short report I wrote about retail analytics, and particularly the issue of censored demand. You can see the link to the report at the bottom of this post. <\/em><\/p>\n\n\n\n<p>Forecasting demand for retailers is a thorny problem. They\nneed to estimate how much they are going to sell to decide how much stock to\norder. <\/p>\n\n\n\n<p>But, unless they have very high levels of stock, they are probably going to have days when they sell out. So then how do they decide how much demand is actually out there? <\/p>\n\n\n\n<p>This is a particularly big problem for those that stock perishable goods. If a retailer were to order in a mountain-sized pile of grapes, for example, they would have to throw away what they didn\u2019t sell after just a few days. <\/p>\n\n\n\n<p>Waste is something retailers need to avoid \u2014 not just for\ntheir profits, but there are global environmental reasons why we should all be\ntrying to cut down on waste. <\/p>\n\n\n\n<p>On the other hand, if a retailer regularly runs out of\nstock, they could find that customers decide to shop elsewhere. <\/p>\n\n\n\n<p>Mathematical models can help us to overcome some of this\nuncertainty. <\/p>\n\n\n\n<p>In my report I focused on parametric models. This means we assume that the demand conforms \u2014 in gross \u2014 to an underlying mathematical distribution. <\/p>\n\n\n\n<p>This is helpful, because if we can observe a bit of the distribution, we can gain insight into what the bits we cannot see might be like. <\/p>\n\n\n\n<p>More formally, we can use the observed demand (the demand recorded before the retailer ran out of stock) to make inference about the unobserved demand (the demand that the retailer didn&#8217;t fulfil after they ran out of stock). <\/p>\n\n\n\n<p>I look closely at two methods in my report: one to deal with normally distributed data (Nahmias&#8217; method) <a href=\"#_ftn1\">[1]<\/a>, and one to deal with demand that corresponds to a Poisson distribution (Conrad&#8217;s method) <a href=\"#_ftn2\">[2]<\/a>. <\/p>\n\n\n\n<p>In my report I show that these methods work nicely, as long as we have picked the right distribution. <\/p>\n\n\n\n<p>But not all retail demand behaves nicely and conforms to the distribution we assume (or sometimes any distribution at all). <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">What can go wrong?<\/h4>\n\n\n\n<p>What follows is an illustration of what can happen if we use a good method but we assume the wrong underlying distribution. <\/p>\n\n\n\n<p>In the picture below (nabbed from my report), I&#8217;ve simulated data from a bimodal distribution. <\/p>\n\n\n\n<p>In this case it is data from two normal distributions, with different means and variances. In the picture, I&#8217;ve plotted a histogram of the simulated data. <\/p>\n\n\n\n<p>I create a right-censored data set by removing any data points with a value higher than 120. The removed data is represented by the dark blue columns.<\/p>\n\n\n\n<p>I then look at what happens if I assume (mistakenly) that my data is normally distributed. So I then use Nahmias&#8217; method to estimate the distribution based on the only data I can now use (the light blue columns). <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-content\/uploads\/sites\/14\/2020\/03\/Rplot3.jpeg\" alt=\"\" class=\"wp-image-184\" width=\"417\" height=\"394\" srcset=\"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-content\/uploads\/sites\/14\/2020\/03\/Rplot3.jpeg 962w, https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-content\/uploads\/sites\/14\/2020\/03\/Rplot3-300x284.jpeg 300w, https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-content\/uploads\/sites\/14\/2020\/03\/Rplot3-768x726.jpeg 768w\" sizes=\"(max-width: 417px) 100vw, 417px\" \/><figcaption>Estimating censored demand: I&#8217;ve mistakenly assumed my data is normally distributed<\/figcaption><\/figure><\/div>\n\n\n\n<p>And so I\u2019ve got things very wrong. The red line represents what I think the true demand looks like. You can see I totally miss the second (unobserved) peak. <\/p>\n\n\n\n<p>Nahmias&#8217;s method is really good on censored data that comes from a normal distribution but I&#8217;m deliberately tripping it up by giving it a nasty (but plausible) underlying distribution. <\/p>\n\n\n\n<p>This is a simulation, so I known I&#8217;m getting it wrong. Bear in mind that if this was a real world situation I would only be able to see the light blue columns. Based on that, assuming normally distributed data maybe isn&#8217;t great, but it would not be completely silly either. <\/p>\n\n\n\n<p>If you want to read more about this subject, below are some links to papers I mention in this post (as well as my report).  <\/p>\n\n\n\n<p><a href=\"http:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-content\/uploads\/sites\/14\/2020\/03\/Wilkie_RT1.pdf\">Click here to see my report.<br><\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<p><a href=\"#_ftnref1\">[1]<\/a> Nahmias,\nS. (1994).&nbsp; Demand estimation in lost\nsales inventory systems. <em>Naval Research\nLogistics (NRL)<\/em>, 41(6):739\u2013757.<\/p>\n\n\n\n<p><a href=\"#_ftnref2\">[2]<\/a> Conrad,\nS. (1976).&nbsp; Sales data and the estimation\nof demand. <em>Journal of the Operational\nResearch Society<\/em>, 27(1):123\u2013127.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Forecasting demand for retailers is a thorny problem. They need to estimate how much they are going to sell in order to decide how much stock to buy in.  <\/p>\n","protected":false},"author":8,"featured_media":203,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-183","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-operational-research"],"_links":{"self":[{"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":17,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"predecessor-version":[{"id":230,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-json\/wp\/v2\/posts\/183\/revisions\/230"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-json\/wp\/v2\/media\/203"}],"wp:attachment":[{"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/tessa-wilkie\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}