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:
We can use the coefficients and hessian from a model to obtain draws that reflect parameter uncertainty
#> [,1] [,2] [,3]
#> [1,] -0.6863012 0.10377457 -4.067518
#> [2,] -0.7055525 0.07070391 -3.984283
#> [3,] -0.6750049 0.08589199 -4.026048
#> [4,] -0.7077806 0.17031792 -3.961917
#> [5,] -0.7104361 0.13943050 -4.002240
#> [6,] -0.7191487 0.12070569 -3.997669
#> [,1] [,2]
#> [1,] 0.1512085 -5.926725
#> [2,] 0.1002107 -5.647039
#> [3,] 0.1272465 -5.964472
#> [4,] 0.2406366 -5.597662
#> [5,] 0.1962604 -5.633497
#> [6,] 0.1678452 -5.558891
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 and hessian:
\[ \nabla_{\beta}^2 \ln(\mathcal{L}) = \begin{bmatrix} -6000 & 50 & 60 \\ 50 & -700 & 50 \\ 60 & 50 & -300 \end{bmatrix} \]
Generate 10,000 draws of the model coefficients using the estimated coefficients and hessian. Use the mvrnorm() function from the MASS library.
Use the draws to compute the mean WTP and 95% confidence intervals of WTP for fuel economy and electric car vehicle type.
logitr-cars
code/6.1-compute-wtp.R
As a team, compute the WTP from an estimated model you used in your pilot analysis report
logitr-cars
code/6.2-model-wtp.R
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)
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:
Use the estimated coefficients to compute the WTP for fuel economy and electric car vehicle type.
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 |
We can use the coefficients and hessian from a model to obtain draws that reflect parameter uncertainty
#> [,1] [,2] [,3]
#> [1,] -0.6967780 0.17301065 -3.949949
#> [2,] -0.7229003 0.06867770 -4.018826
#> [3,] -0.6991102 0.05821212 -3.949547
#> [4,] -0.7092873 0.14409428 -4.000576
#> [5,] -0.6888186 0.12140738 -3.958083
#> [6,] -0.6767735 0.11266683 -3.990181
Rely on the predict() function to compute shares with uncertainty.
Internally, it:
logitr-cars
code/7.1-compute-market-sims.R
predict() function to predict market shares for those scenarios.7.2-plot-market-sims.R for examples)