Project: Portfolio Selection · Tracking Generating Functions
Lesson 1
A generating function can record every possible choice of shares. For stock \(i\), choosing \(a\) shares contributes spent money \(p_{i} a\) and tracking error \(|p_{i} a-t_{i}|\). We encode these two quantities by the monomial \(z^{p_i a}w^{|p_i a-t_i|}\).
For all stocks together, the generating function is \[F(z,w)=\prod_{i=1}^{n}\sum_{a=0}^{m_i}z^{p_i a}w^{|p_i a-t_i|}.\] When we expand this product, choosing one term from each factor is exactly the same thing as choosing one feasible number of shares for each stock. The coefficient \([z^{b} w^{e}]F(z,w)\) counts share vectors that spend exactly \(b\) and have total tracking error \(e\).