Bastian

The Fama 1965 Journal of Business paper is a little ambigous in the sentence
you refer to. But later he is clearer and defines a run as a sequence of
numbers of the same sign and he assumes that there are three signs -
positive, negative and zero. It doesn't matter how many numbers there are in
one run, it may be 1 or 100, it still counts as 1 run. The number of runs in
your first example is 3 because the first run is the first negative number,
the second run is the next three positive numbers and the third run is the
final negative number. In your second example, the ambiguity is caused by
the zeros. Often the runs test divides the data into just two subsets
(positive and negative) and a run ends when the next number in the sequence
is not in the same subset. In your second example, if 0 is assumed to be in
the positive subset, there are 13 runs, while if it is in the negative
subset, there are 12. Using the Fama version, there are 15 runs since he has
three signs and his test statistic makes use of three subsets.

Charles Ward

On Fri, Oct 31, 2008 at 5:14 AM, Bastian Offermann <
bastian2507hk@yahoo.co.uk> wrote:

> Hello list,
>
> is anyone of you familiar with Fama's run tests in his 1965 behaviour of
> stock market prices dissertation? I am not quite sure if I understand the
> concept of "runs" correctly. He says *"A run is defined as a sequence of
> price changes of the same sign. For example, a plus run of length i is a
> sequence of i consecutive positive price changes preceded and followed by
> either negative or zero changes."* So far so good.
>
> -1  +5  +6  + 7 -2
>
> So, 5,6,7 should be a plus run of length 3. The total number of runs is
> thus 1 plus, 0 minus, 0 unchanged.
>
> From a different source I get the impression that the runs are counted
> differently. E.g.
>
> 0,-10,1,1,-12,1,-10,-5,1,4,-4,1,0,-11,3,-12,-10,-1,0,1
>
> 13 runs. It does not really say how many of each, confusing me.
>
> Any my code does not really match the result for the long vector. Thanks
> for your input.
>
> Regards
>
>
>
> rsp500 <- c(0,-10,1,1,-12,1,-10,-5,1,4,-4,1,0,-11,3,-12,-10,-1,0,1)
> rsp500 <- c(-1,5,6,7,-2)
> pos <- rsp500[rsp500>0]
> neg <- rsp500[rsp500<0]
> m <- (length(rsp500)^2 + length(rsp500) - length(pos)^2 -
> length(neg)^2)/length(rsp500) # no. of expected runs
> runplus <- 0
> runminus <- 0
> runequal <- 0
> i <- 1
> while(i <(length(rsp500)-1)) {
>                           if(rsp500[i+1] > 0 & rsp500[i] < 0) runplus <-
> runplus + 1
>                           if(rsp500[i+1] < 0 & rsp500[i] > 0) runminus <-
> runminus + 1
>                           if(rsp500[i+1] < 0 & rsp500[i] < 0 & rsp500[i+1]
> == rsp500[i]) runequal <- runequal + 1
>                           if(rsp500[i+1] > 0 & rsp500[i] > 0 & rsp500[i+1]
> == rsp500[i]) runequal <- runequal + 1
>                           i <- i + 1
>              }
>
> _______________________________________________
> R-SIG-Finance@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>

	[[alternative HTML version deleted]]

