3. Bayesian Modeling#

This chapter is adapted from AM207 (Harvard, Fall 2021). Watch the recorded lecture.

In this chapter

  1. Review of the Method of Maximum Likelihood

  2. Models for Real Data

  3. The Beta-Binomial Model

  4. Bayesian Modeling

  5. Connections and Comparisons with Frequentist Inference

Hide code cell content

### Import basic libraries
import numpy as np
import scipy as sp
import pandas as pd
import sklearn as sk
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
%matplotlib inline

3.1. Review of the Method of Maximum Likelihood#

The Method of Maximum Likelihood#

  1. (Model) Assume observations from \(N\) number of independently and identically distributed outcomes, \(Y_1, \ldots, Y_N\), with \(Y_n \sim p(Y|\theta)\) and where \(\theta\) is the set of parameters of the distribution \(p(Y|\theta)\). The likelihood function is

    \[\begin{aligned} \mathcal{L}(\theta) = \prod_{n=1}^N p(y_n | \theta) \end{aligned}\]
  2. (Inference) We estimate \(\theta\) using the maximum likelihood estimate, defined as

    \[\begin{aligned} \theta_{\text{MLE}} = \underset{\theta}{\mathrm{argmax}}\; \mathcal{L}(\theta) = \underset{\theta}{\mathrm{argmax}}\; \prod_{n=1}^N p(y_n | \theta) \end{aligned}\]
  3. (Inference Method)

    • Unconstrained Optimization: if \(\theta\) doesn’t need to satisfy any special property, then it’s as simple as setting the gradient of the likelihood equal to zero and solving! (Except it’s not that simple!)

    • Constrained Optimization: if \(\theta\) needs to satisfy special properties, then it’s as simple as setting the gradient of the Lagrangian of the likelihood and the constraint equal to zero and solving! (Except it’s not that simple!)

Evaluating the MLE#

If we have the true parameters \(\theta\), we can compute the Mean Squared Error:

\[ \mathrm{MSE}_{\theta} = \mathbb{E}_{Y^{\theta}}\left[(\theta_{\text{MLE}}\left(Y^\theta\right) - \theta)^2\right] \]

If we don’t have the true parameters \(\theta\), we can use \(\theta_{\text{MLE}}\) predict or simulate data and compare it with the observed data, i.e. sample

\[ Y^{\theta_{\text{MLE}}} \sim p(Y| \theta_{\text{MLE}}), \]

compare \(Y^{\theta_{\text{MLE}}}\) and \(Y^{\theta}\).

Properties of The Maximum Likelihood Estimator#

Why Choose MLE? Asymptotically, i.e. given an infinite number of samples, the MLE is

  1. Consistent: \(\theta_{\text{MLE}}\) approaches the true parameters \(\theta\).

  2. Unbiased: The average \(\theta_{\text{MLE}}\), taken over many different samples of the data, is \(\theta\).

  3. Minimum Variance: The MLE has the lowest variance of all unbiased estimators.

Why Not Choose MLE? When the sample size is “small”, the MLE can be

  1. Overfitted: The MLE can is sensitive to outliers in the data.

  2. Biased: The average \(\theta_{\text{MLE}}\), taken over many different data samples, is not \(\theta\).

  3. Imprecise: The MLE can have high variance.

What Other Estimators are There?

  1. Method of Moments

  2. Minimum Variance Unbiased Estimator

  3. Regularized MLE

Note: the computation of (1) and (2) can be much more complex than MLE.

Is Bias Always Bad?#

Recall that we can use the properties of expectations to decompose the mean squared error of the maximum likelihood estimator:

\[ \mathrm{MSE}_{\theta_{\text{MLE}}} = \underbrace{\mathbb{E}\left[(\theta_{\text{MLE}} - \mathbb{E}[\theta_{\text{MLE}}])^2\right]}_{\text{variance}} + \underbrace{\left( \mathbb{E}[\theta_{\text{MLE}}] - \theta\right)^2}_{\text{bias}} \]

