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 06, 2024 ] --- 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: hats mean "estimated" .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.7122001 0.03134944 -3.931410 #> [2,] -0.7079441 0.08135420 -4.071759 #> [3,] -0.7047895 0.19840946 -3.979393 #> [4,] -0.6951060 0.04542387 -3.939195 #> [5,] -0.6836715 0.14169655 -4.033624 #> [6,] -0.6833292 0.08902386 -4.183527 ``` ] --- # .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.04401775 -5.520092 #> [2,] 0.11491613 -5.751526 #> [3,] 0.28151590 -5.646214 #> [4,] 0.06534812 -5.667043 #> [5,] 0.20725824 -5.899944 #> [6,] 0.13027961 -6.122272 ``` ] -- .rightcol45[ Mean WTP with confidence interal ``` r logitr::ci(draws_wtp) ``` ``` #> mean lower upper #> 1 0.1436555 0.03647551 0.2513887 #> 2 -5.7147653 -5.97513653 -5.4625371 ``` ] --- 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.6925500 0.08403549 -3.887939 #> [2,] -0.7346475 0.07683155 -3.924278 #> [3,] -0.7086096 0.12060448 -4.008604 #> [4,] -0.7029808 0.03122689 -4.030174 #> [5,] -0.6783486 0.16033117 -4.054342 #> [6,] -0.6967758 0.10656079 -3.939125 ``` ] --- # .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)