## Quant projects

back to home

### Michigan Quant Lab

We meet on Fridays,10:10am-12pm, in Weiser, room 269.

### Meeting agenda

Feb 16, 2018
1. Fermi Question: what is the weight of a bowling ball, measured in drops of water?
2. Introduction to Java and Eclipse.
1. You may need to install the JDK (Java Development Kit).
3. Workflow for beginning of any project: Create Java Project, create package, create first class (e.g. HelloWorld).
3. HackerRank Java Intro reading via Scanner.
4. We implement the Alex and Beth Coin flipping problem from last week in both Python and Java, and compare the implementations.
5. Market Review
Feb 9, 2018
1. A question from Fermi Questions.
2. Alex and Beth are flipping coins. See problem 3.20 from Quant interview book.
3. Counting rectangles: Project Euler problem 85.
4. Market Review
Feb 2, 2018
1. A question from Fermi Questions.
2. Imagine it's snowing...see problem 13 from the Quant interview book.
3. Coding warmup: Sometimes, you just need more precision. Try Project Euler problem 80. But before you code it, put on your Fermi hat, and estimate the answer.
4. A wrap-up on what we wrote last week for tranched credit indices.
5. Market Report. How did Tesla raise money this past week?
Jan 26, 2018
1. Brainteasers: How many footballs are needed to fill Michigan Stadium? How many cows are in Mexico? How much of the water from Archimedes' famous bath is in my coffee? Practice using Fermi Questions.
2. Coding warmup: Project Euler problem 81. Does this look familiar?
3. We've spent a couple of weeks talking about modeling a set of variables that are jointly normal with identical pairwise correlation, and we built a simulation of it. Let's use it to build a simple tranched credit index. For more depth on tranched credit indices, see this BIS article or this more entertaining FT report (requires free signup with Alphaville). And here is the code we wrote for tranched credit indices
4. Market Report. What did Mnuchin and Trump say about the dollar? And is it time to sell stock?
Jan 19, 2018
1. Warmup: Project Euler problem 50. Solution is here.
2. Recall the problem from last time: We built a simulation of n correlated assets, and via Monte Carlo simulation in Python, we found an empirical distribution of the number of assets that had negative return. Why is the number of assets that have positive return uniformly distributed? Try to figure it out on your own. But if you must, solution is here, starting on page 3.
3. Market Report.
Jan 5, 2018
1. Wrap up Python implementation of the bag with 3 red, and 3 black marbles (see previous week). How big can you scale up your solver?
2. Student presentation: Solution to the minmax correlation problem from Jane Street? Solutions presented by Patrick Lu and Jiahua Gu.
3. Consider problem 5.2 from the Quant Technical Interview Questions. We built a simulation of n correlated assets, and via Monte Carlo simulation in Python, we found an empirical distribution of the number of assets that had negative return. Challenge for next time: explain the distribution for the case where pairwise asset correlation is 0.5.
4. Market Report: Bitcoin continues to be in the news.
Dec 1, 2017
1. Show that 1 is the only number in the sequence {1, 11, 111, 1111, ....} that is a perfect square.
2. Have you seen the minmax correlation problem from Jane Street? Looking for someone to present a solution in first January meeting.
3. Recall the problem of the bag with 3 red, and 3 black marbles (see previous week). Implement in Python. What's the strategy if there are 26 red, and 26 black (e.g. like a deck of cards)? What is there are 10,000 red?
4. Market Report: Bitcoin history, Bitcoin bubble. Is Blockchain the real story? Ongoing transformation of retail to online—where will the warehouse space come from? The US may not be able to produce as much oil as we thought. Why?
Nov 17, 2017
1. Complete Running Median problem.
2. There is a bag with 3 red, and 3 black marbles. You draw marbles without replacement, winning a dollar if it is red, paying a dollar if black. What's your strategy?
3. Market Report: Bitcoin volatility, Bitcoin as crisis currency, Bitcoin for Square. Norway divesting oil equities.
Nov 10, 2017
1. Continue implementation of heap in Python, and apply it to the Running Median problem.
Nov 3, 2017
1. Getting the right data structure: Review problem (6.14) from Quant interview book.
2. What's a heap, and why do we care? We implement one in Python, and apply it to the Running Median problem.
3. Market Report: What went on at the Fed this week ? Search Yellen and Powell. What does Blankfein think about tax cuts, and why?
Oct 27, 2017
1. Market Report: What happened with Alphabet, Amazon, and Microsoft on Thursday? What are stress tests, who cares about them, and what did a US Treasury report just recommend?
2. Two bags of marbles: Problem (8.20) from Quant interview book.
3. What would be the price of 9 year US Treasury bond with 9% coupons? We'll figure it out using zero coupon data from Quandl. Bonus: what's a perpetuity, and how would you price one?
Oct 20, 2017
1. Market Report: Where’s the the Dow? What’s been happening to it over the past week, month, year? SP500? NASDAQ? FTSE 100? Nikkei 225? What happened to ToysRUs CDS spreads last month?
2. Discuss airplane boarding problem (8.18) from Quant interview book.
3. Monte Carlo Simulation: clone the latest code. Discuss the summability of IES (incremental expected shortfall).
4. Coherent risk measures, subadditivity, and an example of the failure of VaR to be subadditive.
Oct 6, 2017
1. Warmup: Project Euler problems 46 and 47.
2. What's a heap?
3. Monte Carlo Simulation: clone the latest code. Calculating VaR at various quantiles shouldn't require re-sorting the PnL. We learn about lazy initialization. We apply the same thing to ES. Time permitting, we compute portfolio risk.
Sep 29, 2017
1. Review last week's brainteaser on checkerboards, dominoes, and trominoes.
2. Coding exercise: Project Euler problems 30 and 35.
3. We will continue studying portfolio risk next week. At 9:50am, we will head over to the Tozzi Lab (Ross, room R0400) for Kai Petainen's Intro to FactSet and Bloomberg workshop, from 10am to noon. This is part of Kai's Fall series of workshops.
Sep 22, 2017
1. Warmup: Project Euler problems 20 and 25.
2. Given the order statistics of a sample of size 10, what are the quantiles associated with each statistic? In particular, the first, and the last? We discuss some approaches to this.
3. Monte Carlo Simulation: clone the latest code. Calculating VaR at various quantiles shouldn't require re-sorting the PnL. We learn about lazy initialization. We compute expected shortfall, aka AVaR (average VaR), aka CVaR (conditional VaR).
4. Brainteaser: Checkerboards, dominoes, and trominoes.
Sep 15, 2017
1. Monte Carlo Simulation: clone the latest code. We altered the Position object in a Portfolio keep track of its PnL, and we can calculate VaR of the position.
March 31, 2017
1. Update as needed from GitHub. We will create a method called `writeSimulation` that can dump any number of market price simulations into a file.
2. Question 3.11 from Quant interview book.
3. We'll finish with practice problems from Project Euler.
March 24, 2017
1. Spent some time getting everybody's code base synced up via umich-quant on GitHub.
2. We added the Market class. A market consists of the risk factors to be simulated, with weighted returns from a specified period. A simulation of the market is generated by taking the inner product of each risk factor's returns with a market noise vector.
March 17, 2017
1. We will complete HackerRank's Cracking the Coding Interview: Heaps: Find the Running Median, by implementing BaseHeap and MaxHeap, then MedianHeap. Source to date is available on GitHub.
2. Update your fork of Python implementation of multi-factor Monte Carlo. If necessary, download historical S&P data from QuantQuote, on the Free Data tab.
3. Questions 3.10 from Quant interview book.
March 10, 2017
1. An easy warmup from HackerRank: Array Left Rotation
2. Began HackerRank's Cracking the Coding Interview: Heaps: Find the Running Median. This is a very nice coding exercise: not only do you learn/review heap data structures, but it is an excellent example of polymorphism via both composition and inheritance. We got the MinHeap up and running. Next week will write BaseHeap and MaxHeap, then MedianHeap.
Feb 24, 2017
1. Via GitHub, get the latest version of our Python implementation of multi-factor Monte Carlo. If necessary, download historical S&P data from QuantQuote, on the Free Data tab.
2. We will add MarketUniverse and Market classes, implement simulation.
3. From HackerRank's Cracking the Coding Interview: Trees, Ransom Notes, and Contacts. If you want to better understand hash tables, watch the video that accompanies Random Notes.
4. Questions 1.10, 8.1, and 8.2 from Quant interview book.
Feb 17, 2017
1. Continue implementation of Multifactor Monte Carlo in Python.
2. Any questions about technical interview book?
Feb 10, 2017

