Originally presented 6/24/2007 to the NYC Financial Engineering Meetup. It illustrates the use of J to manipulate data quickly and easily in order to explore topics in quantitative financial research. The previous work is here and the continuation of this is here.

Short-Term Return Persistence Without Look-Ahead Bias

So far, the method by which we have examined short-term return persistence has been subject to “Look-Ahead Bias”. This is because we used the entire period of returns to establish the decile ranges but the entire period would not have been available if we had been using this strategy during that historical period. That is, we have biased our results by looking ahead into the future.

To eliminate this bias, we have to re-build our deciles at each historical period using only the data available at that period. Let’s approach this by first working with arbitrary namedvalues for each of our parameters. This will allow us to generalize the code more easily. For instance, let's start with these values:

npw=. 5                    NB. Number of periods for return window.
ndiv=. 10                  NB. Number of quantile divisions, e.g. 10=deciles
mdts=. 2*ndiv              NB. Minimum # divisions to start quantile stats
cnobs=. npw*mdts           NB. Current # observations from which to build return quantiles
rets=. (1{seltkrs){clcrets NB. Look at only GLW returns for now

   >0{mi=. ntilesOnDDayRets ndiv;npw;cnobs{.rets
0 0 0 1 0 0 0 1 0 0
1 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 1 0 0 1
0 0 0 1 1 0 0 0 0 0
0 0 0 0 0 0 1 0 0 1
0 1 0 0 0 1 0 0 0 0
0 0 1 0 0 0 0 0 1 0
0 0 1 0 1 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0
1 0 0 0 0 1 0 0 0 0

Observations

Subsequent Period

Weighted

Decile #

1

2

3

4

5

6

7

8

9

10

Average

1

0

0

0

1

0

0

0

1

0

0

0.63

2

1

0

0

0

0

0

0

0

1

0

0.53

3

0

0

0

0

0

0

1

0

0

1

0.89

Initial

4

0

0

0

1

1

0

0

0

0

0

0.47

Period

5

0

0

0

0

0

0

1

0

0

1

0.89

6

0

1

0

0

0

1

0

0

0

0

0.42

7

0

0

1

0

0

0

0

0

1

0

0.63

8

0

0

1

0

1

0

0

0

0

0

0.42

9

0

0

0

0

0

0

0

1

0

0

0.42

10

1

0

0

0

0

1

0

0

0

0

0.37

   cnobs=. npw*1+2*ndiv  NB. Current # observations from which to build return quantiles

Observations

Subsequent Period

Weighted

Decile #

1

2

3

4

5

6

7

8

9

10

Average

1

0

0

0

1

0

0

0

1

0

0

0.40

2

1

0

0

0

0

0

0

0

1

0

0.70

3

0

0

0

0

0

0

1

0

0

1

0.60

Initial

4

0

0

0

1

1

0

0

0

0

0

0.65

Period

5

0

0

0

0

0

0

1

0

0

1

0.70

6

0

1

0

0

0

1

0

0

0

0

0.75

7

0

0

1

0

0

0

0

0

1

0

0.60

8

0

0

1

0

1

0

0

0

0

0

0.45

9

0

0

0

0

0

0

0

1

0

0

0.45

10

1

0

0

0

0

1

0

0

0

0

0.35

The previous work is here and the continuation of this is here.

DevonMcCormick/Research/HoldingWinnersSellingLosers4STReturnPersistenceAvoidingLookAhead (last edited 2011-03-01 00:05:53 by DevonMcCormick)