[R] a series of 1's and -1's

Ingmar Visser I.Visser at uva.nl
Thu Jan 12 11:32:05 CET 2006


You could try to zip your data file and see whether there is a change in
file size that you feel is significant in which case the series is not
random (-:
To be sure, there is no such thing as a positive test for randomness, only
tests for specific deviations of randomness of which the runs.test and the
entropy are just two examples. Zip programs use a whole bunch of these tests
to compress files by finding structure in the data.
best, ingmar

> From: Roger Bivand <Roger.Bivand at nhh.no>
> Reply-To: Roger.Bivand at nhh.no
> Date: Thu, 12 Jan 2006 08:42:25 +0100 (CET)
> To: Mark Leeds <Mleeds at kellogggroup.com>
> Cc: R-Stat Help <R-help at stat.math.ethz.ch>
> Subject: Re: [R] a series of 1's and -1's
> 
> On Wed, 11 Jan 2006, Mark Leeds wrote:
> 
>> Does anyone know of a simple test
>> in any R package that given
>> a series of negative ones and positive
>> ones ( no other values are possible in the series )
>> returns a test of whether the series is random or not.
>> ( a test at each point would be good but
>> I can use the apply function to implement
>> that ) ?
> 
> help.search("runs") points to function runs.test() in package tseries,
> with examples:
> 
> x <- factor(sign(rnorm(100))) # randomness
> runs.test(x)
> x <- factor(rep(c(-1, 1), 50)) # over-mixing
> runs.test(x)
> 
> which looks like your case
> 
>>  
>>                                        thanks.
>>                 
>> 
>> 
>> **********************************************************************
>> This email and any files transmitted with it are confidentia...{{dropped}}
>> 
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>> 
> 
> -- 
> Roger Bivand
> Economic Geography Section, Department of Economics, Norwegian School of
> Economics and Business Administration, Helleveien 30, N-5045 Bergen,
> Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
> e-mail: Roger.Bivand at nhh.no
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list