Datalab 5

The third datalab is about Monte Carlo simulation and bootstrapping the sampling distribution of the maximum likelihood estimator for the exponential distribution. The content of the datalab can be cloned using the following line in git bash:

git clone https://github.com/holleland/TECH3_datalab5

This will make a local copy of the files on the github repository at the current location of the git bash terminal.

If you dont want to use git bash, you can also open the github link in your browser and download the files “manually”.

The repository consists of three files:

  • datalab5.ipynb: The file for you to be working with.
  • datalab5_sol.ipynb: Suggestive solutions.
  • environment.yml: Conda environment file.

To create the conda environment TECH3_student from the environment file, you can open an anaconda prompt and write:

conda env create --file environment.yml

Note that this datalab requires the nhanes library. If you are using an environment from previous datalabs, this may not be included.

You may install it using

pip install nhanes

It does not seem to available with conda install.

After the environment has been set up, you can activate the conda environment and open Jupyter Notebook using

conda activate TECH3_student
jupyter notebook

For further details on how to set up the conda environment, see the guides on the repository for TECH2

Open the file datalab5.ipynb, and go through the document. Write your own code and try to solve the problems yourself before consulting the solutions notebook.