# Interpreting description of a particular (momentum-based) data processing technique

I'm attempting to prepare data in the same manner as section 2 of this paper.

I'm finding it a bit of a struggle. Could someone check (/improve upon) my interpretation regarding the 2 sections I have highlighted (below)?

In the first section (highlighted in yellow):

We note that price momentum is a cross-sectional phenomenon with winners having high past returns and losers having low past returns relative to other stocks. Thus we normalize each of the cumulative returns by calculating the z-score relative to the cross-section of all stocks for each month or day.

... I'm struggling to understand exactly what is being described.

As far as I can see, the process would be:

• For each day ...
• for each stock ...
• Assemble a trailing length-33 vector of past prices
• Use this to compute stock's mean & standard deviation
• Use today's price $x$ to compute stock's z-value: $z = \frac{x-\mu}{\sigma}$ (If I understand correctly, $z$ is a basic indication of momentum).
• Now we have a z-vector over all stocks for this day. Normalize it! (?)
• Now we have a vector indicating relative momentum for each stock for this day.

And the section (highlighted in green):

Finally we use returns over the subsequent month, t + 1, to label the examples with returns below the median as belonging to class 1 and those with returns above the median to class 2.

... I think translates as:

• get monthly returns for months t-13 through t+1 & compute median
• class = 1 if return for month t+1 < median else 2

So it looks as though class 2 stocks follow their normalised $z$ momentum-indicator, whereas class 1 don't.

Does this look correct? PS No tag for 'data-processing'

• First off, I think your interpretation of the first section is wrong. You need to take the month returns of all the stocks in the sample, and then each stock's z score is its relative position in that distribution. – will Oct 10 '16 at 6:25
• The use of the word cross-sectional in the first paragraph (in 2 places) is crucial: momentum is being measured by comparing the cumret of one stock x to those of all the other stocks being considered. So $\mu,\sigma$ in the z calculation refer to the the average and std dev of cumret across all stocks. – noob2 Oct 10 '16 at 13:34

Tentatively, thanks to the comments and people on IRC (braverock, bluelou), I think this is the basic stratagem:

• pick a point in time t
• for each k of our N stocks get prices p(k,:) i.e. p(k, 1) thru p(k, 12) for the 12 months t-13 to t-2
• perform cumulative sum: s = cumsum(p, 2);
• for each of these 12 datapoints,
• calculate mean $\mu$ and Standard Deviation $\sigma$ for each of our N stocks and hence calculate $z$ for each stock. i.e. 'the number of sd-s $s$ is above the average stock $s$.'
• normalize the vector $z$. so we scale everything so that e.g. If the whole market inflates by 10% say, our vector remains unchanged.

(...and then we do the same process for the last 20 days).

So I think it is just trying to 'normalise' the position of each stock within the market at each datapoint, i.e. reduce it to a number roughly between say -3 and +3.

I learned that it is important to get your input data having a mean of 0.

I'm still not quite sure why they don't simply use for their output indicator:

• class 1 if the stock falls in the next month
• class 2 if the stock rises in the next month