This report helps the higher management to forecast the inventory for the Teddy Toy
The management team members have suggested order quantities 15k,18k,24k,28k
Senior forecaster has predicted an expected demand of 20k
Demand would be between 10 and 30k .95 probability
.95 probability in normal distribution has a Z score of 1.96
Calculating Std Deviation using the formula = (x-mean)sd
z=1.96
x=30000
mean= 20000
sd= (x-mean)/z
vec=rnorm(1000,20000,sd)
density=dnorm(vec,mean,sd)
df=data.frame(vec)
hist(vec)
library(ggplot2)
ggplot(df,aes(df$vec))+geom_histogram( aes(y =..density..),
col="red",
fill="green",
alpha = .2,binwidth = 500)+ geom_density(col=2)
myplot = ggplot(df,aes(df$vec))
myplot = myplot + geom_density(fill="yellow",inherit.aes = TRUE,adjust=3,show.legend = TRUE)
myplot = myplot+ geom_vline(aes(xintercept = mean,colour="mean"))
myplot = myplot +geom_vline(aes(xintercept = mean-sd,colour="stand"))
myplot = myplot +geom_vline(aes(xintercept = mean+sd,colour="stand"))
myplot=myplot+ geom_text(aes(x=mean-200, label="Mean",y= mean(density)),angle=90)
myplot=myplot+ geom_text(aes(x=(mean-sd)-200, label="Mean - Sigma",y= mean(density)),angle=90)
myplot=myplot+ geom_text(aes(x=(mean+sd)-200, label="Mean + Sigma",y= mean(density)),angle=90)
myplot
#, colour="blue", angle=90, vjust = 1.2)
#ggplot(df,aes(df$vec)) +stat_density()
orderQty=c(15000,18000,24000,28000)
probs=1-pnorm(orderQty,mean,sd)
probqty=cbind(orderQty,probs)
probqty
## orderQty probs
## [1,] 15000 0.83645694
## [2,] 18000 0.65247089
## [3,] 24000 0.21652006
## [4,] 28000 0.05844057