Although we want an unbiased estimator, the above decomposition says that if the variance of the estimator is high our expected error will nonetheless be high.

The variance-bias trade-off refers to the phenomenon that, in many cases, when estimators have low bias they have high corresponding variance (and vice versa), and hence high MSE.

Limitations of MLE: Overfitting Under Scarcity of Data#

Suppose that we have three observations from a Bernoulli distribution, \(Ber(\theta)\): \(\{ H, H, H\}\). From what we’ve see before, the MLE of \(\theta\) is

\[ \theta_{\text{MLE}} = \frac{3}{3} = 1. \]

Is this a good estimate of the bias of the coin? What can we do to make this estimate better?

Suppose that we have two YouTube videos with 4/5 likes and 3,500/5,000 likes respectively. We can model the probability that a viewer will like each video as two Bernoulli distributions, \(Ber(\theta_1)\), \(Ber(\theta_2)\), where \(\theta_i\) is the “inherent” likeability of each video.

Again, we can compute the MLE of the Bernoulli parameters:

\[ \theta_1 = 4/5 = 0.8,\; \theta_2 = 3,500/5,000 = 0.75. \]

It is fair to say that the second video is more likeable base on our estimates?

Regularization#

We can prevent MLE from overfitting to the observations when training data is scarce by constraining it from unreasonable values.

Recall that in order to prevent the MLE solution for linear regression from learn unrealistically large slopes and intercepts, we add \(\ell_2\)-regularization on the model parameters during training, essentially forcing the parameters to stay as small (close to zero) as they can be while still capturing the data.

Similarly, if want the MLE of the parameter \(\theta\) of a Bernoulli distribution to avoid extreme values (1 and 0), we need to ‘anchor’ our estimation of \(\theta\) to some ‘reasonable’ value:

