Code and contents developed by Peter Rossi at UCLA

An Example of new product forecasting using BASS model in R

setwd("~/Desktop/6.NewProductForecasting")
iphone_data=read.csv(file="iphone_sales.csv", header = TRUE)
Sales=ts(iphone_data$Sales, start=c(2007,3), freq=4)

Plot the data

plot(Sales, type="l", lty=2, col="red", ylab = "", xlab="")
points(Sales,pch=20, col="blue" )
title("Quarterly iPhone Sales(millions)")

plot cumulative sales

Y=cumsum(Sales)
Y
##  [1]   0.270   1.389   3.704   5.497   6.214  13.106  17.469  21.262  26.550
## [10]  33.917  42.654  51.406  59.804  73.946  90.181 108.828 129.166 146.239
## [19] 183.283 218.347 244.375 270.285 318.074
Sales
##        Qtr1   Qtr2   Qtr3   Qtr4
## 2007                0.270  1.119
## 2008  2.315  1.793  0.717  6.892
## 2009  4.363  3.793  5.288  7.367
## 2010  8.737  8.752  8.398 14.142
## 2011 16.235 18.647 20.338 17.073
## 2012 37.044 35.064 26.028 25.910
## 2013 47.789
Y=ts(Y, start=c(2007,3), freq=4)
plot(Y, type="l", lty=2, col="red", ylab = "", xlab="")
points(Y,pch=20, col="blue" )
title("Cumulative iPhone Sales(millions)")

Bass Model compute m,p, q

Y=c(0,Y[1:(length(Y)-1)])  # we want Y_t-1 not Y_t.  Y_0 = 0
Y
##  [1]   0.000   0.270   1.389   3.704   5.497   6.214  13.106  17.469  21.262
## [10]  26.550  33.917  42.654  51.406  59.804  73.946  90.181 108.828 129.166
## [19] 146.239 183.283 218.347 244.375 270.285
Ysq=Y**2
out=lm(Sales~Y+Ysq)
summary(out)
## 
## Call:
## lm(formula = Sales ~ Y + Ysq)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -10.3056  -1.1951  -0.4017   0.8912  11.0888 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  1.4752541  1.7170236   0.859 0.400415    
## Y            0.2050036  0.0438064   4.680 0.000144 ***
## Ysq         -0.0002572  0.0001756  -1.464 0.158639    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.949 on 20 degrees of freedom
## Multiple R-squared:  0.8693, Adjusted R-squared:  0.8563 
## F-statistic: 66.54 on 2 and 20 DF,  p-value: 1.45e-09
a=out$coef[1]
b=out$coef[2]
c=out$coef[3]
a
## (Intercept) 
##    1.475254
b
##         Y 
## 0.2050036
c
##           Ysq 
## -0.0002571601
mplus = (-b+sqrt(b**2-4*a*c))/(2*c)
mminus = (-b-sqrt(b**2-4*a*c))/(2*c)
mplus
##         Y 
## -7.132421
mminus
##        Y 
## 804.3153
m=mminus
p=a/m
q=b+p

m
##        Y 
## 804.3153
p
## (Intercept) 
## 0.001834174
q
##         Y 
## 0.2068378
bassModel=function(p,q,m,T=100)
{
  S=double(T)
  Y=double(T+1)
  Y[1]=0
  for(t in 1:T)
  {
    S[t] = p*m +(q-p)*Y[t] -(q/m)*Y[t]**2
    Y[t+1]=Y[t]+S[t]
  }
  return(list(Sales=S, cumSales=cumsum(S)))
}  

compute

Spred = Sales predicted

Spred=bassModel(p,q,m, T=23)$Sales
Spred=ts(Spred,start=c(2007,3), freq=4)
ts.plot(Sales, Spred, col=c("blue", "red"))
legend("topleft", legend=c("actual", "Bass Model"), fill=c("blue", "red"))

# cumulative sales

Spred=bassModel(p,q,m)$Sales
CumSpred=ts(cumsum(Spred),start=c(2007,3), freq=4)
CumSales=ts(cumsum(Sales),start=c(2007,3), freq=4)

ts.plot(CumSales, CumSpred, col=c("blue", "red"))
legend("topleft", legend=c("actual", "Bass Model"), fill=c("blue", "red"))
title("Predicted Cumulative iPhone Sales")

Summary

Per the Principles of Marketing Engineering (Lilien), the Bass Model makes several assumptions. It assumes a customer either adopts in a specific period, waits to adopt, and all potential customers eventually adopt. There is a fixed maximum potential of buyers and no repeat or replacement purchases occur which make sense in this case given that you typically just buy one phone for yourself. The impact of word-of-mouth communication on product adoption is the same, regardless of when a customer adopts the product.

The p coefficient is the coefficient of innovation and the q coefficient is the coefficient of imitation. N(t) is the total adopters up to time t which is given in the data. For the purposes of estimating the Bass Model Using Regression, the discretized version of the Bass Model uses N(t-1) or rather the total adopters right before t occurs. N hat or m as seen in the R code is the market potential or rather the eventual total number of customers that will adopt the new product.

This plot uses historical data to estimate the parameters of the Bass Model. The p, q, and N hat were determined using nonlinear regression to minimize the sum of squared errors or ordinary least square regression. Using the ordinary least square regression, a/b/c coefficients of the discretized version of the Bass Model are determined and then these values are plugged in to determine Nhat(using the quadratic equation to determine positive m value) the , p, and q for Bass Modeling.

This Bass Model using historical data of 23 quarters predicts that the maximum market size will be reached by around 2016 at 800 million cumulative sales, when the model is pushed predict the next 100 quarters in terms of cumulative sales.