class: middle, inverse .leftcol30[ <center> <img src="https://madd.seas.gwu.edu/images/logo.png" width=250> </center> ] .rightcol70[ # Week 11: .fancy[WTP & Simulations] ###
EMSE 6035: Marketing Analytics for Design Decisions ###
John Paul Helveston ###
November 08, 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.6952607 0.13640663 -4.021549 #> [2,] -0.7193316 0.13093750 -3.844448 #> [3,] -0.6848580 0.09395454 -3.986473 #> [4,] -0.6948808 0.06480716 -4.067523 #> [5,] -0.7128530 0.18258654 -4.000395 #> [6,] -0.7055700 0.14353159 -4.066792 ``` ] --- # .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.19619493 -5.784231 #> [2,] 0.18202662 -5.344472 #> [3,] 0.13718834 -5.820875 #> [4,] 0.09326371 -5.853555 #> [5,] 0.25613490 -5.611809 #> [6,] 0.20342643 -5.763839 ``` ] -- .rightcol45[ Mean WTP with confidence interal ```r logitr::ci(draws_wtp) ``` ``` #> mean lower upper #> 1 0.1429359 0.03776162 0.2516029 #> 2 -5.7150021 -5.98184669 -5.4612197 ``` ] --- 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.6954732 0.13169817 -3.976132 #> [2,] -0.7029691 0.12444788 -4.004957 #> [3,] -0.7261536 0.15741668 -4.127974 #> [4,] -0.6867862 0.19197337 -3.897932 #> [5,] -0.6866717 0.17024995 -4.087407 #> [6,] -0.6859331 0.09267376 -4.041047 ``` ] --- # .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)