\[\begin{aligned} \theta_{\text{MLE Reg.}} = \frac{\text{# positive outcome} + \alpha}{\text{# total trials} + \beta} \end{aligned}\]

The fraction \(\alpha/\beta\) expresses your notion of what is a reasonable looking probability.

But is regularization a principled way to perform inference (i.e. will it ruin the nice properties of MLE)? How do you choose the hyperparameters \(\alpha\), \(\beta\) in a principled manner?

3.2. Models for Real Data#

Video Ranking#

We can model the outcome, \(Y\), of a user rating for a specific YouTube video as a Bernoulli distribution,

\[ Y \sim Ber(\theta) \]

where \(\theta\) is the probability that a user will like the video.

Given \(Y_1,\ldots, Y_N\) identically and independently distributed outcomes with \(Y_n \sim Ber(\theta)\). Denote the total number of likes by \(L\). Then \(L\) can be modeled with a binomial distribution,

\[ L \sim Bin(N, \theta). \]

Model Critique: What are the assumptions made in this model? Are they realistic?

Kidney Cancer Rates#

Given a dataset with \(N\) number of US counties and the incidents of kidney cancer in each county, we can model the observed incidents of cancer, \(C_n\), of the \(n\)-th county with a Poisson distribution,

\[ C_n \sim Poi(T_n\theta_n) \]

where \(T_n\) is the total population of the county and \(\theta_n\) is the “true” cancer rate of the county.

Model Critique: What are the assumptions made in this model? Are they realistic?

The following is a visualization of the counties with the highest rates of kidney cancer (Gelman 1998). Is there any noticeable spatial pattern in these maps? Recall that the MLE of the rate of the Poisson distribution for each county is \(\frac{C_n}{T_n}\).

../_images/kidney.jpg

Birth Weights#

In our lab, we work with IVF clinics to build models for prediction and data analysis. One of our current tasks is to model the birth weights of the infants born in the clinic.

Naively, given observed birth weights \(Y_1, \ldots, Y_N\), we can model each outcome \(Y_n\) with a normal distribution,

\[ Y_n \sim \mathcal{N}(\mu, \sigma^2) \]

where \(\mu\) is the average birth weight for this population and \(\sigma^2\) is the population variance.

Model Critique: What are the assumptions made in this model? Are they realistic?

3.3. The Beta-Binomial Model#

The Coin Toss Model: Revisited#

Suppose that we have three observations from a Bernoulli distribution, \(Ber(\theta)\): \(\{ H, H, H\}\). The MLE of \(\theta\) is

\[ \theta_{\text{MLE}} = \frac{3}{3} = 1. \]

This is a clear case of the MLE overfitting to the observed data.

Last time, you’d suggested tying the estimate to some fixed reasonable number, for example,

\[ \theta_{\text{MLE Reg}} = \frac{H + 1}{N + 2}, \]

and in general,

\[ \theta_{\text{MLE Reg}} = \frac{H + \alpha}{N + \beta}. \]

The terms \(\alpha\) and \(\beta\) are called regularization terms .

Question: What is the effect of \(\alpha\), \(\beta\) on our estimate? What values should we choose for \(\alpha\), \(\beta\)?

Incorporating Prior Beliefs#

Our choice of the regularization terms, \(\alpha\), \(\beta\), depends on our prior beliefs about the coin. The way we chose to incorporate these beliefs doesn’t indicate any uncertainty.

Alternatively, we can incorporate our prior belief about \(\theta\) as a distribution, this is called the prior distribution. Since \(\theta\) is a number between 0 and 1, a beta distribution is an appropriate choice.

../_images/beta.jpg

The Beta-Binomial Model#

A model that involves both a likelihood for the data and prior on the parameters in the likelihood is called a Bayesian model.

Bayesian Model for Coin Flip

\[\begin{split}\begin{aligned} Y &\sim Bin(N, \theta),\quad &\text{(Likelihood)}\\ \theta &\sim Beta(\alpha, \beta),\quad &\text{(Prior)} \end{aligned}\end{split}\]

where \(\alpha, \beta\) are called hyperparameters of the model.

Now, computing the MLE no longer makes sense (since the MLE only considers the likelihood). Luckily, Bayes’ Rule allows us to derive a distribution that considers both the prior and the likelihood:

\[\begin{aligned} p(\theta | Y) = \frac{\overbrace{p(Y| \theta)}^{\text{likelihood}} \overbrace{p(\theta)}^{\text{prior}}}{\underbrace{p(Y)}_{\text{marginal data likelihood}}} = \frac{p(Y, \theta)}{\int p(Y, \theta) d\theta} \end{aligned}\]

The distribution \(p(\theta | Y)\) is called the posterior.

Posterior for the Beta-Binomial Model#

In our case, the posterior is given by

\[\begin{aligned} p(\theta | Y) = \frac{p(Y| \theta)p(\theta)}{p(Y)} = \frac{\overbrace{{N \choose Y}\theta^{Y}(1- \theta)^{N-Y}}^{\text{binomial pdf}} \overbrace{\frac{1}{B(\alpha, \beta)} \theta^{\alpha - 1} (1 - \theta)^{\beta - 1}}^{\text{beta pdf}}}{p(Y)} \end{aligned}\]

We can rewrite the posterior as

\[\begin{aligned} p(\theta | Y) = const * \theta^{(Y+\alpha) - 1}(1 - \theta)^{(N-Y + \beta) - 1} \end{aligned}\]

where \(const = \frac{{N \choose Y}}{B(\alpha, \beta)p(Y)}\) must be the normalizing constant for \(p(\theta | Y)\).

We recognize the posterior as a beta distribution, \(Beta(Y+\alpha, N-Y + \beta)\)! Can you see why?

Interpreting the Posterior: Bayesian Update#

Rather than a point estimate for \(\theta\), we now have a posterior distribution, \(p(\theta|Y)\), over \(\theta\). What does the posterior tell us about \(\theta\)?

Since the prior distribution \(p(\theta)\) encoded our beliefs about \(\theta\) along with our uncertainty, it is natural to interpret the posterior as yet another belief about \(\theta\).

Since the posterior includes the likelihood, this belief has been updated by the data.

Simulation: Bayesian Update for the Coin Flip#

What is the effect of the choice of the prior on the posterior? What is the effect of the number of observations, \(N\), on the posterior?

Hide code cell content

#a function for computing the prior and the posterior (after simulating data)
def make_models(alpha, beta, N, theta):
    #prior definition: beta distribution
    prior = sp.stats.beta(alpha, beta).pdf
    
    #sample data
    H = np.random.binomial(N, theta)
    
    #update posterior: beta distribution
    posterior_alpha = H + alpha
    posterior_beta = N - H + beta
    posterior = sp.stats.beta(posterior_alpha, posterior_beta).pdf
    
    return prior, posterior, H, posterior_alpha, posterior_beta

# a function for ploting the prior and posterior distribution
def plot_prior_posterior(ax, prior, posterior, H, N):
    x = np.linspace(0, 1, 100)
    
    ax[0].plot(x, prior(x), color='blue')
    ax[0].set_title('Prior distribution')
    ax[1].plot(x, posterior(x), color='red')
    ax[1].set_title('Posterior distribution after seeing {} Heads/{} Flips'.format(H, N))
    return ax

#prior definition: beta distribution
#try: alpha = beta = 0.5, 1, 10; try: alpha=10, beta=1; try: alpha=1, beta=10
alpha = 0.5
beta = 0.5
#data: binomial distribution
N = 10
theta = 0.3

prior, posterior, H, posterior_alpha, posterior_beta = make_models(alpha, beta, N, theta)
fig, ax = plt.subplots(1, 2, figsize=(20, 8))
ax = plot_prior_posterior(ax, prior, posterior, H, N)
plt.show()
../_images/e4c579eb58b4d1bb45743f5a9f6076bd4e3be6fcfa1845d5945a0c36f4ebe7a1.png

Hide code cell source

#run this multiple times to see the effect of updates
posterior_alpha = 0.5
posterior_beta = 0.5
prior, posterior, H, posterior_alpha, posterior_beta = make_models(posterior_alpha, posterior_beta, N, theta)
fig, ax = plt.subplots(1, 2, figsize=(20, 8))
ax = plot_prior_posterior(ax, prior, posterior, H, N)
plt.show()
../_images/4feac302b92737fc3480ce39fc145c47b47f395c5e8d05637aaa283ab71b73a4.png

Making Predictions#

If the posteriors we infer represent beliefs, how do we evaluate these beliefs?

  1. In the case that we the true parameter \(\theta^{\text{true}}\), we can check to see if the posterior assigns high likelihood to \(\theta^{\text{true}}\), and the certainty the posterior has around \(\theta^{\text{true}}\).

  2. When we do not know \(\theta^{\text{true}}\), we can simulate data \(Y^{\theta}\) using samples of \(\theta\) from the posterior. We compare the distribution of simulated data, or posterior predictive, to the observed data.

Simulation: Posterior Predictive for the Coin Flip#

Hide code cell content

# function to plot the posterior predictive of the beta-binomial model
def plot_posterior_predictive(ax, posterior_pred, H):
    ax.axvline(x=H, color='black', label='observed heads')
    ax.hist(posterior_pred, bins=50, color='red', alpha=0.6, label='histogram of predicted head')
    ax.set_xticks(range(np.max(posterior_pred) + 1))
    ax.set_title('posterior predictive over heads')
    ax.legend(loc='best')
    return ax
posterior_samples = np.random.beta(posterior_alpha, posterior_beta, size=500)
posterior_pred = [np.random.binomial(N, theta_sample, 1)[0] for theta_sample in posterior_samples]

fig, ax = plt.subplots(1, 1, figsize=(10, 5))
ax = plot_posterior_predictive(ax, posterior_pred, H)
plt.show()
../_images/eab37958b30bb544941cdd3038d957a2f151793def563369995a85e61e680122.png

3.4. Bayesian Modeling - A Summary#

The Bayesian Modeling Process#

In order to make statements about \(Y\), the outcome, and \(\theta\), parameters of the distribution generating the data, we form the joint distribution over both variables and use the various marginals/conditional distributions to reason about \(Y\) and \(\theta\).

  1. we form the joint distribution over both variables \(p(Y, \theta) = p(Y | \theta) p(\theta)\).

  2. we can condition on the observed outcome to make inferences about \(\theta\),

    \[ p(\theta | Y) = \frac{p(Y, \theta)}{p(Y)} \]

    where \(p(\theta | Y)\) is called the posterior distribution and \(p(Y)\) is called the evidence.

  3. before any data is observed, we can simulate data by using our prior

    \[ p(Y^*) = \int_\Theta p(Y^*, \theta) d\theta = \int_\Theta p(Y^* | \theta) p(\theta) d\theta \]

    where \(Y^*\) represents new data and \(p(Y^*)\) is called the prior predictive.

  4. after observing data, we can simulate new data similar to the observed data by using our posterior

    \[ p(Y^*|Y) = \int_\Theta p(Y^*, \theta|Y) d\theta = \int_\Theta p(Y^* | \theta) p(\theta | Y) d\theta \]

    where \(Y^*\) represents new data and \(p(Y^*|Y)\) is called the posterior predictive.

Evaluating Bayesian Models#

As we have seen in the Beta-Binomial model, we can simulate the posterior (and prior) predictive rather than compute them analytically. That is, you don’t need to know the pdf of \(p(Y^*|Y)\).

The posterior predictive can be represented by samples of predictions:

  1. we sample values of \(\theta_n\) from the posterior, \(p(\theta|Y)\).

  2. we sample an outcome \(Y_n\) from \(p(Y|\theta_n)\) for each posterior sample \(\theta_n\).

The set \(Y_n\) we obtain empirically represents the posterior predictive distribution \(p(Y^*|Y)\).

Where do Priors Come From?#

Hopefully you’ve noticed a key property of the priors we chose:

All the priors combined with the likelihood to form a distribution we recognize! Specifically, the posterior distribution is of the same type as the prior!

These priors are called conjugate priors for the corresponding likelihoods. This is a purely mathematical property.

Question: is it right to choose priors that are mathematically convenient? What is a good way to choose a prior? What if we “choose wrong”?

Hide code cell source

Y = 11
N = 15
MLE = Y * 1. / N
posterior = sp.stats.beta(Y + 1, N - Y + 1).pdf
posterior_mean = (Y + 1.) / (N + 2.)

fig, ax = plt.subplots(1, 1, figsize=(10, 5))
x = np.linspace(0, 1, 100)
ax.plot(x, posterior(x), color='red', label='Posterior pdf')
ax.axvline(x=MLE, color='black', label='Maximum Likelihood Estimate')
ax.axvline(x=posterior_mean, color='green', label='Posterior Mean')
ax.set_title('Comparison of the posterior with the MLE')
ax.legend(loc='best')
plt.show()
../_images/3d645d6e5d4d3c49e13ab7ea3e41bb6c1c1949d33f5b8ac10514d67a32950f0c.png

3.5. Summary#

  1. How do we evaluate the fit of our MLE model?

    • With regression it’s easy, you plug \(x_n\) into \(f_{\theta_\text{MLE}}(x)\) and then compare the prediction \(\widehat{y}_n\) with \(y\). But what if we don’t have any inputs, \(x_n\), what if we just have \(y_n\)? In this case we would not be able to predict a \(\widehat{y}_n\) for a specific \(y_n\).

  2. What are the potential drawbacks of MLE (in particular, under data scarcity)?

    • What are some common fixes for the drawbacks of MLE?

    • What are some potential issues with these fixes?

  3. What is the point of adding priors to our models? Specifically how does adding priors to our model mitigate some of the drawbacks of MLE?

  4. How should we interpret the posterior of a Bayesian model and why?

  5. What is a posterior predictive? What is the relationship between the posterior predictive and the posterior? What is the point of deriving the posterior predictive (i.e. once we derive the posterior isn’t that enough)?

  6. How do we evaluate a Bayesian model (the posterior is a distribution over plausible models not a single “best” model)?

  7. How do we choose priors for Bayesian models? What if we chose wrong? Why did we choose a Beta prior for the binomial model for the coin flip data?

3.6. Exercises#

These problems were originally assigned as homework. Data files are in the book’s data/ folder. Worked solutions, where available, are collapsed beneath the questions they answer; try each problem before expanding them.

Problem Set: Review of Statistical Modeling and Scientific Computing#

Hide code cell content

### Import basic libraries
import numpy as np
import pandas as pd
import sklearn as sk
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
%matplotlib inline

Problem Description#

In the competitive rubber chicken retail market, the success of a company is built on satisfying the exacting standards of a consumer base with refined and discriminating taste. In particular, customer product reviews are all important. But how should we judge the quality of a product based on customer reviews?

On Amazon, the first customer review statistic displayed for a product is the average rating. The following are the main product pages for two competing rubber chicken products, manufactured by Lotus World and Toysmith respectively:

Lotus World

Toysmith

alt

alt

Clicking on the ‘customer review’ link on the product pages takes us to a detailed break-down of the reviews. In particular, we can now see the number of times a product is rated a given rating (between 1 and 5 stars).

Lotus World

Toysmith

alt

alt

In the following, we will ask you to build statistical models to compare these two products using the observed rating. Larger versions of the images are available in the data set accompanying this notebook.

Exercise: Part I: A Maximum Likelihood Model

  1. (Model Building) Suppose that for each product, we can model the probability of the value each new rating as the following vector:

    \[ \theta = [\theta_1, \theta_2, \theta_3, \theta_4, \theta_5] \]

    where \(\theta_i\) is the probability that a given customer will give the product \(i\) number of stars. That is, each new rating (a value between 1 and 5) has a categorical distribution \(Cat(\theta)\). Represent the observed ratings of an Amazon product as a vector \(R = [r_1, r_2, r_3, r_4, r_5]\) where, for example, \(r_4\) is the number of \(4\)-star reviews out of a total of \(N\) ratings. Write down the likelihood of \(R\). That is, what is \(p(R| \theta)\)?

    Note: The observed ratings for each product should be read off the image files included in the dataset.

  1. (Model Fitting) Find the maximum likelihood estimator of \(\theta\) for the Lotus World model; find the MLE of \(\theta\) for the Toysmith model. You need to make a reasonably mathematical argument for why your estimate actually maximizes the likelihood (i.e. recall the criteria for a point to be a global optima of a function).

    Note: I recommend deriving the MLE using the general expression of the likelihood. That is, derive the posterior using the variable \(R\), then afterwards plug in your specific values of \(R\) for each product.

  1. (Model Interpretation) Based on your MLE of \(\theta\)’s for both models, do you feel confident deciding if one product is superior to another? Why or why not?

Exercise: Part II: A Bayesian Model

  1. (Model Building) Suppose you are told that customer opinions are very polarized in the retail world of rubber chickens, that is, most reviews will be 5 stars or 1 stars (with little middle ground). What would be an appropriate \(\alpha\) for the Dirichlet prior on \(\theta\)? Recall that the Dirichlet pdf is given by:

    \[ p_{\Theta}(\theta) = \frac{1}{B(\alpha)} \prod_{i=1}^k \theta_i^{\alpha_i - 1}, \quad B(\alpha) = \frac{\prod_{i=1}^k\Gamma(\alpha_i)}{\Gamma\left(\sum_{i=1}^k\alpha_i\right)}, \]

    where \(\theta_i \in (0, 1)\) and \(\sum_{i=1}^k \theta_i = 1\), \(\alpha_i > 0 \) for \(i = 1, \ldots, k\).

  1. (Inference) Analytically derive the posterior distribution (using the likelihoods you derived in Part I) for each product.

    Note: I recommend deriving the posterior using the general expression of a Dirichlet pdf. That is, derive the posterior using the variable \(\alpha\), then afterwards plug in your specific values of \(\alpha\) when you need to.

  1. (The Maximum A Posterior Estimate) Analytically or empirically compute the MAP estimate of \(\theta\) for each product, using the \(\alpha\)’s you chose in Question 1. How do these estimates compare with the MLE? Just for this problem, compute the MAP estimate of \(\theta\) for each product using a Dirichlet prior with hyperparameters \(\alpha = [1, 1, 1, 1, 1]\). Make a conjecture about the effect of the prior on the difference between the MAP estimates and the MLE’s of \(\theta\).

  1. (The Posterior Mean Estimate) Analytically or empirically compute the posterior mean estimate of \(\theta\) for each product, using the \(\alpha\)’s you chose in Question 1. How do these estimates compare with the MAP estimates and the MLE?

  1. (The Posterior Predictive Estimate) Sample 1000 rating vectors from the posterior predictive for each product, using the \(\alpha\)’s you chose in Question 1. Use the average of the posterior predictive samples to estimate \(\theta\). How do these estimates compare with the MAP, MLE, posterior mean estimate of \(\theta\)?

  1. (Model Evaluation) Compute the 95% credible interval of \(\theta\) for each product (Hint: compute the 95% credible interval for each \(\theta_i\), \(i=1, \ldots, 5\)). For which product is the posterior mean and MAP estimate more reliable and why?

Exercise: Part III: Broader Impact Analysis

Starting in 2020, major machine learning conferences are beginning to ask authors as well as reviewers to explicitly consider the broader impact of new machine learning methods. To properly evaluate the potential good or harm that a piece of technology (AI or not) can do to the general public, we need to be aware that no technology is deployed in ideal conditions or in perfectly neutral contexts. In order to assess the potential broader impact of technology, we need to analyze the social systems/institutions of which these technologies will become a part.

To help you analyze the broader impact of your technology, begin by considering the following questions:

I. Identify the relevant socio-technical systems

  • In what social, political, economic system could the tech be deployed?

  • How would the tech be used in these systems (what role will it take in the decision making processes)?

II. Identify the stakeholders

  • Who are the users?

  • Who are the affected communities (are these the users)?

    Hint: users are typically decision makers who will use the technology as decision aids (e.g. doctors), whereas affected communities may be folks who are impacted by these decisions but who are not represented in the decision making process (e.g. patients).

III. What types of harm can this tech do?

  • What kinds of failures can this tech have?

  • What kinds of direct harm can these failures cause?

  • What kinds of harm can the socio-technical system cause?

    Hint: many technical innovations have niche applications, they may sit in a long chain of decision making in a complex system. As such, it may seem, at first glance, that these technologies have no immediate real-life impact. In these cases, it’s helpful to think about the impact of the entire system and then think about how the proposed innovations aid, hamper or change the goals or outcomes of this system.

IV. What types of good can this tech do?

  • What kinds of needs do these users/communities have?

  • What kinds of constraints do these users/communities have?

  1. (Impact) Analyze the broader impact of models of product popularity/quality when used for ranking. Specifically, focus on anticipating ways these models can interact with other components of the decision systems in which they will be deployed, identifying end-users, affected communities as well as anticipating the effects (positive and negative) on affected communities (in particular, does the model have the same effect on all subpopulations in the affected communities?).

  1. (Comparison of Ranking Systems)

    Recall that on Amazon, the first customer review statistic displayed for a product is the average rating. What is potentially problematic with ranking products based on the average customer rating?

    Which point estimate (MAP, MLE, posterior mean or posterior predictive estimate) of \(\theta\), if any, would you feel choose to rank the two Amazon products? Why?

    Hint: think about which of these estimates are equivalent (if any). If they are not equivalent, what are the special properties of each estimate? What aspect of the data or the model is each estimate good at capturing?

    Note: we’re not looking for “the correct answer” here. We are looking for a sound decision based on a statistically correct interpretation of your models.

3.7. Further Reading#

Statistics

Other Reference

  • Gelman, Chapters 2 & 3

  • Gelman, Chapter 4