You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The model then assumes that decision maker chooses the option that maximises their subjective utility. The individual utility functions can be richly parameterised. The model is identified just when the utility measures of the alternatives are benchmarked against the fixed utility of the "outside good." The last quantity is fixed at 0.
101
+
The model then assumes that decision maker chooses the option that maximises their subjective utility. The individual utility functions can be richly parameterised. The model is identified just when the utility measures of the alternatives are benchmarked against the fixed utility of the "outside good." The last quantity is often fixed at 0 to aid parameter identification on alternative-specific parameters as we'll see below.
We will show here how to incorporate the utility specifications in PyMC. PyMC is a nice interface for this kind of modelling because it can express the model quite cleanly following the natural mathematical expression for this system of equations. You can see in this simple model how we go about constructing equations for the utility measure of each alternative separately, and then stacking them together to create the input matrix for our softmax transform.
134
+
We will show here how to incorporate the utility specifications in PyMC. PyMC is a nice interface for this kind of modelling because it can express the model quite cleanly following the natural mathematical expression for this system of equations. You can see in this simple model how we go about constructing equations for the utility measure of each alternative seperately, and then stacking them together to create the input matrix for our softmax transform.
135
135
136
136
```{code-cell} ipython3
137
137
N = wide_heating_df.shape[0]
@@ -150,7 +150,7 @@ with pm.Model(coords=coords) as model_1:
ax.set_title("Uncertainty in Marginal Rate of Substitution \n Operating Costs / Installation Costs");
211
211
```
212
212
213
-
which suggests that there is almost twice the value accorded to the a unit reduction in recurring operating costs over the one-off installation costs. Whether this is remotely plausible is almost beside the point since the model does not even closely capture the data generating process. But it's worth repeating that the native scale of utility is not straightforwardly meaningful, but the ratio of the coefficients in the utility equations can be directly interpreted.
213
+
which suggests that there is around .7 of the value accorded to the a unit reduction in recurring operating costs over the one-off installation costs. Whether this is remotely plausible is almost beside the point since the model does not even closely capture the data generating process. But it's worth repeating that the native scale of utility is not straightforwardly meaningful, but the ratio of the coefficients in the utility equations can be directly interpreted.
214
214
215
215
To assess overall model adequacy we can rely on the posterior predictive checks to see if the model can recover an approximation to the data generating process.
216
216
@@ -272,7 +272,7 @@ with pm.Model(coords=coords) as model_2:
That extra complexity can be informative, and the degree of relationship amongst the alternative products will inform the substitution patterns under policy changes. Also, note how under this model specification the parameter for `beta_ic` has a expected value of 0. Suggestive perhaps of a resignation towards the reality of installation costs that doesn't change the utility metric one way or other after a decision to purchase.
In this model we see that the marginal rate of substitution shows that an increase of one dollar for the operating costs is almost 17 times more impactful on the utility calculus than a similar increase in installation costs. Which makes sense in so far as we can expect the installation costs to be a one-off expense we're pretty resigned to.
old = idata_m3["posterior"]["p"].mean(dim=["chain", "draw", "obs"])
450
+
old
451
+
```
452
+
453
+
```{code-cell} ipython3
454
+
# New Policy Expectations
455
+
new = idata_new_policy["predictions"]["p"].mean(dim=["chain", "draw", "obs"])
456
+
new
457
+
```
458
+
459
+
```{code-cell} ipython3
460
+
new - old
458
461
```
459
462
460
463
```{code-cell} ipython3
@@ -497,15 +500,15 @@ Here we can, as expected, see that a rise in the operating costs of the electric
497
500
498
501
### Compare Models
499
502
500
-
We'll now evaluate all three model fits on their predictive performance. Predictive performance on the original data is a good benchmark that the model has appropriately captured the data generating process. But it is not (as we've seen) the only feature of interest in these models. These models are sensitive to our theoretical beliefs about the agents making the decisions, the view of the decision process and the elements of the choice scenario.
503
+
We'll now evaluate all three model fits on their predictive performance. Predictive performance on the original data is a good benchmark that the model has appropriately captured the data generating process. But it is not (as we've seen) the only feature of interest in these models. These models are sensetive to our theoretical beliefs about the agents making the decisions, the view of the decision process and the elements of the choice scenario.
0 commit comments