To prepare:

1. Review updates to technical interview book.
2. Install pandas in PyCharm if necessary.
3. Download historical S&P data from QuantQuote, on the Free Data tab. Discovered via Caltech Quantitative Finance Group, which has some interesting information.
4. Begin implementation of Multifactor Monte Carlo in Python.
5. One-on-one discussions to determine what you want to get from your time in the Michigan Quant Lab.
January 27, 2017

To prepare:

1. Install PyCharm Community Edition. We’ll be doing some Python in an IDE that has better debugging support than Jupyter.
2. Solve the BinaryTree problem from the technical interview book. You may use C++ or Python or both.
3. Do LeetCode problems 2 and 20 (some of you have already done #20).
4. Be able to explain why the sum of IES is equal to ES.
5. We discovered that our C++ code for Monte Carlo does not react gracefully to an invalid name for a MarketFactor ("APL" is unknown). A better way to deal with this is through exceptions. Note that we threw a string. Which of these standard exceptions would have been better to throw? Can you add exception handling to these PortfolioSimResult methods? double var(double quantile) const; double expectedShortfall(double quantile) const; If you do this problem, do a pull request from GitHub Desktop. If I like your code, I will add it to the codebase, and list you as a contributor!.
6. Recall the Jane Street min max correlation problem? An equivalent statement is problem 2.7 in the technical interview book. Try to solve it.
7. The mission of the Michigan Quant Lab is to prepare ourselves for employment through practice, and by demonstrating we are involved in something beyond the classroom. Think about the role(s) that need to be handled in the Michigan Quant Lab. Do you want to be developing the website? Implementing pricing algorithms? Building the backtesting framework? Writing a paper that explains and documents parts of our codebase? Creating test cases to verify our algorithms are working correctly? Organizing a Friday afternoon pizza-fueled meeting? Or something else?
January 20, 2017

Carlo Acerbi of MSCI presented on Backtesting expected shortfall.

### Projects

Students in the quant program have the opportunity to develop projects inspired by real-world applications. This involves reading research, designing solutions, and implementing them in a relevant development environment, such as C++ or Python.