640 likes | 778 Views
MGTSC 352. Finals Notes. Forecasting. Forecasting – Quantitative. Time series analysis : uses only past records of demand to forecast future demand moving averages exponential smoothing ARIMA Causal methods : uses explanatory variables (timing of advertising campaigns, price changes)
E N D
MGTSC 352 Finals Notes
Forecasting – Quantitative • Time series analysis: uses only past records of demand to forecast future demand • moving averages • exponential smoothing • ARIMA • Causal methods: uses explanatory variables (timing of advertising campaigns, price changes) • multiple regression • econometric models
Simple models • Notation • Dt = Actual demand in time period t • Ft = Forecast for period t • Et = Dt - Ft = Forecast error for period t
Simple models • Last Point model • Yesterday’s demand will be today’s forecast • Ft+1 = Dt • Not a good model cause it does no learning, it is just a follower • Average Model • Take the average of all known data to make prediction • Ft+1 = average(D1,D2, . . . , Dt) • Very old data is probably useless to us, so why include in the model?
Simple models • Simple moving average (SMA) • Take the average of data in the past ‘m’ periods as a forecast • Ft+1= average(Dt-m+1, Dt-m+2, . . . , Dt • Maybe some data points should have more weight on them than others • Can’t begin to forecast until you have the specified window of data points • Weighted moving average • Like SMA but different points have different levels of importance, or weight • Ft+1 = W1*Dt-m+1+W2*Dt-m+2+ . . . + Wm*Dt • ΣWi = 1 • How to choose the weights? • Data that is closer to the forecast point should have more weight placed on it
Simple Exponential Smoothing (SES) • Initialization: F2 = D1 • Learning: Ft+1 = LS*Dt + (1-LS)*Ft • Predicting: Ft+k = Ft+1 • Future forecasts are equal to the last forecast • LS = level smoother • Lower LS, higher the volatility • Higher LS, lower the volatility, however we will be doing less prediction and more following • Must have some sort of compromise • At LS=0, all values will be same as the initialized forecast, • At LS=1, the graph will follow the demand perfectly one day late • Really worthless
Performance Measures Remember that for performance measures, you must have a demand and a corresponding forecast. What is error if there is nothing to compare to?
Bias • Average error • (1/n)Σ Et • Positive and negative values will cancel out • May appear to have a small bias but large errors in the positive and negative direction will cancel each other out
Mean Absolute Deviation (MAD) • (1/n) Σ |Et| • Similar to bias, but no negative values • No way of telling which direction the error is occurring, just that there is error
Mean Square Error (MSE) andStandard Error (SE) • (1/(n-1)) Σ Et2 • Places more emphasis on large error terms • Heavily influenced by outlier terms and also not in units of the error • SE = (MSE)1/2 • Same units as error • Dampens the effect of the error terms
Mean Absolute Percentage Error (MAPE) • (1/n) Σ (Et/Dt) • In terms of percentage, which is good • If error is large but Dt is humongous, MAPE will appear to be small • That is the problem when you have you performance measure influenced by the demand
Double Exponential Smoothing (DES) • Takes level and trend into account • Trend = change in the level • Initialization: • L2 = (D1+D2)/2 • T2 = D2-D1 • Learning: • Lt = LS*Dt+(1-LS)(Lt-1+Tt-1) • Tt = TS(Lt-Lt-1)+(1-TS)Tt-1
DES • Prediction: • Ft+1 = Lt+Tt • Predicting k steps into the future • Ft+k = Lt+kTt • Change is exaggerated at beginning • As time moves on, the emphasis a single data point has on the model decreases (less fluctuation) • Remember that you can only make level and trend up to data points that you have, can’t make level and trend for predicted data
Triple Exponential Smoothing (TES) • Takes level, trend and seasonality into account • Use if you see seasonal trends in the data and if the data appears to be non-linear
TES - Initialization • P is the number of seasons in a dataset • Ex) weeky = 7, monthly = 12, hourly = 24, quarterly = 4 • The initialization window is equal to P, we allow P terms to pass before we begin to forecast
TES - Initialization • Level: average of initial ‘P’ data points = A • Trend: Tp = (Dp+1-D1)/P • Ex) if we have monthly data from Jan 2000 to Dec 2005, initialization would be: (DJan2001-DJan2000)/12 • Seasonality: Si = Di/A • The initial seasonality indices are ratios of that period’s demand against the average of the initial ‘P’ data points (the level) • Notice that whenever we deal with seasonality, we always match up corresponding seasons with one another. January matches up with January, Tuesday matches up with Tuesday, etc.
TES - Learning • The one-time forecast is Ft+1 = (Lt+Tt)/St+1-P • If Ft+1 is a Tuesday, St+1-P is the previous Tuesday’s seasonality
TES - Learning • Lt = LS(Dt/St-p)+(1-LS)(Lt-1+Tt-1) • We want to remove the effect of seasonality from level • We want to know what December sales would be like if it weren’t Christmas, we want the deseasonalized level • The old data is already deseasonalized (Lt-1+Tt-1)(St+1-p/St+1-p)
TES - Learning • Tt = TS(Lt-Lt-1)+(1-TS)Tt-1 • Trend is not effected by seasonality, it is merely a change in level • Same as in DES • St = SS(Dt/Lt)+(1-SS)St-p • Don’t want the effects of level to effect seasonality, so we divide it out • Always remember to match up seasons with the same season
TES - Predicting Ft+k = (Lt+kTt)St+k-P k<=p • We can only use the last level and trend for the prediction • For seasonality we can only use the seasonality for the last cycle. • When K>p, we must reset seasonality to the beginning of the cycle • We can not create seasonality for data we don’t have, just like level and trend
Solver • When using solver to optimize forecasting problems, minimize MSE or SE cause they are linear functions • If using bias, make it so that bias = 0 • Solver is used to optimize the smoothing factors so that we can achieve the optimum performance measure • Boundaries must ve set in solver so that we aren’t chasing randomness and so we are actually predicting data • Set bounds so that 0.05<smoothers<0.95
Simple Linear Regression with Seasonality Indices (SLRwSI) • Use this method if you have seasonal data and you can see a linear trend in the dataset • SLR is intended to make bias = 0 • SLR = Intercept + k*slope • Functions can be imputted by separate functions in excel or by adding treadline, but will be optimized by solver anyways, so it doesn’t really make a difference
SLRwSI • Seasonality is not updated in SLRwSI, we will have a different seasonal index for each period and the dataset will cycle through those initial indices • The average of the seasonal indices must equal 1 • SLRwSI = SLR*SI • To optimize • Minimize performance measure • Allow manipulation of slope, intercept and all of the SI’s • Restrain so that the average of the SI’s must equal 1
Limitation of Solver • Solver tries to find the minimum value of the dataset, but that minimum may be the local minimum, we want the global minimum • To help fix this, start the indices or the SI’s at different points to find the true minimum • 95% Prediction Interval = Forecast ± 2*SE
Simulation • Simulating a value from a Normal Distribution:Breaking the formula down • ROUND(NORMINV(RAND(),mean,stdev),0) • Step 1: generate random numberRAND() • Step 2: convert random number to normal distributionNORMINV(RAND(),mean,stdev) • Step 3: round to whole numberROUND(NORMINV(RAND(),mean,stdev),0)
Bard Outside: Decision: # of seats Uncertain future demand Demand > # of seats lost revenue Demand < # of seats empty seats A newsvendor: Decision: # of newspapers to get Uncertain future demand Demand > # of papers lost revenue Demand < # of papers disposal costs Bard Outside Example: A “Newsvendor Problem”
Simulation notes • To find % of something above x amount • 1-normdist(X,mean,stddev,true) • To find simulated demand, use norminv function • Use max(0,round(...)), keeps it non-negative • For table, highlight the variable cells and the count cells. • Highlight as many sells as the size of table that you want • DONT FORGET TO FREEZE TABLE AFTER MAKING
Distributions • Triangular distributions • Have min, max, and most likely scenario • Adding two random values will give triangular dist. • Uniform distribution • If you added one random variable • Trapezoidal distribution
Aggregate Planning • Solver error: Unbounded Problem • How will you know: The set cell values do not converge • What it means: • Possible to achieve infinite profit • Either you will become filthy rich, or (more likely) there is something wrong with your model • How to fix it: look for missing constraints
Aggregate Planning • Solver Error: Infeasible Problem • How will you know: Solver could not find a feasible solution • What it means: • Impossible to satisfy all constraints • Possible reasons: • You need more resources • You over-constrained the problem
Sensitivity Report • Allowable increase/decrease • The bounds that we are allowed to be within for our answer to still be the optimal one. • Once we go beyond these bounds we would have to re-solve the answer • Shadow price • How much the objective function will change if we change the R.H side of the corresponding constraint within the limits given in the allowable increase/decrease columns • How much the change in the target cell if the RH side of a constraint increases by 1 • If we have unconsumed materials, shadow price will always be 0 • Deals with marginal pricing
Sensitivity report • Reduced cost • For each variable which is currently zero, an estimate of how much the objective function will change if we force that variable to be non-zero. • Think opportunity cost • To decide whether the objective function will go up or down use: • constraint more (less) restrictive after change in right-hand side implies objective function worse (better) • if objective is maximise (minimise) then worse means down (up), better means up (down)
Tolerance • We should set tolerance to as low as possible so that solver will find the absolute optimal solution, instead of a value within a certain tolerance interval. • May take a little more time to solve if we have a low tolerance level
Level vs. Chase • Level • Always producing at a constant rate no matter what the demand is • Chase • Attempting to chase the simulated demand
Distribution Planning • What should overall distribution system be? • Where should inventories of products or raw materials be stored? • How much inventory of each product and raw material should be stored at each location • How should the flow of products and raw materials through the distribution be coordinated • What models of transportation should be used?
Distribution Planning • All distribution problems are really special case of minimum cost problem, even the shortest distance problem, which replaces distances with cost • Remember to freeze cells when using the sumif function • Hit ctrl + ~ to get into formula mode, will make it much easier to debug
Distribution Planning • Shortest path problem • If we are required to go to a certain path, best way is to solve it in two parts • 1st part is when we go from supply city to intermediate path • 2nd part is when we go from intermediate city to final demand path • Set demand = 1 at destination city and set supply = 1 at city of origin • Make sure that supply + flowin = demand + flow out • This will allow us to make a path with no jumps
Distribution Planning • Shortest Path problem cont. • If we have to traverse a specific arc, but not to a specific city to within that arc, before going to a specific city, make sure you allow for two-way travel • In three cells, have: • city 1 -> city 2 • City 2 -> city 1 • sum • Each path will reference truckload along that path • Sum is the sum of the two arcs • Constrain solver so that the sum>=1, that way it must traverse the path but also allows for back travel
Distribution Planning • New locations • If wondering whether or not to open a new facility, use a binary variable • To ensure that we don’t produce if we don’t open: • Set an upper bound = max prod * binary • Constrain solver so that production can not be greater than the upper bound • Must constrain solver so that supply + flow in + production >= demand + flow out
Inventory Management • Goods that have not yet been sold • Keep inventory when • Demand unpredictable • Delivery takes time • Fixed cost for delivery • Relevant question • When to order (ROP = Reorder point) • How much to order (Q = reorder quantity) • MAKE SURE TIME UNITS ARE CONSISTENT, DON’T MIX YEARS WITH MONTHS
Acquisition cost ($/unit purchased) Ordering costs($/order) clerical expenses delivery, inspection setup (prod.) Carrying costs = Holding costs($/unit/time unit) cost of capital insurance shrinkage, spoilage, obsolescence material handling (fork lifts, space) Shortage costs($/unit short) lost goodwill, discounts, penalties lost sales shut down of assembly line (prod.) Relevant Costs
Maximum inventory Avg. inventory ROP Q Leadtime Minimum inventory Inventory LTD = Demand during leadtime Time