# Homework 9

Due: Mar 31 by 11:55 pm (London ON time)

Submit your Jupyter Notebook to OWL

# Maximum Likelihood Estimation

In the notes on MLE the final section is an example of applying MLE to the estimation of psychometric functions. Read this carefully, you will be working with it for this assignment.

In the example in the notes, MLE is used to estimate two parameters, \(\beta_{0}\) and \(\beta_{1}\) from the data in the file https://www.gribblelab.org/9040/files/psychometric_data.txt that gives participant response R (second column of the data file) for each test position X (first column of the data file). From the two \(\beta\) parameters, one can calculate three summary parameters of the psychometric function: threshold, slope and acuity (see Equations 10).

## 1. Estimate acuity. (2 points)

Using Equations 10 and 11 in the notes, estimate acuity of the psychometric function that we fit using MLE.

## 2. Estimate the 95% confidence interval of acuity (5 points)

Estimate the empirical sampling distribution of acuity using a *parametric bootstrap*.

In a parametric bootstrap, you generate sample data by sampling from the estimated model (the probability distribution plus estimated parameters) a large number of times (e.g. 10,000). You then estimate the statistic of interest (in this case, acuity) for each sample.

To do this,

use the MLE estimate of \(\beta_{0}\) and \(\beta_{1}\) to simulate a new dataset of responses R for each position X. You can simulate binary responses using the

`np.random.binomial()`

function in Numpy.For this new simulated dataset, re-estimate the \(\beta\) parameters and acuity.

Repeat the steps above 10,000 times, each time computing a new

*acuity*. Save those acuity values in an array.Plot a histogram of the distribution of acuity.

Report the 95 % confidence interval on acuity.