Workshop 1, Stats for AI
1 General Directions for each workshop
You have to work on any front-end code editor (e.g. Google Colab, VSCode, etc) and create one Jupyter Notebook for each Workshop.
Name your W1-Notebook as “W1-StatsAI-YourFirstName-YourLastname”.
In your Workshop Notebook you have to respond to CHALLENGES/EXERCISES For each challenge, write down the directions before your solution.
- It is STRONGLY RECOMMENDED that you write your OWN NOTES in this Jupyter Notebook; this will be very helpful to study for the final Evaluation.
Once you finish your workshop, make sure that you RUN ALL CHUNKS. Then, render a Jupyter Notebook (.ipynb file)
You have to submit your .ipynb file to Canvas.
The material related to this workshop is covered in Chapters 3, 4, and 5 of my ebook. You can find my ebook at:
2 CHALLENGE 1
Import a dataset from the World Bank site about the GDP per capita for all countries for the year 2025. (Get the code with any LLM).
Once you download it, review the dataset and decide whether you need to do any data treatment/transformation. Make sure that you only have countries (not regions).
- Do you need to do any data treatment/transformation? Explain why yes or why not. If yes, do the data treatments/transformations.
Applying what you learned about descriptive statistics, do the following:
Do a histogram of the GDP per-capita using data for all countries. Use 90 bins fo the histogram. INTERPRET the histogram with YOUR OWN WORDS
In the world what is the typical GDP per-capita ? justify which measure(s) you used and EXPLAIN the results with YOUR OWN WORDS
How can you estimate a good measure of dispersion (variability) of the GDP per-capita? The idea is to provide an idea about how much the GDP per-capita varies across countries. JUSTIFY which measure(s) you used and INTERPRET the results WITH YOUR OWN WORDS
In terms of productivity, what can you say about the gaps that exist between the rich and the poor countries? JUSTIFY your calculations and EXPLAIN with your OWN WORDS
3 CHALLENGE 2
Import daily quotations of the Bitcoin from Jan 1, 2020 to Aug 11, 2026. You can use the yfinance library.
Once you download it, review the dataset and decide whether you need to do any initial data treatment/transformation.
Applying what you learned about descriptive statistics, do the following:
For each question, explain what you did to get the calculation(s) and then respond to the question:
Do a histogram for the daily % simple return. INTERPRET the histogram with your own words
What is a good measure for the “typical” daily % return an investor have gained in Bitcoin considering this period? JUSTIFY which measure you used and interpret your result
Which might the best measure of variability of daily simple returns? JUSTIFY which measure you used, and INTERPRET your result with your OWN WORDS
Using your daily dataset, generate a monthly dataset using closing Bitcoin quotations (price at the end of the month). Using this monthly price data for Bitcoin, respond to the following:
Do a histogram of monthly simple returns. INTERPRET this histogram WITH YOUR OWN WORDS.
Compare this histogram with the histogram you did with daily data. What is the difference between the two histograms? EXPLAIN with YOUR OWN WORDS. If you are planning to invest in Bitcoin, what can you learn from these histograms before you make a decision? EXPLAIN
Do a time plot to see how much the Bitcoin price has moved over the months. What can you learned from this plot? EXPLAIN with your OWN WORDS
Calculate a column for the log price of Bitcoin and then do a plot of this log price. What can you learn from this plot? EXPLAIN with your OWN WORDS. What information this plot can give you vs the plot of the raw Bitcoin price? EXPLAIN with YOUR OWN WORDS.
Calculate the log monthly returns for Bitcoin and do a histogram of log returns. Compare with the histogram of monthly simple returns. What do you observe? What are the differences? Try to explain these differences with your own intuition.