class: middle, inverse .leftcol30[ <center> <img src="https://github.com/emse-madd-gwu/emse-madd-gwu.github.io/raw/master/images/logo.png" width=250> </center> ] .rightcol70[ # Week 11: .fancy[WTP & Simulations] ###
EMSE 6035: Marketing Analytics for Design Decisions ###
John Paul Helveston ###
November 09, 2022 ] --- class: inverse, middle # Week 11: .fancy[WTP & Simulations] ### 1. Computing "Willingness to Pay" (WTP) ### 2. Incorporating Uncertainty via Simulation ### 3. Directly Estimating WTP ### BREAK ### 4. Simulating Market Shares --- class: inverse, middle # Week 11: .fancy[WTP & Simulations] ### 1. .orange[Computing "Willingness to Pay" (WTP)] ### 2. Incorporating Uncertainty via Simulation ### 3. Directly Estimating WTP ### BREAK ### 4. Simulating Market Shares --- class: center ## Willingness to Pay (WTP) <br> ## `$$\tilde{u}_j = \alpha p_j + \boldsymbol{\beta} x_j + \tilde{\varepsilon_j}$$` <br> -- ## `$$\boldsymbol{\omega} = \frac{\boldsymbol{\beta}}{-\alpha}$$` --- class: center # Notational convention .leftcol[ # Model ## `$$\tilde{u}_j = \alpha p_j + \boldsymbol{\beta} x_j + \tilde{\varepsilon_j}$$` ## `$$\boldsymbol{\omega} = \frac{\boldsymbol{\beta}}{-\alpha}$$` ] .rightcol[ # Estimated Model ## `$$\tilde{u}_j = \hat{\alpha} p_j + \hat{\boldsymbol{\beta}} x_j + \tilde{\varepsilon_j}$$` ## `$$\hat{\boldsymbol{\omega}} = \frac{\hat{\boldsymbol{\beta}}}{-\hat{\alpha}}$$` ] --- class: inverse # Practice Question 1 .leftcol[ Suppose we estimate the following utility model describing preferences for cars: $$ \tilde{u}_j = \alpha p_j + \beta_1 x_j^{\mathrm{mpg}} + \beta_2 x_j^{\mathrm{elec}} + \varepsilon_j $$ The estimated model produces the following coefficients: - `\(\alpha\)`: -0.7 - `\(\beta_1\)`: 0.1 - `\(\beta_2\)`: -4.0 ] .rightcol[ a) Use the estimated coefficients to compute the WTP for fuel economy and electric car vehicle type. ] --- class: inverse, middle # Week 11: .fancy[WTP & Simulations] ### 1. Computing "Willingness to Pay" (WTP) ### 2. .orange[Incorporating Uncertainty via Simulation] ### 3. Directly Estimating WTP ### BREAK ### 4. Simulating Market Shares --- # .center[Simulating uncertainty] We can use the coefficients and hessian from a model to obtain draws that reflect parameter uncertainty .leftcol[ ```r beta <- c(-0.7, 0.1, -4.0) hessian <- matrix(c( -6000, 50, 60, 50, -700, 50, 60, 50, -300), ncol = 3, byrow = TRUE) ``` ] .rightcol[ ```r covariance <- -1*solve(hessian) draws <- MASS::mvrnorm(10^4, beta, covariance) head(draws) ``` ``` #> [,1] [,2] [,3] #> [1,] -0.7161138 0.04251578 -3.962513 #> [2,] -0.6679818 0.09678488 -3.974081 #> [3,] -0.6926573 0.09303158 -3.979829 #> [4,] -0.7161590 0.09736044 -4.017811 #> [5,] -0.7168487 0.13808505 -3.977487 #> [6,] -0.6947676 0.13929996 -4.016169 ``` ] --- # .center[Computing WTP with draws] ## `$$\hat{\boldsymbol{\omega}} = \frac{\hat{\boldsymbol{\beta}}}{-\hat{\alpha}}$$` -- .leftcol55[ ```r draws_other <- draws[,2:ncol(draws)] draws_price <- draws[,1] draws_wtp <- draws_other / (-1*draws_price) head(draws_wtp) ``` ``` #> [,1] [,2] #> [1,] 0.05937014 -5.533357 #> [2,] 0.14489150 -5.949386 #> [3,] 0.13431113 -5.745740 #> [4,] 0.13594808 -5.610223 #> [5,] 0.19262788 -5.548572 #> [6,] 0.20049864 -5.780593 ``` ] -- .rightcol45[ Mean WTP with confidence interal ```r maddTools::ci(draws_wtp) ``` ``` #> mean lower upper #> 1 0.1431816 0.03346827 0.250165 #> 2 -5.7169939 -5.97960215 -5.465543 ``` ] --- class: inverse ## Practice Question 2 Suppose we estimate the following utility model describing preferences for cars: $$ \tilde{u}_j = \alpha p_j + \beta_1 x_j^{\mathrm{mpg}} + \beta_2 x_j^{\mathrm{elec}} + \varepsilon_j $$ .leftcol[ The estimated model produces the following coefficients and hessian: - `\(\alpha\)`: -0.7 - `\(\beta_1\)`: 0.1 - `\(\beta_2\)`: -4.0 $$ \nabla_{\beta}^2 \ln(\mathcal{L}) = `\begin{bmatrix} -6000 & 50 & 60 \\ 50 & -700 & 50 \\ 60 & 50 & -300 \end{bmatrix}` $$ ] .rightcol[ a) Generate 10,000 draws of the model coefficients using the estimated coefficients and hessian. Use the `mvrnorm()` function from the `MASS` library. b) Use the draws to compute the mean WTP and 95% confidence intervals of WTP for fuel economy and electric car vehicle type. ] --- # .center[Computing WTP from an estimated model] <br> .rightcol80[ ## 1. Open `logitr-cars` ## 2. Open `code/6.1-compute-wtp.R` ] --- class: inverse
10
:
00
## Your Turn .leftcol80[.font120[ As a team, compute the WTP from an estimated model you used in your pilot analysis report ]] --- class: inverse, middle # Week 11: .fancy[WTP & Simulations] ### 1. Computing "Willingness to Pay" (WTP) ### 2. Incorporating Uncertainty via Simulation ### 3. .orange[Directly Estimating WTP] ### BREAK ### 4. Simulating Market Shares --- class: center ## Willingness to Pay (WTP) .leftcol[ ## "Preference Space" ## `$$\tilde{u}_j = \alpha p_j + \boldsymbol{\beta} x_j + \tilde{\varepsilon_j}$$` ] -- .rightcol[ ## "WTP Space" ## `$$\boldsymbol{\omega} = \frac{\boldsymbol{\beta}}{-\alpha}$$` ## `$$\lambda = - \alpha$$` ## `$$\tilde{u}_j = \lambda (\boldsymbol{\omega} x_j - p_j) + \tilde{\varepsilon_j}$$` ] --- background-color: #EEEDEE class: center # WTP space models have **non-convex**<br>log-likelihood functions! <center> <img src="images/conditions.png" width=850> </center> --- class: center # WTP space models have non-convex<br>log-likelihood functions! <br> # **Use multi-start loop with<br>random starting points** --- # .center[Computing WTP from an estimated model] <br> .rightcol80[ ## 1. Open `logitr-cars` ## 2. Open `code/6.2-model-wtp.R` ] --- class: inverse
10
:
00
## Your Turn .leftcol80[.font120[ As a team, re-estimate the main model you used in your pilot analysis report, but now in the WTP space. Try plotting your results (see `6.3-plot-wtp.R` for examples) ]] --- class: inverse, center # .fancy[Break]
05
:
00
--- class: inverse, middle # Week 11: .fancy[WTP & Simulations] ### 1. Computing "Willingness to Pay" (WTP) ### 2. Incorporating Uncertainty via Simulation ### 3. Directly Estimating WTP ### BREAK ### 4. .orange[Simulating Market Shares] --- background-color: #EEEDEE class: center ## We want to find `\(\boldsymbol{\beta}\)` by maximizing the log-likelihood <center> <img src="images/mle1.png" width=1000> <img src="images/mle2.png" width=500> </center> --- # .center[Simulate Market Shares] ## 1. Define a market, `\(X\)` ## 2. Compute shares: ## `$$\hat{P}_j = \frac{e^{\hat{\boldsymbol{\beta}}'\boldsymbol{X}_j}}{\sum_{k=1}^J e^{\hat{\boldsymbol{\beta}}'\boldsymbol{X}_k}}$$` --- background-color: #EEEDEE # .center[Simulate Market Shares] <center> <img src="images/matrixmath.png" width=700> </center> --- background-color: #EEEDEE # .center[Simulate Market Shares] .leftcol70[ <center> <img src="images/matrixmath.png" width=700> </center> ] .rightcol30[ In R: ```r X %*% beta ``` ] --- class: inverse # Practice Question 1 .leftcol[ Suppose we estimate the following utility model describing preferences for cars: $$ \tilde{u}_j = \alpha p_j + \beta_1 x_j^{\mathrm{mpg}} + \beta_2 x_j^{\mathrm{elec}} + \varepsilon_j $$ The estimated model produces the following coefficients: - `\(\alpha\)`: -0.7 - `\(\beta_1\)`: 0.1 - `\(\beta_2\)`: -4.0 ] .rightcol[ a) Use the estimated coefficients to compute the WTP for fuel economy and electric car vehicle type. b) Use the estimated coefficients to compute market shares for the alternatives in the following market: alternative | price | mpg | elec ------------|-------|-----|-------- 1 | 15 | 20 | 0 2 | 30 | 100 | 1 3 | 20 | 40 | 0 ] --- # .center[Simulating Market Shares with Uncertainty] We can use the coefficients and hessian from a model to obtain draws that reflect parameter uncertainty .leftcol[ ```r beta <- c(-0.7, 0.1, -4.0) hessian <- matrix(c( -6000, 50, 60, 50, -700, 50, 60, 50, -300), ncol = 3, byrow = TRUE) ``` ] .rightcol[ ```r covariance <- -1*solve(hessian) draws <- MASS::mvrnorm(10^4, beta, covariance) head(draws) ``` ``` #> [,1] [,2] [,3] #> [1,] -0.6994714 0.07871118 -4.057312 #> [2,] -0.7046625 0.06870760 -3.918736 #> [3,] -0.7196215 0.06599735 -4.030982 #> [4,] -0.6974224 0.07829723 -4.076801 #> [5,] -0.7068202 0.13839250 -3.942513 #> [6,] -0.7192083 0.11363566 -4.054808 ``` ] --- # .center[Simulating Market Shares with Uncertainty] Rely on the `predict()` function to compute shares with uncertainty. Internally, it: 1. Takes draws of `\(\boldsymbol{\beta}\)` 2. Computes `\(P_j\)` for each draw 3. Returns mean and confidence interval computed from draws --- # .center[Simulating Market Shares with Uncertainty] <br> .rightcol80[ ## 1. Open `logitr-cars` ## 2. Open `code/7.1-compute-market-sims.R` ] --- class: inverse
20
:
00
## Your Turn ## As a team: 1. Develop one or two scenarios pitting your product against one or more competitors. 2. Use one of your estimated models and the `predict()` function to predict market shares for those scenarios. 3. Try plotting your results (see `7.2-plot-market-sims.R` for examples)