Title: | Inventory Analytics, Pricing and Markdowns |
---|---|
Description: | Simulate inventory policies with and without forecasting, facilitate inventory analysis calculations such as stock levels and re-order points,pricing and promotions calculations. The package includes calculations of inventory metrics, stock-out calculations and ABC analysis calculations. The package includes revenue management techniques such as Multi-product optimization,logit and polynomial model optimization. The functions are referenced from : 1-Harris, Ford W. (1913). "How many parts to make at once". Factory, The Magazine of Management. <isbn10: 135–136, 152>. 2- Nahmias, S. Production and Operations Analysis. McGraw-Hill International Edition. <isbn: 0-07- 2231265-3. Chapter 4>. 3-Silver, E.A., Pyke, D.F., Peterson, R. Inventory Management and Production Planning and Scheduling. <isbn: 978-0471119470>. 4-Ballou, R.H. Business Logistics Management. <isbn: 978-0130661845>. Chapter 9. 5-MIT Micromasters Program. 6- Columbia University course for supply and demand analysis. 8- Price Elasticity of Demand MATH 104,Mark Mac Lean (with assistance from Patrick Chan) 2011W For further details or correspondence :<www.linkedin.com/in/haythamomar>, <www.rescaleanalytics.com>. |
Authors: | Haytham Omar [aut, cre] |
Maintainer: | Haytham Omar <[email protected]> |
License: | GPL-3 |
Version: | 1.1.1 |
Built: | 2025-03-13 05:02:11 UTC |
Source: | https://github.com/cran/inventorize |
Identyfing ABC category based on the pareto rule. Identyfing ABC category based on the pareto rule.A category is up to 80
ABC(data, na.rm = TRUE, plot = FALSE)
ABC(data, na.rm = TRUE, plot = FALSE)
data |
Data frame of tuo columns,first column is the item name, second column is the item value/flow/demand. |
na.rm |
logical and by default is TRUE |
plot |
default is FALSE,if true a plot is generated |
a dataframe that contains ABC categories with a bar plot of the count of items in each category.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
ABC(data.frame(SKU= seq(1:1000),demand=runif(1000,1,1000)))
ABC(data.frame(SKU= seq(1:1000),demand=runif(1000,1,1000)))
Identyfing ABC category based on the pareto rule. the function can have flexibility in defining the A,B thresholds. can be done on multiple splits for example countries or stores
abc_dynamic( product, key_to_split = F, first_attribute, second_attribute = F, A = F, B = F )
abc_dynamic( product, key_to_split = F, first_attribute, second_attribute = F, A = F, B = F )
product |
Vector that contains the product name . |
key_to_split |
logical and by default is False, otherwise a column that has a splitting dimension, for example ; stores or cities |
first_attribute |
, attribute to do the ABC analysis on, for example sales quantity |
second_attribute |
, attribute to do the ABC analysis on .for example profit, the default is FALSE |
A |
, changing the default threshold for A category which is 0.8, the default is FALSE |
B |
, changing the default threshold for B category which is 0.95, the default is FALSE |
a dataframe that contains ABC categories.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
abc_dynamic(c(1:1000), rep(seq(1:10),100), runif(1000,4,10000),rnorm(1000,100,20))
abc_dynamic(c(1:1000), rep(seq(1:10),100), runif(1000,4,10000),rnorm(1000,100,20))
Calculating critical ratio of a news vendor model under any distribution.this critical ratio maxmizes profit.
CriticalRatio(sellingprice, cost, salvage, penality, na.rm = TRUE)
CriticalRatio(sellingprice, cost, salvage, penality, na.rm = TRUE)
sellingprice |
numeric,selling price of the SKU |
cost |
numeric,cost of the SKU |
salvage |
numeric,,salvage or discounted value if sold after season,if there is no salvage , zero is placed in the argument. |
penality |
numeric, peanlity cost of not satisfying demand if any, if not, zero is placed in the argument. |
na.rm |
A logical indicating whether missing values should be removed |
the critical ratio.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
CriticalRatio(sellingprice=80,cost=60,salvage=45,penality=25,na.rm=TRUE)
CriticalRatio(sellingprice=80,cost=60,salvage=45,penality=25,na.rm=TRUE)
Cost per stockout event
CSOE( quantity, demand, standerddeviation, leadtimeinweeks, cost, costSoe, holdingrate, na.rm = TRUE )
CSOE( quantity, demand, standerddeviation, leadtimeinweeks, cost, costSoe, holdingrate, na.rm = TRUE )
quantity |
numeric,quantity replinished every cycle. |
demand |
numeric,annual Expected demand of the SKU . |
standerddeviation |
numeric, standard deviation of the SKU during season. |
leadtimeinweeks |
numeric,leadtime in weeks of order. |
cost |
numeric,cost of item. |
costSoe |
numeric, estimated cost per stockout event. |
holdingrate |
numeric, holding rate per item per year,percentage. |
na.rm |
removes na values if TRUE, TRUE by default |
Calculating K value that corresponds to the cost per stock out event, how much quantity should be put in stock as a minimum.the function solves for optimum K based on the stock out event. It should be noted that the condition(output) should be bigger than 1. other wise set K as per management.
a dataframe that contains calculations of K and the minimum quantity to be put in stock .
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
CSOE(quantity=1000,demand=40000,standerddeviation=200,leadtimeinweeks=3, cost=500,costSoe=30000,holdingrate=0.2,na.rm=TRUE)
CSOE(quantity=1000,demand=40000,standerddeviation=200,leadtimeinweeks=3, cost=500,costSoe=30000,holdingrate=0.2,na.rm=TRUE)
claculating demand lead time,saftey stock when there is a leadtime variability.
dl.sigmadl(expected_demand, sd_demand, expected_leadtime, sd_leadtime)
dl.sigmadl(expected_demand, sd_demand, expected_leadtime, sd_leadtime)
expected_demand |
numeric,expected daily demand . |
sd_demand |
numeric,standard deviation of daily demand . |
expected_leadtime |
numeric, expected leadtime in days. |
sd_leadtime |
numeric,standard deviation of leadtime |
calculating leadtime with leadtime variablility as delivery time diffires to long distances and reliability of mode of transport. thus demand leadtime and standard deviation during lead time takes into consideration the lead time variability.
a dataframe that contains calculations of the expected demand lead time and the expected saftey stock during leadtime. It is noted that saftey stock here is more than normal due to leadtime variability.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
dl.sigmadl(expected_demand=100,sd_demand=22,expected_leadtime=12,sd_leadtime=3)
dl.sigmadl(expected_demand=100,sd_demand=22,expected_leadtime=12,sd_leadtime=3)
calculating elasticity of price change.
elasticity(salesP1, salesP2, priceP1, priceP2)
elasticity(salesP1, salesP2, priceP1, priceP2)
salesP1 |
integer, unit sales in period 1. |
salesP2 |
integer unit sales in period 2. |
priceP1 |
numeric, average price of sku in period 1. |
priceP2 |
average price of sku in period 2. |
This function is helpful to determine the elasticity of a product with effect to price change, the figure could be negative as the change is price is negative. it translates as for each unit percentage decrease in price , this much is ecpected precentage of increase of sales. condition must be that Price in period one was more than proce in period 2 and sales in period two was more than sales in period 1.
the elasticity ratio in unit sales, the -ve number represents the increase in sales for each decrease of unit currency.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: "<[email protected]>"
elasticity(salesP1=50,salesP2=100,priceP1=6,priceP2=4)
elasticity(salesP1=50,salesP2=100,priceP1=6,priceP2=4)
economic order quantity.
eoq(annualdemand, orderingcost, purchasecost, holdingrate, na.rm = TRUE)
eoq(annualdemand, orderingcost, purchasecost, holdingrate, na.rm = TRUE)
annualdemand |
numeric,annual demand of the SKU. |
orderingcost |
numeric ordeing cost of the SKU |
purchasecost |
,numeric, purchase cost per item |
holdingrate |
numeric holding rate per item per year. |
na.rm |
A logical indicating whether missing values should be removed |
the eoq,cycle stock time in years and cycle stock time in weeks.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
eoq(annualdemand=5000,orderingcost=400,purchasecost=140,holdingrate=0.2,na.rm=TRUE)
eoq(annualdemand=5000,orderingcost=400,purchasecost=140,holdingrate=0.2,na.rm=TRUE)
the rate of increase of total relevant cost compared to the EOQ.
eoqsenstivity(quantity, quantityoptimal, na.rm = TRUE)
eoqsenstivity(quantity, quantityoptimal, na.rm = TRUE)
quantity |
numeric,quantity ordered every order cycle. |
quantityoptimal |
, numeric optimal quantity based on EOQ. |
na.rm |
A logical indicating whether missing values should be removed |
the rate of increase of total relevant cost compared to the EOQ.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
eoqsenstivity(quantity=5400,quantityoptimal=6000,na.rm=TRUE)
eoqsenstivity(quantity=5400,quantityoptimal=6000,na.rm=TRUE)
calculating expected profit for a newsvendor model.
EPN_singleperiod(quantity, mean, standerddeviation, p, c, g, b, na.rm = TRUE)
EPN_singleperiod(quantity, mean, standerddeviation, p, c, g, b, na.rm = TRUE)
quantity |
numeric,quantity replinished every cycle. |
mean |
numeric,Expected demand of the SKU during season. |
standerddeviation |
numeric, standard deviation of the SKU during season. |
p |
numeric,selling price of the SKU |
c |
numeric,cost of the SKU |
g |
numeric,,salvage or discounted value if sold after season,if there is no salvage , zero is placed in the argument. |
b |
numeric, peanlity cost of not satisfying demand if any, if not, zero is placed in the argument. |
na.rm |
A logical indicating whether missing values should be removed |
calculating expected profit for a newsvendor model. based on assumed normal distribution demand.
a dataframe that contains calculations of the expected profit from a newsvendor model based on normal distribution.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
EPN_singleperiod(quantity=40149,mean= 32000,standerddeviation= 11000,p=24,c=10.9,g=7,b=0,na.rm=TRUE)
EPN_singleperiod(quantity=40149,mean= 32000,standerddeviation= 11000,p=24,c=10.9,g=7,b=0,na.rm=TRUE)
Expected profit from a newsvendor model based on a poisson distribution.
EPP_singleperiod(quantity, lambda, p, c, g, b, na.rm = TRUE)
EPP_singleperiod(quantity, lambda, p, c, g, b, na.rm = TRUE)
quantity |
numeric,quantity to be ordered during season. |
lambda |
numeric, mean of the demand based on poisson distribution. |
p |
numeric,selling price of the SKU |
c |
numeric,cost of the SKU |
g |
numeric,,salvage or discounted value if sold after season,if there is no salvage , zero is placed in the argument. |
b |
numeric, peanlity cost of not satisfying demand if any, if not, zero is placed in the argument. |
na.rm |
A logical indicating whether missing values should be removed |
calculating expected profit for a newsvendor model. based on assumed poisson distribution demand.
a dataframe that contains calculations of the expected profit from a newsvendor model based on poisson distribution.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
EPP_singleperiod(quantity=40149,lambda= 32000,p=24,c=10.9,g=7,b=0,na.rm=TRUE)
EPP_singleperiod(quantity=40149,lambda= 32000,p=24,c=10.9,g=7,b=0,na.rm=TRUE)
Calculating expected unit short based on an assumed normal distribution.
EUSnorm_singleperiod(quantity, demand, standerddeviation, na.rm = TRUE)
EUSnorm_singleperiod(quantity, demand, standerddeviation, na.rm = TRUE)
quantity |
numeric,quantity replinished every cycle. |
demand |
numeric,annual Expected demand of the SKU . |
standerddeviation |
numeric, standard deviation of the SKU during season. |
na.rm |
logical,TRUE |
Calculating expected unit short based on an assumed normal distribution for a newsvendor model.
a dataframe that contains Expected unit short,k and g(k).
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
EUSnorm_singleperiod(quantity=35000,demand=32000,standerddeviation=12000,na.rm=TRUE)
EUSnorm_singleperiod(quantity=35000,demand=32000,standerddeviation=12000,na.rm=TRUE)
Hibrid Policy normal distribution service level, .
Hibrid_normal( demand, mean, sd, leadtime, service_level, Review_period, min = FALSE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
Hibrid_normal( demand, mean, sd, leadtime, service_level, Review_period, min = FALSE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
demand |
A vector of demand in N time periods. |
mean |
average demand in N time periods. |
sd |
standard deviation in N time periods. |
leadtime |
lead time from order to arrival |
service_level |
cycle service level requested |
Review_period |
the period where the ordering happens. |
min |
min quantity for order up to level,if FALSE, then calculated automatically. |
shortage_cost |
shortage cost per unit of sales lost |
inventory_cost |
inventory cost per unit. |
ordering_cost |
ordering cost for every time an order is made. |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate and inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the order up to level is calculated based on the review period,lead time and normal distribution. Inventory is replenished if inventory position is below min or it is time for review period.
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
Hibrid_normal(demand=rpois(80,6),mean=4,sd=0.2,leadtime=5,service_level=0.95, Review_period =9,min=30, shortage_cost= FALSE,inventory_cost=FALSE,ordering_cost=FALSE)
Hibrid_normal(demand=rpois(80,6),mean=4,sd=0.2,leadtime=5,service_level=0.95, Review_period =9,min=30, shortage_cost= FALSE,inventory_cost=FALSE,ordering_cost=FALSE)
Hibrid Policy Poisson distribution service level, .
Hibrid_pois( demand, leadtime, service_level, lambda, Review_period, min = FALSE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
Hibrid_pois( demand, leadtime, service_level, lambda, Review_period, min = FALSE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
demand |
A vector of demand in N time periods. |
leadtime |
lead time from order to arrival |
service_level |
cycle service level requested |
lambda |
rate of demand in N time periods. |
Review_period |
the period where the ordering happens. |
min |
min quantity for order up to level,if FALSE, then calculated automatically. |
shortage_cost |
shortage cost per unit of sales lost |
inventory_cost |
inventory cost per unit. |
ordering_cost |
ordering cost for every time an order is made. |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate and inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the order up to level is calculated based on the review period,lead time and normal distribution. Inventory is replenished if inventory position is below min or it is time for review period.
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
Hibrid_pois(demand=rpois(80,6),lambda=4,leadtime=5,service_level=0.65, Review_period =9,min=30, shortage_cost= FALSE,inventory_cost=FALSE,ordering_cost=FALSE)
Hibrid_pois(demand=rpois(80,6),lambda=4,leadtime=5,service_level=0.65, Review_period =9,min=30, shortage_cost= FALSE,inventory_cost=FALSE,ordering_cost=FALSE)
Simulating a Min Max periodic policy, diffirent from R,s,S because here order is made in case the Inventory position reaches min or the ordering period comes . The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. Max - inventory position is ordered whenever inventory position reaches min or at the period of review
hybrid_policy( demand, mean = FALSE, sd = FALSE, leadtime, service_level, initial_inventory_level = FALSE, min = FALSE, Max = FALSE, Min_to_max = 0.6, Review_period, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", recalculate = FALSE, recalculate_windows = FALSE, plot = FALSE, Backlogs = FALSE )
hybrid_policy( demand, mean = FALSE, sd = FALSE, leadtime, service_level, initial_inventory_level = FALSE, min = FALSE, Max = FALSE, Min_to_max = 0.6, Review_period, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", recalculate = FALSE, recalculate_windows = FALSE, plot = FALSE, Backlogs = FALSE )
demand |
A vector of demand in N time periods. |
mean |
average demand in N time periods.default is FALSE and is automatically calculated. otherwise set manually. |
sd |
standard deviation in N time periods.default is FALSE and is automatically calculated. otherwise set manually. |
leadtime |
lead time from order to arrival (order to delivery time) |
service_level |
cycle service level requested |
initial_inventory_level |
integer,Default is False and simulation starts with min as inventory level |
min |
integer,Default is False and min is calculated based on mean,demand and lead time unless set manually |
Max |
integer,Default is False and max is calculated as a ratio to min,otherwise set manually. |
Min_to_max |
numeric, the ratio of min to max calculation , default 0.6 but can be changed manually |
Review_period |
Integer, the number of periods where every order is allowed to be made. |
shortage_cost |
numeric,Default is FALSE shortage cost per unit of sales lost |
inventory_cost |
numeric,Default is FALSE inventory cost per unit. |
ordering_cost |
numeric,Default is FALSE ordering cost for every time an order is made. |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom' |
recalculate |
Logical, if true the mean and sd is recalculated every period from first period to t,default is FALSE . |
recalculate_windows |
integer, the min mean and sd windows to recalculate , for example if it is set to 4 mean and sd is calculated from t to t-4,,default is FALSE, if TRUE, recalculate has to be TRUE Also. |
plot |
Logical, Default is False, if true a plot is generated |
Backlogs |
Logical, Default is False, if true inventory level accounts for previous lost orders |
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
hybrid_policy(demand = rpois(90,8),leadtime = 6,Review_period = 10,service_level = 0.8)
hybrid_policy(demand = rpois(90,8),leadtime = 6,Review_period = 10,service_level = 0.8)
Simulating a Min Max periodic policy, diffirent from R,s,S because here order is made in case the Inventory position reaches min or the ordering period comes the Max is dynamically calculated based on a forecast vector. .
hybrid_policy_dynamic( demand, forecast, leadtime, Review_period, service_level, initial_inventory_level = FALSE, Min_to_max = 0.6, min = FALSE, one_step_forecast = TRUE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", error_metric = "mse", smoothing_error = 0.2, metric_windows = FALSE, plot = FALSE, Backlogs = FALSE )
hybrid_policy_dynamic( demand, forecast, leadtime, Review_period, service_level, initial_inventory_level = FALSE, Min_to_max = 0.6, min = FALSE, one_step_forecast = TRUE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", error_metric = "mse", smoothing_error = 0.2, metric_windows = FALSE, plot = FALSE, Backlogs = FALSE )
demand |
A vector of demand in N time periods. |
forecast |
the forecast vector of equal n periods to demand. |
leadtime |
lead time from order to arrival (order to delivery time) |
Review_period |
Integer, the number of periods where every order is allowed to be made. |
service_level |
cycle service level requested |
initial_inventory_level |
integer,Default is False and simulation starts with min as inventory level |
Min_to_max |
numeric, the ratio of min to max calculation , default 0.6 but can be changed manually. |
min |
integer,Default is False and min is calculated based on Min_to_max but can be set manually. |
one_step_forecast |
logical, Default is true where demand lead time is calcluated as(forecast at period t * leadtime) while if False, demand leadtime is calculated as (forecast of period t to forecast of period t+leadtime-1) |
shortage_cost |
numeric,Default is FALSE shortage cost per unit of sales lost |
inventory_cost |
numeric,Default is FALSE inventory cost per unit. |
ordering_cost |
numeric,Default is FALSE ordering cost for every time an order is made. |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom' |
error_metric |
metric is currently 'rmse' and 'mae', this calculates the error from period 1 to period t unless metric_windows is set. this contributes to the calculation of saftey stock. default is 'rmse' |
smoothing_error |
number between 0 and 1 to smooth the error as alpha x error[t] + (1-alpha)xerror t-1, if metric_windows is used, smoothing error has to be FALSE |
metric_windows |
integer, for exammple if it is set to 4 rmse for t is calculated from t-1 to t-4,default is FALSE |
plot |
Logical, Default is False, if true a plot is generated |
Backlogs |
Logical, Default is False, if true inventory level accounts for previous lost orders |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. Max - inventory position is ordered whenever inventory position reaches min or at the period of review
a list of two date frames, the simulation and the metrics. the metrics are (1) shortage cost, (2) inventory cost which is the cost of one unit of inventory in one period,(3) which is the average inventory level per period, (4) total orders made in the simulation, (5) ordering cost if any, (6) total lost sales if any,(7) average ordering quantity across all orders,(8) ordering interval which is the average time between each order,(9) item fill rate,(10) cycle service level, (11) average saftey stock in each period,(12) the average sales in every order,(13) overall root mean square error, (14) overall mean absolute error, (14) overall mean error,(15) overall mean absolute percentage error,(16) the average flowttime which is the average time a unit spends on inventory and (17) the demand classification.
"haytham omar email: <[email protected]>"
hybrid_policy_dynamic(demand = rpois(90,9),forecast = rpois(90,9),service_level = 0.9, leadtime = 10,Review_period = 10,min = 50)
hybrid_policy_dynamic(demand = rpois(90,9),forecast = rpois(90,9),service_level = 0.9, leadtime = 10,Review_period = 10,min = 50)
inventory analytics,revenue management and cost calculations for SKUs.
Maintainer: Haytham Omar [email protected]
calculating inventory metrics based on cost per item short.
inventorymetricsCIS( CIS, demand, standerddeviation, quantity, leadtime, cost, holdingrate, na.rm = TRUE )
inventorymetricsCIS( CIS, demand, standerddeviation, quantity, leadtime, cost, holdingrate, na.rm = TRUE )
CIS |
numeric,cost per item short determined by management |
demand |
numeric,annual demand of the SKU. |
standerddeviation |
numeric, annual standard deviation |
quantity |
numeric,quantity replinished every cycle. |
leadtime |
numeric,leadtime in weeks |
cost |
numeric cost of the SKU |
holdingrate |
,numeric, holding rate per item/year |
na.rm |
A logical indicating whether missing values should be removed |
after cost per item short is explicitly calculated, item fill rate, cost per stock out event and cycle service level are implicitly calculated.
a dataframe that contains demand leadtime,sigmadl(standard deviation in leadtime),saftey factor k determined based on cost per itemshort,unit normal loss function,expected units to be short,cycle service level, fill rate,implied cost per stockout event, saftey stock and suggested reorder point.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
inventorymetricsCIS(CIS= 90, demand= 35000,standerddeviation=9000, quantity= 9000,leadtime=3 ,cost=90,holdingrate=0.15,na.rm =TRUE)
inventorymetricsCIS(CIS= 90, demand= 35000,standerddeviation=9000, quantity= 9000,leadtime=3 ,cost=90,holdingrate=0.15,na.rm =TRUE)
calculating inventory metrics based on CYCLE SERVICE LEVEL.
inventorymetricsCSL( csl, demand, standerddeviation, quantity, leadtime, cost, holdingrate, na.rm = TRUE )
inventorymetricsCSL( csl, demand, standerddeviation, quantity, leadtime, cost, holdingrate, na.rm = TRUE )
csl |
numeric,required times of demand that is fullfilled from cycle stock |
demand |
numeric,annual demand of the SKU. |
standerddeviation |
numeric, annual standard deviation |
quantity |
numeric,quantity replinished every cycle. |
leadtime |
numeric,leadtime in weeks |
cost |
numeric,cost of the SKU. |
holdingrate |
numeric, holding rate per item per year. |
na.rm |
A logical indicating whether missing values should be removed |
cycle service level is the desired no of times demand is compleltey fulfiiled from cycle stock,after cycle service level is explicitly calculated, cost per item short, cost per stock out event and item fill rate are implicitly calculated.
a dataframe that contains demand leadtime, sigmadl(standard deviation in leadtime), saftey factor k determined based on item fillrate provided, unit normal loss function, expected units to be short, cycle service level, fill rate,implied cost per stockout event, saftey stock and suggested reorder point.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
inventorymetricsCSL(csl=0.95,demand=20000,standerddeviation=1200, quantity=4500,leadtime=3,cost=100,holdingrate=0.15,na.rm=TRUE)
inventorymetricsCSL(csl=0.95,demand=20000,standerddeviation=1200, quantity=4500,leadtime=3,cost=100,holdingrate=0.15,na.rm=TRUE)
calculating inventory metrics based on item fillrate.
inventorymetricsIFR( fillrate, demand, standerddeviation, quantity, leadtime, cost, holdingrate, na.rm = TRUE )
inventorymetricsIFR( fillrate, demand, standerddeviation, quantity, leadtime, cost, holdingrate, na.rm = TRUE )
fillrate |
numeric,required percentage of demand that is fullfilled from cycle stock |
demand |
numeric,annual demand of the SKU. |
standerddeviation |
numeric, annual standard deviation |
quantity |
numeric,quantity replinished every cycle. |
leadtime |
numeric,leadtime in weeks |
cost |
numeric cost of the SKU |
holdingrate |
,numeric, holding rate per item/year |
na.rm |
A logical indicating whether missing values should be removed |
item fill rate is the percentage of demand that is fullfilled directly from the cycle stock,after item fill rate is explicitly calculated, cost per item short, cost per stock out event and cycle service level are implicitly calculated.
a dataframe that contains demand leadtime, sigmadl(standard deviation in leadtime), saftey factor k determined based on item fillrate provided, unit normal loss function expected units to be short,cycle service level, fill rate,implied cost per stockout event, saftey stock and suggested reorder point.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
inventorymetricsIFR(fillrate= 0.90, demand= 35000,standerddeviation=9000, quantity= 5000,leadtime=3 ,cost=50,holdingrate=0.15,na.rm=TRUE)
inventorymetricsIFR(fillrate= 0.90, demand= 35000,standerddeviation=9000, quantity= 5000,leadtime=3 ,cost=50,holdingrate=0.15,na.rm=TRUE)
calculating elasticity of a linear price response function This function is helpful to determine if your product is elastic or not based on a linear price response function. if product demand is not linear to price, try using the single product optimization function instead. The price elasticity of demand which is often shortened to demand elasticity is defined to be the percentage change in quantity demanded, q, divided by the percentage change in price, p. When Elasticity bigger 1, we say the good is price elastic.In this case, percentQ bigger percentP, and so, for a 1 percent change in price, there is a greater than 1 percent change in quantity demanded.In this case, management should decrease price to have a higher revenue. When Elasticity smaller 1, we say the good is price inelastic.In this case, percentQ smaller percentP, and so, for a 1 percent change in price, there is a less than 1 percent change in quantity demanded.In this case, management should increase price to have a higher revenue. When Elasticity equal 1, we say the good is price unit elastic.In this case, percentQ equal percentP , and so, for a 1percent change in price, there is also an 1percent change in quantity demanded. This is the optimal price which means it maximizes revenue.
linear_elasticity(prices, Sales, present_price, cost_of_product, plot = FALSE)
linear_elasticity(prices, Sales, present_price, cost_of_product, plot = FALSE)
prices |
vector of prices. |
Sales |
Vector of sales against each price . |
present_price |
numeric, present price of the product . |
cost_of_product |
cost of the product, if the product/service has no cost ,then cost is set to zero. |
plot |
Default is false,if true, a plot is generated |
the elasticity at the present price , the price for optimum revenue and thee price for optimum cost.
this is the third version of the inventorize package, all the functions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: "<[email protected]>"
linear_elasticity(prices=c(5,10,8,5,14),Sales= c(450,400,420,450,360), present_price=15,cost_of_product=40)
linear_elasticity(prices=c(5,10,8,5,14),Sales= c(450,400,420,450,360), present_price=15,cost_of_product=40)
Simulating a max policy or also called S policy, the Max is dynamically calculated based on a forecast vector.
Max_policy_dynamic( demand, forecast, leadtime, service_level, initial_inventory_level = FALSE, one_step_forecast = TRUE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", error_metric = "mse", metric_windows = FALSE, smoothing_error = 0.2, plot = FALSE, Backlogs = FALSE )
Max_policy_dynamic( demand, forecast, leadtime, service_level, initial_inventory_level = FALSE, one_step_forecast = TRUE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", error_metric = "mse", metric_windows = FALSE, smoothing_error = 0.2, plot = FALSE, Backlogs = FALSE )
demand |
A vector of demand in N time periods. |
forecast |
the forecast vector of equal n periods to demand. |
leadtime |
lead time from order to arrival (order to delivery time) |
service_level |
cycle service level requested |
initial_inventory_level |
integer,Default is False and simulation starts with min as inventory level |
one_step_forecast |
logical, Default is true where demand lead time is calcluated as(forecast at period t * leadtime) while if False, demand leadtime is calculated as (forecast of period t to forecast of period t+leadtime-1) |
shortage_cost |
numeric,Default is FALSE shortage cost per unit of sales lost |
inventory_cost |
numeric,Default is FALSE inventory cost per unit. |
ordering_cost |
numeric,Default is FALSE ordering cost for every time an order is made. |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom' |
error_metric |
metric is currently 'rmse' and 'mae', this calculates the error from period 1 to period t unless metric_windows is set. this contributes to the calculation of saftey stock. default is 'rmse' |
metric_windows |
integer, for exammple if it is set to 4 rmse for t is calculated from t-1 to t-4,default is FALSE |
smoothing_error |
number between 0 and 1 to smooth the error as alpha x error[t] + (1-alpha) x error t-1, if metric_windows is used, smoothing error has to be FALSE |
plot |
Logical, Default is False, if true a plot is generated |
Backlogs |
Logical, Default is False, if true inventory level accounts for previous lost orders |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. and order is equal to max((Max[t]-inventory position [t-1])+ sales[t],0)
a list of two date frames, the simulation and the metrics. the metrics are (1) shortage cost, (2) inventory cost which is the cost of one unit of inventory in one period,(3) which is the average inventory level per period, (4) total orders made in the simulation, (5) ordering cost if any, (6) total lost sales if any,(7) average ordering quantity across all orders,(8) ordering interval which is the average time between each order,(9) item fill rate,(10) cycle service level, (11) average saftey stock in each period,(12) the average sales in every order,(13) overall root mean square error, (14) overall mean absolute error, (14) overall mean error,(15) overall mean absolute percentage error,(16) the average flowttime which is the average time a unit spends on inventory and (17) the demand classification.
"haytham omar email: <[email protected]>"
Max_policy_dynamic(demand = rnorm(90,9,2),forecast = rpois(90,9) , service_level = 0.7,leadtime = 10)
Max_policy_dynamic(demand = rnorm(90,9,2),forecast = rpois(90,9) , service_level = 0.7,leadtime = 10)
calculating expected profit for a newsvendor model based on critical ratio.
MPN_singleperiod(mean, standerddeviation, p, c, g, b, na.rm = TRUE)
MPN_singleperiod(mean, standerddeviation, p, c, g, b, na.rm = TRUE)
mean |
numeric,Expected demand of the SKU during season. |
standerddeviation |
numeric, standard deviation of the SKU during season. |
p |
numeric,selling price of the SKU |
c |
numeric,cost of the SKU |
g |
numeric,,salvage or discounted value if sold after season,if there is no salvage , zero is placed in the argument. |
b |
numeric, peanlity cost of not satisfying demand if any, if not, zero is placed in the argument. |
na.rm |
A logical indicating whether missing values should be removed |
calculating expected profit for a newsvendor model. based on assumed normal distribution demand.
a dataframe that contains calculations of the maximum expected profit from a newsvendor model based on normal distribution.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
MPN_singleperiod(mean= 32000,standerddeviation= 11000,p=24,c=10.9,g=7,b=0,na.rm=TRUE)
MPN_singleperiod(mean= 32000,standerddeviation= 11000,p=24,c=10.9,g=7,b=0,na.rm=TRUE)
Maximum profit from a newsvendor model based on a poisson distribution.
MPP_singleperiod(lambda, p, c, g, b, na.rm = TRUE)
MPP_singleperiod(lambda, p, c, g, b, na.rm = TRUE)
lambda |
numeric, mean of the demand based on poisson distribution. |
p |
numeric,selling price of the SKU |
c |
numeric,cost of the SKU |
g |
numeric,,salvage or discounted value if sold after season,if there is no salvage , zero is placed in the argument. |
b |
numeric, peanlity cost of not satisfying demand if any, if not, zero is placed in the argument. |
na.rm |
A logical indicating whether missing values should be removed |
calculating expected profit for a newsvendor model. based on assumed poisson distribution demand based on the critical ration.
a dataframe that contains calculations of the maximum expected profit from a newsvendor model based on poisson distribution.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
MPP_singleperiod(lambda= 32000,p=24, c=10.9,g=7,b=0,na.rm=TRUE)
MPP_singleperiod(lambda= 32000,p=24, c=10.9,g=7,b=0,na.rm=TRUE)
Calculating the optimum price based on consumer choice model for products that competes with each other.
Multi_Competing_optimization(X, y, n_variables, initial_products_cost)
Multi_Competing_optimization(X, y, n_variables, initial_products_cost)
X |
a data frame of product prices at every event. |
y |
integer vector with choices of a customer at each event , for example if the competing products are only three , the possible choices are NA,1,2,3. NA being a consumer did not buy any thing at this event and he chose to walk away. |
n_variables |
Number of products competing with each other. |
initial_products_cost |
a vector of current costs for each product,for example if we have three products , it could be c(1.8,2.5,3.9).or if there is no costs , it would be c(0,0,0) |
for multiple products that are offered , some of these products compete with each other. for example; Beef, chicken and lamb. each of them provides a certain value to consumer and are offered with different prices. this function calculates the intrinsic utility value -what is the perceived value of this product to the consumer- for competing products and optimize thee price of each product accordingly. please note that the more the products you put in the model, the more processing time it will take due to complexity of optimization problem.it is recommended to maximum of 8 products to your model.
a data frame with the product names which are names of X,the intrinsic utility value,the current cost and the optimized price for each product
"haytham omar email: <[email protected]>"
Multi_Competing_optimization(X= data.frame(Chedar_Cheese= runif(100,10,15), Mozarella=runif(100,8,10), Parmesan=runif(100,9,12)),y= as.numeric(rep(c(1,2,3,NA,2),20)),n_variables = 3, initial_products_cost = c(8,6,7))
Multi_Competing_optimization(X= data.frame(Chedar_Cheese= runif(100,10,15), Mozarella=runif(100,8,10), Parmesan=runif(100,9,12)),y= as.numeric(rep(c(1,2,3,NA,2),20)),n_variables = 3, initial_products_cost = c(8,6,7))
Simulating a periodic policy, different from R,s,S because here order is made at the ordering time without a min(reordering quantity)
periodic_policy( demand, mean = FALSE, sd = FALSE, leadtime, service_level, initial_inventory_level = FALSE, Max = FALSE, Review_period, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", recalculate = FALSE, recalculate_windows = FALSE, plot = FALSE, Backlogs = TRUE )
periodic_policy( demand, mean = FALSE, sd = FALSE, leadtime, service_level, initial_inventory_level = FALSE, Max = FALSE, Review_period, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", recalculate = FALSE, recalculate_windows = FALSE, plot = FALSE, Backlogs = TRUE )
demand |
A vector of demand in N time periods. |
mean |
average demand in N time periods.default is FALSE and is automatically calculated. otherwise set manually. |
sd |
standard deviation in N time periods.default is FALSE and is automatically calculated. otherwise set manually. |
leadtime |
lead time from order to arrival (order to delivery time) |
service_level |
cycle service level requested |
initial_inventory_level |
integer,Default is False and simulation starts with min as inventory level |
Max |
integer,Default is False and max is calculated as a ratio to min,otherwise set manually. |
Review_period |
Integer, the number of periods where every order is allowed to be made. |
shortage_cost |
numeric,Default is FALSE shortage cost per unit of sales lost |
inventory_cost |
numeric,Default is FALSE inventory cost per unit. |
ordering_cost |
numeric,Default is FALSE ordering cost for every time an order is made. |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom' |
recalculate |
Logical, if true the mean and sd is recalculated every period from first period to t,default is FALSE . |
recalculate_windows |
integer, the min mean and sd windows to recalculate , for example if it is set to 4 mean and sd is calculated from t to t-4,,default is FALSE, if TRUE, recalculate has to be TRUE Also. |
plot |
Logical, Default is False, if true a plot is generated |
Backlogs |
Logical, Default is False, if true inventory level accounts for previous lost orders |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. Max - inventory position is ordered at the period of review
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
periodic_policy(demand = rpois(90,9),service_level = 0.9, leadtime = 10,Review_period = 10,recalculate = TRUE,Backlogs=TRUE)
periodic_policy(demand = rpois(90,9),service_level = 0.9, leadtime = 10,Review_period = 10,recalculate = TRUE,Backlogs=TRUE)
Simulating a periodic policy, different from R,s,S because here order is made at the ordering time without a min(reordering quantity) the Max is dynamically calculated based on a forecast vector. .
periodic_policy_dynamic( demand, forecast, leadtime, Review_period, service_level, initial_inventory_level = FALSE, one_step_forecast = TRUE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", error_metric = "mse", smoothing_error = 0.2, metric_windows = FALSE, plot = FALSE, Backlogs = FALSE )
periodic_policy_dynamic( demand, forecast, leadtime, Review_period, service_level, initial_inventory_level = FALSE, one_step_forecast = TRUE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", error_metric = "mse", smoothing_error = 0.2, metric_windows = FALSE, plot = FALSE, Backlogs = FALSE )
demand |
A vector of demand in N time periods. |
forecast |
the forecast vector of equal n periods to demand. |
leadtime |
lead time from order to arrival (order to delivery time) |
Review_period |
Integer, the number of periods where every order is allowed to be made. |
service_level |
cycle service level requested |
initial_inventory_level |
integer,Default is False and simulation starts with min as inventory level |
one_step_forecast |
logical, Default is true where demand lead time is calcluated as(forecast at period t * leadtime) while if False, demand leadtime is calculated as (forecast of period t to forecast of period t+leadtime-1) |
shortage_cost |
numeric,Default is FALSE shortage cost per unit of sales lost |
inventory_cost |
numeric,Default is FALSE inventory cost per unit. |
ordering_cost |
numeric,Default is FALSE ordering cost for every time an order is made. |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom' |
error_metric |
metric is currently 'rmse' and 'mae', this calculates the error from period 1 to period t unless metric_windows is set. this contributes to the calculation of saftey stock. default is 'rmse' |
smoothing_error |
number between 0 and 1 to smooth the error as alpha x error[t] + (1-alpha) x error t-1, if metric_windows is used, smoothing error has to be FALSE |
metric_windows |
integer, for exammple if it is set to 4 rmse for t is calculated from t-1 to t-4,default is FALSE |
plot |
Logical, Default is False, if true a plot is generated |
Backlogs |
Logical, Default is False, if true inventory level accounts for previous lost orders |
The Function takes a demand vector, forecast vector and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. Max - inventory position is ordered at the period of review
a list of two date frames, the simulation and the metrics. the metrics are (1) shortage cost, (2) inventory cost which is the cost of one unit of inventory in one period,(3) which is the average inventory level per period, (4) total orders made in the simulation, (5) ordering cost if any, (6) total lost sales if any,(7) average ordering quantity across all orders,(8) ordering interval which is the average time between each order,(9) item fill rate,(10) cycle service level, (11) average saftey stock in each period,(12) the average sales in every order,(13) overall root mean square error, (14) overall mean absolute error, (14) overall mean error,(15) overall mean absolute percentage error,(16) the average flowttime which is the average time a unit spends on inventory and (17) the demand classification.
"haytham omar email: <[email protected]>"
periodic_policy_dynamic(demand = rpois(90,9),forecast = rpois(90,9), service_level = 0.9,leadtime = 10,Review_period = 10)
periodic_policy_dynamic(demand = rpois(90,9),forecast = rpois(90,9), service_level = 0.9,leadtime = 10,Review_period = 10)
Simulating a Periodic order up to level policy, .
Periodic_review_normal( demand, mean, sd, leadtime, service_level, Review_period, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
Periodic_review_normal( demand, mean, sd, leadtime, service_level, Review_period, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
demand |
A vector of demand in N time periods. |
mean |
average demand in N time periods. |
sd |
standard deviation in N time periods. |
leadtime |
lead time from order to arrival |
service_level |
cycle service level requested |
Review_period |
the period where the ordeering happens. |
shortage_cost |
shortage cost per unit of sales lost |
inventory_cost |
inventory cost per unit. |
ordering_cost |
ordering cost for every time an order is made. |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate and inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the order up to level is calculated based on the review period,lead time and normal distribution .
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
Periodic_review_normal(demand=rpois(80,6),mean=6,sd=0.2,leadtime=5,service_level=0.95, Review_period =9, shortage_cost= FALSE,inventory_cost=FALSE,ordering_cost=FALSE)
Periodic_review_normal(demand=rpois(80,6),mean=6,sd=0.2,leadtime=5,service_level=0.95, Review_period =9, shortage_cost= FALSE,inventory_cost=FALSE,ordering_cost=FALSE)
Simulating a Periodic order up to level policy, .
Periodic_review_pois( demand, lambda, leadtime, service_level, Review_period, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
Periodic_review_pois( demand, lambda, leadtime, service_level, Review_period, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
demand |
A vector of demand in N time periods. |
lambda |
rate of demand in N time periods. |
leadtime |
lead time from order to arrival |
service_level |
cycle service level requested |
Review_period |
the period where the ordering happens. |
shortage_cost |
shortage cost per unit of sales lost |
inventory_cost |
inventory cost per unit. |
ordering_cost |
ordering cost for every time an order is made. |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate and inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the order up to level is calculated based on the review period,lead time and Poisson distribution .
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
Periodic_review_pois(demand=rpois(80,6),lambda=6,leadtime=5,service_level=0.95, Review_period =9, shortage_cost= FALSE,inventory_cost=FALSE,ordering_cost=FALSE)
Periodic_review_pois(demand=rpois(80,6),lambda=6,leadtime=5,service_level=0.95, Review_period =9, shortage_cost= FALSE,inventory_cost=FALSE,ordering_cost=FALSE)
a markdown model This is a markdown model proposed in Walker, John. "A model for determining price markdowns of seasonal merchandise." Journal of Product & Brand Management (1999), the idea that it is possible for seasonal merchandise to forecast how much for a specific product can be left at the end of the season. based on the sales rate in the periods of the selling season. for example, if a seasonal shirt initial buying quantity is 500, during the the first two weeks we sold 100 and the season for this shirt is 6 weeks, then it is possible to forecast for a one time shot product how much is expected to be left with at the end of the season (at the end of the 6 weeks), the function applies the algorithm in walker (1999), the returning value is a classification of the item if it is a slow moving or a regular item. also the possible markdowns that can be applied. (only markdowns where there is a economic viability) and this can be a dynamic markdown process where the process can be repeated every week, preferably when the product changes its status from Regular to slow moving. if the markdown recommendation is for example 0.9 then it means that the new price is 90
possible_markdowns( begining_inventory, weeks, current_week, inventory_at_week, expected_at_season_end, plot = TRUE )
possible_markdowns( begining_inventory, weeks, current_week, inventory_at_week, expected_at_season_end, plot = TRUE )
begining_inventory |
inventory at the beginning of the season before selling. |
weeks |
number of weeks in the season. |
current_week |
the end of the current week. |
inventory_at_week |
inventory at the end of the current week. |
expected_at_season_end |
expected inventory left for salvage or writing off at the end of the season, if the forecast is below it, then it becomes a regular item if the forecast is higher than expected at season end then it becomes a slow moving item. |
plot |
Default is false,if true, a plot is generated |
a dataframe that contains all tthe possible economically viable markdowns.
"haytham omar email: <[email protected]>"
possible_markdowns(begining_inventory=1000,weeks=16, current_week=2,inventory_at_week=825,expected_at_season_end=150,plot=TRUE)
possible_markdowns(begining_inventory=1000,weeks=16, current_week=2,inventory_at_week=825,expected_at_season_end=150,plot=TRUE)
Identyfing ABC category based on the pareto rule for both demand and selling price,a mix of nine categories are produced. Identyfing ABC category based on the pareto rule.A category is up to 80
productmix(SKUs, sales, revenue, na.rm = TRUE, plot = FALSE)
productmix(SKUs, sales, revenue, na.rm = TRUE, plot = FALSE)
SKUs |
charachter, a vector of SKU names. |
sales |
vector, a vector of items sold per sku, should be the same number of rows as SKU. |
revenue |
price vector, a vector of total revenu per sku, should be the same number of rows as SKU. |
na.rm |
, logical and by default is TRUE |
plot |
default is FALSE,if true a plot is generated |
a dataframe that contains ABC categories with a bar plot of the count of items in each category.
this is the first version of the inventorize package, all the fucntions are common knowlege for supply chain without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
productmix(SKUs=c(1:100),sales=runif(100,1,1000),revenue = rnorm(100,200,10),na.rm=TRUE)
productmix(SKUs=c(1:100),sales=runif(100,1,1000),revenue = rnorm(100,200,10),na.rm=TRUE)
Identyfing ABC category based on the pareto rule for both demand and selling price,a mix of nine categories are produced. Identyfing ABC category based on the pareto rule.A category is up to 80 in this fuction the data is splitted by store and a product mix is made on each store individually.
productmix_storelevel( SKUs, sales, revenue, storeofsku, na.rm = TRUE, plot = FALSE )
productmix_storelevel( SKUs, sales, revenue, storeofsku, na.rm = TRUE, plot = FALSE )
SKUs |
charachter, a vector of SKU names. |
sales |
vector, a vector of items sold per sku, should be the same number of rows as SKUs. |
revenue |
vector, a vector of total revenue per sku, should be the same number of rows as SKUs. |
storeofsku |
vector, which store the SKU is sold at.should be the same number of rows as SKUs. |
na.rm |
logical and by default is TRUE |
plot |
default is FALSE,if true a plot is generated |
a dataframe that contains ABC categories by store with a bar plot of the count of items in each category.
this is the first version of the inventorize package, all the functions are common knowledge for supply chain without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
productmix_storelevel(c(1:1000),sales = runif(1000,4,10000), revenue = rnorm(1000,100,20),storeofsku = rep(seq(1:10),100))
productmix_storelevel(c(1:1000),sales = runif(1000,4,10000), revenue = rnorm(1000,100,20),storeofsku = rep(seq(1:10),100))
maxmizing profit based on chage in price and elasticity.
profit_max(cost, salesP1, salesP2, priceP1, priceP2, na.rm = TRUE)
profit_max(cost, salesP1, salesP2, priceP1, priceP2, na.rm = TRUE)
cost |
numeric, cost of the SKU. |
salesP1 |
integer, unit sales in period 1. |
salesP2 |
integer unit sales in period 2. |
priceP1 |
numeric, average price of sku in period 1. |
priceP2 |
average price of sku in period 2. |
na.rm |
logical with a default of TRUE |
This function is helpful to determine the elasticity of a product with effect to price change, the figure could be negative as the change is price is negative. it translates as for one currency unit change in price, this much is ecpected in units in increase of sales. condition must be that Price in period one was more than price in period 2 and sales in period two was more than sales in period 1. a proposed price is given to period 3 which is future period to maxmize profit. it is advisable that elasticity to be calibrated by testing it on several periods. this function does not take into account advertising and campaigns,i.e external factors. yet it's a good indicator of best pricing per SKU.
the elasticity ratio in unit sales, the -ve number represents the increase in sales for each decrease of unit currency.
"haytham omar email: <[email protected]>"
profit_max(cost=2,salesP1=50,salesP2=100,priceP1=6,priceP2=4)
profit_max(cost=2,salesP1=50,salesP2=100,priceP1=6,priceP2=4)
maxmizing profit based on chage in price and elasticity taking into consideration fixed and variable costs.
profit_max_withfixedcost( fixed_cost, variable_cost, salesP1, salesP2, priceP1, priceP2 )
profit_max_withfixedcost( fixed_cost, variable_cost, salesP1, salesP2, priceP1, priceP2 )
fixed_cost |
numeric, fixed cost for ordering and handling the SKU. |
variable_cost |
numeric, the cost of the SKU, changing by quantity. |
salesP1 |
integer, unit sales in period 1. |
salesP2 |
integer unit sales in period 2. |
priceP1 |
numeric, average price of sku in period 1. |
priceP2 |
average price of sku in period 2. |
This function is helpful to determine the elasticity of a product with effect to price change, the figure could be negative as the change is price is negative. it translates as for one currency unit change in price, this much is ecpected in units in increase of sales. condition must be that Price in period one was more than price in period 2 and sales in period two was more than sales in period 1. a proposed price is given to period 3 which is future period to maxmize profit. it is advisable that elasticity to be calibrated by testing it on several periods. this function does not take into account advertising and campaigns,i.e external factors. yet it's a good indicator of best pricing per SKU.
the elasticity ratio in unit sales, the -ve number represents the increase in sales for each decrease of unit currency.
"haytham omar email: <[email protected]>"
profit_max_withfixedcost(fixed_cost=200,variable_cost=20,salesP1=50,salesP2=100,priceP1=6,priceP2=4)
profit_max_withfixedcost(fixed_cost=200,variable_cost=20,salesP1=50,salesP2=100,priceP1=6,priceP2=4)
Simulating a Min Max periodic policy or also called R,s,S policy,R represents the ordering/review period. .
R_s_S( demand, mean = FALSE, sd = FALSE, leadtime, service_level, initial_inventory_level = FALSE, min = FALSE, Max = FALSE, Min_to_max = 0.6, Review_period, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", recalculate = FALSE, recalculate_windows = FALSE, plot = FALSE, Backlogs = TRUE )
R_s_S( demand, mean = FALSE, sd = FALSE, leadtime, service_level, initial_inventory_level = FALSE, min = FALSE, Max = FALSE, Min_to_max = 0.6, Review_period, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", recalculate = FALSE, recalculate_windows = FALSE, plot = FALSE, Backlogs = TRUE )
demand |
A vector of demand in N time periods. |
mean |
average demand in N time periods.default is FALSE and is automatically calculated. otherwise set manually. |
sd |
standard deviation in N time periods.default is FALSE and is automatically calculated. otherwise set manually. |
leadtime |
lead time from order to arrival (order to delivery time) |
service_level |
cycle service level requested |
initial_inventory_level |
integer,Default is False and simulation starts with min as inventory level |
min |
integer,Default is False and min is calculated based on mean,demand and lead time unless set manually |
Max |
integer,Default is False and max is calculated as a ratio to min,otherwise set manually. |
Min_to_max |
numeric, the ratio of min to max calculation , default 0.6 but can be changed manually |
Review_period |
Integer, the number of periods where every order is allowed to be made. |
shortage_cost |
numeric,Default is FALSE shortage cost per unit of sales lost |
inventory_cost |
numeric,Default is FALSE inventory cost per unit. |
ordering_cost |
numeric,Default is FALSE ordering cost for every time an order is made. |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom' |
recalculate |
Logical, if true the mean and sd is recalculated every period from first period to t,default is FALSE . |
recalculate_windows |
integer, the min mean and sd windows to recalculate , for example if it is set to 4 mean and sd is calculated from t to t-4,,default is FALSE, if TRUE, recalculate has to be TRUE Also. |
plot |
Logical, Default is False, if true a plot is generated |
Backlogs |
Logical, Default is False, if true inventory level accounts for previous lost orders |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. Max - inventory position is ordered whenever inventory position reaches min at the priod of review
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
R_s_S(demand = rpois(90,9),service_level = 0.97,leadtime = 10, Review_period = 10,Backlogs=TRUE)
R_s_S(demand = rpois(90,9),service_level = 0.97,leadtime = 10, Review_period = 10,Backlogs=TRUE)
Simulating a Min Max periodic policy or also called R,s,S policy, R represents the ordering/review period, the Max is dynamically calculated based on a forecast vector. .
R_s_S_dynamic( demand, forecast, leadtime, Review_period, service_level, initial_inventory_level = FALSE, Min_to_max = 0.6, min = FALSE, one_step_forecast = TRUE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", error_metric = "mse", metric_windows = FALSE, smoothing_error = 0.2, plot = FALSE, Backlogs = TRUE )
R_s_S_dynamic( demand, forecast, leadtime, Review_period, service_level, initial_inventory_level = FALSE, Min_to_max = 0.6, min = FALSE, one_step_forecast = TRUE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", error_metric = "mse", metric_windows = FALSE, smoothing_error = 0.2, plot = FALSE, Backlogs = TRUE )
demand |
A vector of demand in N time periods. |
forecast |
the forecast vector of equal n periods to demand. |
leadtime |
lead time from order to arrival (order to delivery time) |
Review_period |
Integer, the number of periods where every order is allowed to be made. |
service_level |
cycle service level requested |
initial_inventory_level |
integer,Default is False and simulation starts with min as inventory level |
Min_to_max |
numeric, the ratio of min to max calculation , default 0.6 but can be changed manually. |
min |
integer,Default is False and min is calculated based on Min_to_max but can be set manually. |
one_step_forecast |
logical, Default is true where demand lead time is calcluated as(forecast at period t * leadtime) while if False, demand leadtime is calculated as (forecast of period t to forecast of period t+leadtime-1) |
shortage_cost |
numeric,Default is FALSE shortage cost per unit of sales lost |
inventory_cost |
numeric,Default is FALSE inventory cost per unit. |
ordering_cost |
numeric,Default is FALSE ordering cost for every time an order is made. |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom' |
error_metric |
metric is currently 'rmse' and 'mae', this calculates the error from period 1 to period t unless metric_windows is set. this contributes to the calculation of saftey stock. default is 'rmse' |
metric_windows |
integer, for exammple if it is set to 4 rmse for t is calculated from t-1 to t-4,default is FALSE |
smoothing_error |
number between 0 and 1 to smooth the error as alpha x error[t] + (1-alpha)x error t-1, if metric_windows is used, smoothing error has to be FALSE |
plot |
Logical, Default is False, if true a plot is generated |
Backlogs |
Logical, Default is False, if true inventory level accounts for previous lost orders |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. Max - inventory position is ordered whenever inventory position reaches min at the priod of review
a list of two date frames, the simulation and the metrics. the metrics are (1) shortage cost, (2) inventory cost which is the cost of one unit of inventory in one period,(3) which is the average inventory level per period, (4) total orders made in the simulation, (5) ordering cost if any, (6) total lost sales if any,(7) average ordering quantity across all orders,(8) ordering interval which is the average time between each order,(9) item fill rate,(10) cycle service level, (11) average saftey stock in each period,(12) the average sales in every order,(13) overall root mean square error, (14) overall mean absolute error, (14) overall mean error,(15) overall mean absolute percentage error,(16) the average flowttime which is the average time a unit spends on inventory and (17) the demand classification.
"haytham omar email: <[email protected]>"
R_s_S_dynamic(demand = rpois(90,9),forecast = rpois(90,9),service_level = 0.9, leadtime = 10,Review_period = 10,min = 70,Backlogs=TRUE)
R_s_S_dynamic(demand = rpois(90,9),forecast = rpois(90,9),service_level = 0.9, leadtime = 10,Review_period = 10,min = 70,Backlogs=TRUE)
Calculating saftey stock based on the cycle service level.
reorderpoint( dailydemand, dailystandarddeviation, leadtimein_days, csl, distribution = "normal" )
reorderpoint( dailydemand, dailystandarddeviation, leadtimein_days, csl, distribution = "normal" )
dailydemand |
numeric,daily Expected demand of the SKU . |
dailystandarddeviation |
numeric, standard deviation of daily demand of the SKU . |
leadtimein_days |
leadtime in days of order.. |
csl |
cycle service level requested |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom'. |
Calculating re-order point based on demand variability without lead time variability in an assumed normal distribution. cycle service level is provided to calculate saftey stock accordingly.
a dataframe that contains demand lead time,sigmadl,safteyfactor and re_order point.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
reorderpoint(dailydemand=50,dailystandarddeviation=5,leadtimein_days=6,csl=0.90)
reorderpoint(dailydemand=50,dailystandarddeviation=5,leadtimein_days=6,csl=0.90)
Calculating saftey stock based on the cycle service level.
reorderpoint_leadtime_variability( dailydemand, dailystandarddeviation, leadtimein_days, sd_leadtime_days, csl, distribution = "nbinom" )
reorderpoint_leadtime_variability( dailydemand, dailystandarddeviation, leadtimein_days, sd_leadtime_days, csl, distribution = "nbinom" )
dailydemand |
numeric,daily Expected demand of the SKU . |
dailystandarddeviation |
numeric, standard deviation of daily demand of the SKU . |
leadtimein_days |
leadtime in days of order. |
sd_leadtime_days |
standard deviation of leadtime in days of order. |
csl |
cycle service level requested |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom' |
Calculating re-order point based on demand variability and lead time variability in an assumed normal distribution. cycle service level is provided to calculate saftey stock accordingly.
a dataframe that contains demand lead time,sigmadl,safteyfactor and re_order point.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
reorderpoint_leadtime_variability(dailydemand=50,dailystandarddeviation=5, leadtimein_days=6,sd_leadtime_days=2,csl=0.90)
reorderpoint_leadtime_variability(dailydemand=50,dailystandarddeviation=5, leadtimein_days=6,sd_leadtime_days=2,csl=0.90)
maxmizing revenue based on chage in price and elasticity.
revenue_max(salesP1, salesP2, priceP1, priceP2, na.rm = TRUE)
revenue_max(salesP1, salesP2, priceP1, priceP2, na.rm = TRUE)
salesP1 |
integer, unit sales in period 1. |
salesP2 |
integer unit sales in period 2. |
priceP1 |
numeric, average price of sku in period 1. |
priceP2 |
average price of sku in period 2. |
na.rm |
logical with a default of TRUE |
#' This function is helpful to determine the elasticity of a product with effect to price change, the figure could be negative as the change is price is negative. it translates as for each unit percentage decrease in price , this much is ecpected precentage of increase of sales. condition must be that Price in period one was more than proce in period 2 and sales in period two was more than sales in period 1. a proposed optimum price is given to period 3 which is future period to maxmize revenue.
the elasticity ratio in unit sales, the -ve number represents the increase in sales for each decrease of unit currency.
"haytham omar email: <[email protected]>"
revenue_max(salesP1=50,salesP2=100,priceP1=6,priceP2=4)
revenue_max(salesP1=50,salesP2=100,priceP1=6,priceP2=4)
Calculating saftey stock based on the cycle service level.
saftey_stock_normal( annualdemand, annualstandarddeviation, leadtimeinweeks, csl, na.rm = TRUE )
saftey_stock_normal( annualdemand, annualstandarddeviation, leadtimeinweeks, csl, na.rm = TRUE )
annualdemand |
numeric,annual Expected demand of the SKU . |
annualstandarddeviation |
numeric, standard deviation of the SKU during season. |
leadtimeinweeks |
leadtime in weeks or order. |
csl |
cycle service level requested |
na.rm |
Logical, remove na if TRUE |
Calculating saftey stock based on the cycle service level in an assumed normal distribution.
a dataframe that contains calculations of K the cost per item short metric noting that condition must me less than 1.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
saftey_stock_normal(annualdemand=8000,annualstandarddeviation=600, leadtimeinweeks=4,csl=0.92,na.rm=TRUE)
saftey_stock_normal(annualdemand=8000,annualstandarddeviation=600, leadtimeinweeks=4,csl=0.92,na.rm=TRUE)
Calculating K value that reduces cost per item short.
safteystock_CIS_normal( quantity, demand, standerddeviation, leadtimeinweeks, cost, Citemshort, holdingrate, na.rm = TRUE )
safteystock_CIS_normal( quantity, demand, standerddeviation, leadtimeinweeks, cost, Citemshort, holdingrate, na.rm = TRUE )
quantity |
numeric,quantity replinished every cycle. |
demand |
numeric,annual Expected demand of the SKU . |
standerddeviation |
numeric, standard deviation of the SKU during season. |
leadtimeinweeks |
leadtime in weeks or order. |
cost |
numeric,cost of the SKU |
Citemshort |
numeric, peanlity cost of not satisfying demand if any, if not, zero is placed in the argument. |
holdingrate |
numeric,,holding charge per item per year. |
na.rm |
Logical, True to remove na. |
Calculating K value that reduces cost per item short inventory metric based on an assumed normal distribution.
a dataframe that contains calculations of K the cost per item short metric noting that condition must me less than 1.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
safteystock_CIS_normal(quantity=3000,demand=50000,standerddeviation=4000, leadtimeinweeks=4,cost=90,Citemshort=15,holdingrate=0.15,na.rm=TRUE)
safteystock_CIS_normal(quantity=3000,demand=50000,standerddeviation=4000, leadtimeinweeks=4,cost=90,Citemshort=15,holdingrate=0.15,na.rm=TRUE)
calculating saftey stock based on cycle service level rate.
safteystock_CSL_normal( rate, quantity, demand, standerddeviation, leadtime, na.rm = TRUE )
safteystock_CSL_normal( rate, quantity, demand, standerddeviation, leadtime, na.rm = TRUE )
rate |
cycle service level requested. |
quantity |
quantity ordered every cycle. |
demand |
numeric, expected annual demand of the SKU. |
standerddeviation |
numeric annual standard deviation of the demand. |
leadtime |
numeric,leadtime of order in weeks. |
na.rm |
logical with a default of TRUE |
calculating saftey stock and expected unit short based on the cycle service identified assuming a normal distribution.
a dataframe that contains calculations of the expected profit from a newsvendor model based on normal distribution.
"haytham omar email: <[email protected]>"
safteystock_CSL_normal(rate=0.95,quantity=30000,demand=28000,standerddeviation=5000,8,na.rm=TRUE)
safteystock_CSL_normal(rate=0.95,quantity=30000,demand=28000,standerddeviation=5000,8,na.rm=TRUE)
Calculating K value corresponding to item fill rate.
safteystock_IFR_normal( rate, quantity, demand, standerddeviation, leadtime, na.rm = TRUE )
safteystock_IFR_normal( rate, quantity, demand, standerddeviation, leadtime, na.rm = TRUE )
rate |
numeric, item fill rate. |
quantity |
numeric,quantity replinished every cycle. |
demand |
numeric,annual Expected demand of the SKU . |
standerddeviation |
numeric, standard deviation of the SKU during season. |
leadtime |
leadtime in weeks of order. |
na.rm |
Logical, TRUE to remove na. |
Calculating K value that corresponds to the desired item fill rate.
a dataframe that contains calculations of K the item fill rate metric.cycle service level and expected unit short.
this is the first version of the inventorize package, all the fucntions are basic knowlege for supply chain without any contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
safteystock_IFR_normal(rate=0.97,quantity=9000,demand=100000, standerddeviation=5000,leadtime=4,na.rm=TRUE)
safteystock_IFR_normal(rate=0.97,quantity=9000,demand=100000, standerddeviation=5000,leadtime=4,na.rm=TRUE)
Simulating a Base Stock policy.
sim_base_normal( demand, mean, sd, leadtime, service_level, Base = FALSE, ordering_delay = FALSE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
sim_base_normal( demand, mean, sd, leadtime, service_level, Base = FALSE, ordering_delay = FALSE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
demand |
A vector of demand in N time periods. |
mean |
average demand in N time periods. |
sd |
standard deviation in N time periods. |
leadtime |
lead time from order to arrival |
service_level |
cycle service level requested |
Base |
Set to False for automatic calculation,else manual input of base. |
ordering_delay |
logical,Default is FALSE,if TRUE, orders are delayed one period. |
shortage_cost |
shortage cost per unit of sales lost |
inventory_cost |
inventory cost per unit. |
ordering_cost |
ordering cost for every time an order is made. |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate and inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated based on a normal distribution. the base is calculated automatically based on the mean demand and standard deviaiton. every period the order is exactly as the sales.
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
sim_base_normal(demand=rpois(80,6),mean=6,sd=0.2,leadtime=5,service_level=0.95,Base = 50, shortage_cost= 1,inventory_cost=1,ordering_cost=1,ordering_delay=FALSE)
sim_base_normal(demand=rpois(80,6),mean=6,sd=0.2,leadtime=5,service_level=0.95,Base = 50, shortage_cost= 1,inventory_cost=1,ordering_cost=1,ordering_delay=FALSE)
Simulating a Min,max policy or aslo called s,S policy, .
sim_base_pois( demand, lambda, leadtime, service_level, Base = FALSE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_delay = FALSE, ordering_cost = FALSE )
sim_base_pois( demand, lambda, leadtime, service_level, Base = FALSE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_delay = FALSE, ordering_cost = FALSE )
demand |
A vector of demand in N time periods. |
lambda |
rate of demand in N time periods. |
leadtime |
lead time from order to arrival |
service_level |
cycle service level requested |
Base |
Set to False for automatic calculation,else manual input of base. |
shortage_cost |
shortage cost per unit of sales lost. |
inventory_cost |
inventory cost per unit. |
ordering_delay |
logical,Default is FALSE,if TRUE, orders are delayed one period. |
ordering_cost |
ordering cost for every time an order is made. |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate and inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated based on poisson distribution..
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
sim_base_pois(demand = rpois(50,8),lambda = 4,leadtime = 4,shortage_cost = 20,ordering_delay=FALSE, Base = FALSE,service_level = 0.70,inventory_cost = 50,ordering_cost=50)
sim_base_pois(demand = rpois(50,8),lambda = 4,leadtime = 4,shortage_cost = 20,ordering_delay=FALSE, Base = FALSE,service_level = 0.70,inventory_cost = 50,ordering_cost=50)
Simulating a base stock policy where order is made every period equal to the demand sold and having a Base stock enough for leadtime and saftey stock. The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. demand and base adjustment (if any) is ordered every period.
sim_base_stock_policy( demand, mean = FALSE, sd = FALSE, leadtime, service_level, Base = FALSE, ordering_delay = FALSE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", recalculate = FALSE, recalculate_windows = FALSE, plot = FALSE )
sim_base_stock_policy( demand, mean = FALSE, sd = FALSE, leadtime, service_level, Base = FALSE, ordering_delay = FALSE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", recalculate = FALSE, recalculate_windows = FALSE, plot = FALSE )
demand |
A vector of demand in N time periods. |
mean |
average demand in N time periods.default is FALSE and is automatically calculated. otherwise set manually. |
sd |
standard deviation in N time periods.default is FALSE and is automatically calculated. otherwise set manually. |
leadtime |
lead time from order to arrival (order to delivery time) |
service_level |
cycle service level requested |
Base |
integer,Default is False and calculated based on mean and sd(normal) or rate of demand (poisson) |
ordering_delay |
logical,Default is FALSE,if TRUE, orders are delayed one period. |
shortage_cost |
numeric,Default is FALSE shortage cost per unit of sales lost |
inventory_cost |
numeric,Default is FALSE inventory cost per unit. |
ordering_cost |
numeric,Default is FALSE ordering cost for every time an order is made. |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' or 'poisson' |
recalculate |
integer, the mean and sd is recalculated every X periods from first period to x,default is FALSE . |
recalculate_windows |
integer, the min mean and sd windows to recalculate , for exammple if it is set to 4 mean and sd is calculated from t to t-4,,default is FALSE . |
plot |
Logical, Default is False, if true a plot is generated |
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
sim_base_stock_policy(demand = rpois(90,8),leadtime = 6,service_level = 0.95,recalculate = 5)
sim_base_stock_policy(demand = rpois(90,8),leadtime = 6,service_level = 0.95,recalculate = 5)
Simulating a min max policy or also called s,S policy, . The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. Max - inventory position is ordered whenever inventory position reaches min
sim_min_max( demand, mean = FALSE, sd = FALSE, leadtime, service_level, initial_inventory_level = FALSE, min = FALSE, Max = FALSE, Max_to_min = 1.3, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", recalculate = FALSE, recalculate_windows = FALSE, plot = FALSE, Backlogs = FALSE )
sim_min_max( demand, mean = FALSE, sd = FALSE, leadtime, service_level, initial_inventory_level = FALSE, min = FALSE, Max = FALSE, Max_to_min = 1.3, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", recalculate = FALSE, recalculate_windows = FALSE, plot = FALSE, Backlogs = FALSE )
demand |
A vector of demand in N time periods. |
mean |
average demand in N time periods.default is FALSE and is automatically calculated. otherwise set manually. |
sd |
standard deviation in N time periods.default is FALSE and is automatically calculated. otherwise set manually. |
leadtime |
lead time from order to arrival (order to delivery time) |
service_level |
cycle service level requested |
initial_inventory_level |
integer,Default is False and simulation starts with min as inventory level |
min |
integer,Default is False and min is calculated based on mean,demand and lead time unless set manually |
Max |
integer,Default is False and max is calculated as a ratio to min,otherwise set manually. |
Max_to_min |
numeric, the ratio of Max to min calculation , default 1.3 but can be changed manually. |
shortage_cost |
numeric,Default is FALSE shortage cost per unit of sales lost |
inventory_cost |
numeric,Default is FALSE inventory cost per unit. |
ordering_cost |
numeric,Default is FALSE ordering cost for every time an order is made. |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom' |
recalculate |
Logical, if true the mean and sd is recalculated every period from first period to t,default is FALSE . |
recalculate_windows |
integer, the min mean and sd windows to recalculate , for example if it is set to 4 mean and sd is calculated from t to t-4,,default is FALSE, if TRUE, recalculate has to be TRUE Also. |
plot |
Logical, Default is False, if true a plot is generated |
Backlogs |
Logical, Default is False, if true inventory level accounts for previous lost orders |
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
sim_min_max(demand = rpois(80,6),leadtime = 4,service_level = 0.95,recalculate = TRUE)
sim_min_max(demand = rpois(80,6),leadtime = 4,service_level = 0.95,recalculate = TRUE)
Simulating a min max policy or also called s,S policy, the Max is dynamically calculated based on a forecast vector. . The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. Max - inventory position is ordered whenever inventory position reaches min
sim_min_max_dynamic( demand, forecast, leadtime, service_level, initial_inventory_level = FALSE, Max_to_min = 1.5, Max = FALSE, one_step_forecast = TRUE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", error_metric = "mse", smoothing_error = 0.2, metric_windows = FALSE, plot = FALSE, Backlogs = FALSE )
sim_min_max_dynamic( demand, forecast, leadtime, service_level, initial_inventory_level = FALSE, Max_to_min = 1.5, Max = FALSE, one_step_forecast = TRUE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", error_metric = "mse", smoothing_error = 0.2, metric_windows = FALSE, plot = FALSE, Backlogs = FALSE )
demand |
A vector of demand in N time periods. |
forecast |
the forecast vector of equal n periods to demand. |
leadtime |
lead time from order to arrival (order to delivery time) |
service_level |
cycle service level requested |
initial_inventory_level |
integer,Default is False and simulation starts with min as inventory level |
Max_to_min |
numeric, the ratio of Max to min calculation , default 1.3 but can be changed manually. |
Max |
integer,Default is False and max is calculated as a ratio to min,otherwise set manually. |
one_step_forecast |
logical, Default is true where demand lead time is calcluated as(forecast at period t * leadtime) while if False, demand leadtime is calculated as (forecast of period t to forecast of period t+leadtime-1) |
shortage_cost |
numeric,Default is FALSE shortage cost per unit of sales lost |
inventory_cost |
numeric,Default is FALSE inventory cost per unit. |
ordering_cost |
numeric,Default is FALSE ordering cost for every time an order is made. |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom' |
error_metric |
metric is currently 'rmse' and 'mae', this calculates the error from period 1 to period t unless metric_windows is set. this contributes to the calculation of saftey stock. default is 'rmse' |
smoothing_error |
number between 0 and 1 to smooth the error as alpha x error[t] + (1-alpha) x error t-1, if metric_windows is used, smoothing error has to be FALSE |
metric_windows |
integer, for exammple if it is set to 4 rmse for t is calculated from t-1 to t-4,default is FALSE |
plot |
Logical, Default is False, if true a plot is generated |
Backlogs |
Logical, Default is False, if true inventory level accounts for previous lost orders |
a list of two date frames, the simulation and the metrics. the metrics are (1) shortage cost, (2) inventory cost which is the cost of one unit of inventory in one period,(3) which is the average inventory level per period, (4) total orders made in the simulation, (5) ordering cost if any, (6) total lost sales if any,(7) average ordering quantity across all orders,(8) ordering interval which is the average time between each order,(9) item fill rate,(10) cycle service level, (11) average saftey stock in each period,(12) the average sales in every order,(13) overall root mean square error, (14) overall mean absolute error, (14) overall mean error,(15) overall mean absolute percentage error,(16) the average flowttime which is the average time a unit spends on inventory and (17) the demand classification.
"haytham omar email: <[email protected]>"
sim_min_max_dynamic(demand = rpois(90,6),forecast = rpois(90,6), leadtime = 6,service_level = 0.95,one_step_forecast = FALSE,Max = 80, distribution = 'normal',error_metric = 'mae',Backlogs=TRUE)
sim_min_max_dynamic(demand = rpois(90,6),forecast = rpois(90,6), leadtime = 6,service_level = 0.95,one_step_forecast = FALSE,Max = 80, distribution = 'normal',error_metric = 'mae',Backlogs=TRUE)
Simulating a Min,Q policy or also called S,Q policy, . The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. Q (fixed quantity) is ordered whenever inventory position reaches min
sim_min_Q( demand, mean = FALSE, sd = FALSE, leadtime, service_level, initial_inventory_level = FALSE, min = FALSE, Quantity, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", recalculate = FALSE, recalculate_windows = FALSE, plot = FALSE, Backlogs = FALSE )
sim_min_Q( demand, mean = FALSE, sd = FALSE, leadtime, service_level, initial_inventory_level = FALSE, min = FALSE, Quantity, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", recalculate = FALSE, recalculate_windows = FALSE, plot = FALSE, Backlogs = FALSE )
demand |
A vector of demand in N time periods. |
mean |
average demand in N time periods.default is FALSE and is automatically calculated. otherwise set manually. |
sd |
standard deviation in N time periods.default is FALSE and is automatically calculated. otherwise set manually. |
leadtime |
lead time from order to arrival |
service_level |
cycle service level requested |
initial_inventory_level |
integer,Default is False and simulation starts with min as inventory level |
min |
integer,Default is False and min is calculated based on mean,demand and leadtime unless set manually |
Quantity |
Fixed order quantity to be ordered at min |
shortage_cost |
numeric,Default is FALSE shortage cost per unit of sales lost |
inventory_cost |
numeric,Default is FALSE inventory cost per unit. |
ordering_cost |
numeric,Default is FALSE ordering cost for every time an order is made. |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom' |
recalculate |
Logical, if true the mean and sd is recalculated every period from first period to t,default is FALSE . |
recalculate_windows |
integer, the min mean and sd windows to recalculate , for example if it is set to 4 mean and sd is calculated from t to t-4,,default is FALSE, if TRUE, recalculate has to be TRUE Also. |
plot |
Logical, Default is False, if true a plot is generated |
Backlogs |
Logical, Default is False, if true inventory level accounts for previous lost orders is calculated from t to t-4,,default is FALSE . |
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
sim_min_Q(demand = rpois(90,7),leadtime = 5,service_level = 0.95,Quantity = 80, recalculate = TRUE,distribution = 'normal',recalculate_windows = 5,Backlogs=FALSE)
sim_min_Q(demand = rpois(90,7),leadtime = 5,service_level = 0.95,Quantity = 80, recalculate = TRUE,distribution = 'normal',recalculate_windows = 5,Backlogs=FALSE)
Simulating a Min,Q policy or also called S,Q policy, the min is dynamically calculated based on a forecast vector. . The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. Q (fixed quantity) is ordered whenever inventory position reaches min
sim_min_Q_dynamic( demand, forecast, leadtime, service_level, initial_inventory_level = FALSE, Quantity, one_step_forecast = TRUE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", error_metric = "mse", smoothing_error = 0.2, metric_windows = FALSE, plot = FALSE, Backlogs = FALSE )
sim_min_Q_dynamic( demand, forecast, leadtime, service_level, initial_inventory_level = FALSE, Quantity, one_step_forecast = TRUE, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE, distribution = "normal", error_metric = "mse", smoothing_error = 0.2, metric_windows = FALSE, plot = FALSE, Backlogs = FALSE )
demand |
A vector of demand in N time periods. |
forecast |
the forecast vector of equal n periods to demand. |
leadtime |
lead time from order to arrival (order to delivery time) |
service_level |
cycle service level requested |
initial_inventory_level |
integer,Default is False and simulation starts with min as inventory level |
Quantity |
integer,Fixed ordering quantity. |
one_step_forecast |
logical, Default is true where demand lead time is calcluated as(forecast at period t * leadtime) while if False, demand leadtime is calculated as (forecast of period t to forecast of period t+leadtime-1) |
shortage_cost |
numeric,Default is FALSE shortage cost per unit of sales lost |
inventory_cost |
numeric,Default is FALSE inventory cost per unit. |
ordering_cost |
numeric,Default is FALSE ordering cost for every time an order is made. |
distribution |
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom' |
error_metric |
metric is currently 'rmse' and 'mae', this calculates the error from period 1 to period t unless metric_windows is set. this contributes to the calculation of saftey stock. default is 'rmse' |
smoothing_error |
number between 0 and 1 to smooth the error as alpha x error[t] + (1-alpha) x error t-1, if metric_windows is used, smoothing error has to be FALSE |
metric_windows |
integer, for exammple if it is set to 4 rmse for t is calculated from t-1 to t-4,default is FALSE |
plot |
Logical, Default is False, if true a plot is generated. |
Backlogs |
Logical, Default is False, if true inventory level accounts for previous lost orders. |
a list of two date frames, the simulation and the metrics. the metrics are (1) shortage cost, (2) inventory cost which is the cost of one unit of inventory in one period,(3) which is the average inventory level per period, (4) total orders made in the simulation, (5) ordering cost if any, (6) total lost sales if any,(7) average ordering quantity across all orders,(8) ordering interval which is the average time between each order,(9) item fill rate,(10) cycle service level, (11) average saftey stock in each period,(12) the average sales in every order,(13) overall root mean square error, (14) overall mean absolute error, (14) overall mean error,(15) overall mean absolute percentage error,(16) the average flowttime which is the average time a unit spends on inventory and (17) the demand classification.
"haytham omar email: <[email protected]>"
sim_min_Q_dynamic(demand = rpois(90,8),forecast = rpois(90,8),leadtime = 5, service_level = 0.95,Quantity = 80,initial_inventory_level = 80, one_step_forecast=TRUE,shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE,distribution= 'normal', error_metric= 'rmse',metric_windows= FALSE,plot=TRUE)
sim_min_Q_dynamic(demand = rpois(90,8),forecast = rpois(90,8),leadtime = 5, service_level = 0.95,Quantity = 80,initial_inventory_level = 80, one_step_forecast=TRUE,shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE,distribution= 'normal', error_metric= 'rmse',metric_windows= FALSE,plot=TRUE)
Simulating a Min,Q policy or also calleD S,Q policy, .
sim_min_Q_normal( demand, mean, sd, leadtime, service_level, Quantity, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
sim_min_Q_normal( demand, mean, sd, leadtime, service_level, Quantity, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
demand |
A vector of demand in N time periods. |
mean |
average demand in N time periods. |
sd |
standard deviation in N time periods. |
leadtime |
lead time from order to arrival |
service_level |
cycle service level requested |
Quantity |
Fixed order quantity to be ordered at min |
shortage_cost |
shortage cost per unit of sales lost |
inventory_cost |
inventory cost per unit. |
ordering_cost |
ordering cost for every time an order is made. |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate and inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution.
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
sim_min_Q_normal(demand = rpois(50,8),mean = 5,sd=1, service_level = 0.9,leadtime = 4, shortage_cost = 5, Quantity = 12,inventory_cost = 1,ordering_cost = 50)
sim_min_Q_normal(demand = rpois(50,8),mean = 5,sd=1, service_level = 0.9,leadtime = 4, shortage_cost = 5, Quantity = 12,inventory_cost = 1,ordering_cost = 50)
Simulating a Min,Q policy or also calleD S,Q policy, .
sim_min_Q_pois( demand, lambda, leadtime, service_level, Quantity, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
sim_min_Q_pois( demand, lambda, leadtime, service_level, Quantity, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
demand |
A vector of demand in N time periods. |
lambda |
rate of demand in N time periods. |
leadtime |
lead time from order to arrival |
service_level |
cycle service level requested |
Quantity |
Fixed order quantity to be ordered at min |
shortage_cost |
shortage cost per unit of sales lost |
inventory_cost |
inventory cost per unit. |
ordering_cost |
ordering cost for every time an order is made. |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate and inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution.
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
sim_min_Q_pois(demand = rpois(50,8),lambda = 4,leadtime = 4,shortage_cost =30, Quantity = 12,service_level = 0.70, inventory_cost = 50,ordering_cost=FALSE)
sim_min_Q_pois(demand = rpois(50,8),lambda = 4,leadtime = 4,shortage_cost =30, Quantity = 12,service_level = 0.70, inventory_cost = 50,ordering_cost=FALSE)
Simulating a Min,max policy or aslo called s,S policy, .
sim_minmax_normal( demand, mean, sd, leadtime, service_level, Max, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
sim_minmax_normal( demand, mean, sd, leadtime, service_level, Max, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
demand |
A vector of demand in N time periods. |
mean |
average demand in N time periods. |
sd |
standard deviation in N time periods. |
leadtime |
lead time from order to arrival |
service_level |
cycle service level requested |
Max |
Max quantity for order up to level |
shortage_cost |
shortage cost per unit of sales lost |
inventory_cost |
inventory cost per unit. |
ordering_cost |
ordering cost for every time an order is made. |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate and inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution.
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
sim_minmax_normal(demand=rpois(80,6),mean=6,sd=0.2,leadtime=5,service_level=0.95,Max=25, shortage_cost= FALSE,inventory_cost=FALSE,ordering_cost=FALSE)
sim_minmax_normal(demand=rpois(80,6),mean=6,sd=0.2,leadtime=5,service_level=0.95,Max=25, shortage_cost= FALSE,inventory_cost=FALSE,ordering_cost=FALSE)
Simulating a Min,max policy or aslo called s,S policy, .
sim_minmax_pois( demand, lambda, leadtime, service_level, Max, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
sim_minmax_pois( demand, lambda, leadtime, service_level, Max, shortage_cost = FALSE, inventory_cost = FALSE, ordering_cost = FALSE )
demand |
A vector of demand in N time periods. |
lambda |
rate of demand in N time periods. |
leadtime |
lead time from order to arrival |
service_level |
cycle service level requested |
Max |
Max quantity for order up to level |
shortage_cost |
shortage cost per unit of sales lost |
inventory_cost |
inventory cost per unit. |
ordering_cost |
ordering cost for every time an order is made. |
The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate and inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a poisson distribution.
a list of two date frames, the simulation and the metrics.
"haytham omar email: <[email protected]>"
sim_minmax_pois(demand = rpois(50,8),lambda = 4,leadtime = 4,shortage_cost = 20, Max = 32,service_level = 0.70,inventory_cost = 50,ordering_cost=50)
sim_minmax_pois(demand = rpois(50,8),lambda = 4,leadtime = 4,shortage_cost = 20, Max = 32,service_level = 0.70,inventory_cost = 50,ordering_cost=50)
Calculating the optimum price based on linear and logit models for a single product.
single_product_optimization( x, y, service_product_name, degree_poly = 3, current_price, plot = FALSE )
single_product_optimization( x, y, service_product_name, degree_poly = 3, current_price, plot = FALSE )
x |
a vector of average weekly/monthly/daily price data of a product. |
y |
a vector of average weekly/monthly/daily sales data of a product. |
service_product_name |
the name of the product or service. |
degree_poly |
the polynomial degrees, the default is 3. |
current_price |
the current price of the product or service |
plot |
Default is false,if true, a plot is generated |
calculate the optimized price based on the price response function. the price response function is measured twice, one with linear model and one time with a logit model. a simulation is then made with each price response function to define the maximum revenue for each. finally, a suggestion of which model to choose and the optimum price to use for this product. it is preferable to de-seasonalize the sales data before fitting if the sales are affected by spikes and declines due to regular events as holidays and weekends.
a list of the squared error of th logit model, the squared error of the linear model, the best model for this product, the optimum price for both the linear and the logit model, the current price,the a,b,c parameters of th logit model,the linear model paremeters , data simulated at different price points and th expected revenue and the fitting results of both the logit and linear model.
"haytham omar email: <[email protected]>"
single_product_optimization(x= c(5,8,10,12),y=c(25,21,23,15), service_product_name = "Movie",current_price = 8.5,plot=TRUE)
single_product_optimization(x= c(5,8,10,12),y=c(25,21,23,15), service_product_name = "Movie",current_price = 8.5,plot=TRUE)
calculating total logistics cost .
total.logistics.cost( quantity, expected_annual_demand, sd_annual_demand, expected_leadtimeindays, sd_leadtime, costperunit, transportcost, holdingrate, ordering_cost, csl )
total.logistics.cost( quantity, expected_annual_demand, sd_annual_demand, expected_leadtimeindays, sd_leadtime, costperunit, transportcost, holdingrate, ordering_cost, csl )
quantity |
quantity ordered every cycle. |
expected_annual_demand |
numeric, expected annual demand of the SKU. |
sd_annual_demand |
annual standard deviation of the SKU. |
expected_leadtimeindays |
expected lead time in days. |
sd_leadtime |
standard deviation of leadtime |
costperunit |
purchase cost of the SKU |
transportcost |
transport cost of the SKU |
holdingrate |
holding rate of the SKU |
ordering_cost |
ordering cost per order placed |
csl |
cycle service level desired |
calculating total logistics cost based on a normal distribution.
a dataframe that contains calculations of the total logistics cost in detail.
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
total.logistics.cost(quantity=32,expected_annual_demand=1550, sd_annual_demand=110,expected_leadtimeindays=64,sd_leadtime=8, costperunit=107,transportcost=22,holdingrate=0.15,ordering_cost=500,csl=0.95)
total.logistics.cost(quantity=32,expected_annual_demand=1550, sd_annual_demand=110,expected_leadtimeindays=64,sd_leadtime=8, costperunit=107,transportcost=22,holdingrate=0.15,ordering_cost=500,csl=0.95)
Identyfing Practical ordering quantity based on the economic order quantity.it is assumed that practical order quantity will be always withing 6
TQpractical( annualdemand, orderingcost, purchasecost, holdingrate, na.rm = TRUE )
TQpractical( annualdemand, orderingcost, purchasecost, holdingrate, na.rm = TRUE )
annualdemand |
numeric annual demand of the SKU. |
orderingcost |
numeric ordering cost of the SKU. |
purchasecost |
numeric purchase cost of the SKU. |
holdingrate |
numeric holding rate of the SKU. |
na.rm |
logical, TRUE. |
a dataframe that contains the economic order quantity and the practical order quantity, Tstar (optimum)and Tpractical which is always away from the optimum up to 6
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
TQpractical(annualdemand=1000,orderingcost=100, purchasecost=72,holdingrate=0.25,na.rm=TRUE)
TQpractical(annualdemand=1000,orderingcost=100, purchasecost=72,holdingrate=0.25,na.rm=TRUE)
Identyfing Total relevant cost.
TRC(annualdemand, orderingcost, purchasecost, holdingrate, na.rm = TRUE)
TRC(annualdemand, orderingcost, purchasecost, holdingrate, na.rm = TRUE)
annualdemand |
numeric annual demand of the SKU. |
orderingcost |
numeric ordering cost of the SKU. |
purchasecost |
numeric purchase cost of the SKU. |
holdingrate |
numeric holding rate of the SKU. |
na.rm |
logical, TRUE to remove na. |
this is the second version of the inventorize package, all the fucntions are without any academic contribution from my side, the aim is to facilitate and ease much of the bookkeeping that is endured during stock analysis.
"haytham omar email: <[email protected]>"
TRC(annualdemand=2500,orderingcost=250,purchasecost=98, holdingrate=0.25,na.rm=TRUE)
TRC(annualdemand=2500,orderingcost=250,purchasecost=98, holdingrate=0.25,na.rm=TRUE)