I have a given time series of bond yields from Quandl. From the time series, I have taken a sample to simulate a path of bond yields by Monte Carlo in Python.
I have to do the following task:
"Calculate the average empirical duration and convexity of any one of the bond indices for the sample period.
The following approximate relationship exists between yields changes and total returns (log changes in total return index):
$$\ln \left( \frac{TRI_{t}}{TRI_{t-1}} \right)≈Q -D(y_{t}-y_{t-1} )+\frac{C}{2} (y_{t}-y_{t-1} )^2$$
Where $TRI$ is the total return index, $y$ is the yield, $Q$ is the empirical carry, $D$ is the empirical duration, and $C$ is the empirical convexity. This can be expressed as a simple linear regression of the form $y = a + bx + cz$. Estimating the parameters will help you determine the required quantities. Note: yields are in percentage terms so converting to decimal, or alternatively scaling the left-hand side by 100, will give sensible duration numbers."
I don't know anything about finance, or regression. A simple google search did not show the meaning of "empirical carry", so I don't really understand how to approach the question. Since the given relationship above has a quadratic term (in bond yields $y$), how can it fit the linear form $y = a +bx + cz$?
A general explanation of how I should approach this would be appreciated. I need to do this in Python (using pandas, numpy, all the standard packages). Thanks!