Re: [R] Cramer von Mises test for a discrete distribution

2013-02-20 Thread Santiago Guallar
Thanks Barry,
 
Following your list order
1) It pops up a window saying R for windows GUI front-end crashed. Below three 
options: look for on-line solutions; shut down the program; debug the program 
(I'm translating from Spanish)
2) The processor of my laptop is an Intel Core duo 1,60GHz with ram= 4 GB, 32 
bits. The R version I have installed is 2.15.2 (2012-10-26)
3) I read the posting-guide. Ok, it may be basic statistics. Question withdrawn
 
I made an additional mistake: I attached the wrong files. Please run the code 
with these, and you'll see the problem.
 
Santi
 
 

From: Barry Rowlingson b.rowling...@lancaster.ac.uk
To: Santiago Guallar sgual...@yahoo.com 
Cc: r-help@r-project.org r-help@r-project.org 
Sent: Tuesday, February 19, 2013 6:20 PM
Subject: Re: [R] Cramer von Mises test for a discrete distribution

On Tue, Feb 19, 2013 at 2:49 PM, Santiago Guallar sgual...@yahoo.com wrote:
 Hi,

 I'm trying to carry out Cramer von Mises tests between pairs of vectors 
 belonging to a discrete distribution (concretely frequencies from 0 to 200). 
 However, the program crashes in the attempt. The problem seems to be that 
 these vectors only have positive integer numbers (+ zero). When I add a 
 random very small positive decimal to the non-decimal part everything works 
 fine (files prm1  prpmr1). I attach two of these vectors so you can run the 
 following code. I've also thought to divide both vectors by a real constant 
 such as pi. Do you think these two approaches are acceptable?

 setwd()
 require(CvM2SL2Test)
 prm = scan('prm.txt')
 prpmr = scan('prpmr.txt')
 ct1 = cvmts.test(prm, prpmr) # here R crashes

For you maybe. For me, works fine, and:

 ct1

[1] 30.20509

 cvmts.pval( ct1, length(prm), length(prpmr) )

- this is taking a bit longer. I gave up and killed it. Maybe it
would have eventually crashed R, but you said the other function
call crashed R.

Your two mistakes are:

1. Saying R crashes without showing us any kind of crash report or
error message.
2. Not listing your system and package versions.

Ah, your three mistakes are...

3. Not reading http://www.r-project.org/posting-guide.html


Barry


198
193
200
173
179
200
198
199
185
171
118
44
154
200
200
199
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
163
200
200
200
200
198
197
200
200
193
189
170
173
23
200
200
200
150
200
131
25
0
0
0
169
200
200
200
200
200
200
197
200
184
166
172
185
200
200
184
200
200
200
200
200
200
197
200
200
200
200
140
200
200
200
197
198
200
200
200
200
200
200
200
200
200
200
150
177
198
200
200
200
200
181
200
200
200
200
136
200
200
200
200
200
183
185
186
123
186
63
64
200
200
200
200
174
200
200
200
200
200
200
200
200
200
200
200
200
193
197
117
115
94
92
200
200
200
200
200
193
179
198
138
35
0
0
141
174
168
127
3
17
0
0
0
0
59
0
134
186
184
190
18
5
0
0
0
101
200
200
200
192
200
180
0
188
98
123
118
147
179
184
198
194
197
199
171
198
199
163
200
199
198
175
200
191
142
141
196
191
200
200
200
192
193
200
200
200
200
200
194
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
196
200
196
200
200
21
9
85
11
4
25
76
200
195
74
77
7
176
183
173
150
41
186
200
200
196
4
0
2
4
0
0
40
200
200
200
200
200
200
200
139
72
200
200
200
200
192
200
200
200
200
200
161
200
200
186
200
200
191
191
183
111
7
0
200
171
20
200
200
200
200
194
187
191
181
94
0
200
195
199
200
200
193
191
200
200
199
200
199
200
200
192
165
186
177
200
200
192
3
0
0
200
168
200
200
195
199
200
200
200
200
200
200
200
200
200
200
197
200
200
200
200
200
200
200
165
199
162
145
123
168
200
200
200
200
200
93
1
95
0
0
0
171
18
0
0
0
188
200
26
200
200
67
184
160
53
0
0
0
0
0
200
200
166
119
95
63
0
0
0
1
106
41
200
200
200
200
200
198
200
200
200
200
200
93
176
195
128
142
19
63
200
200
152
0
0
1
188
188
198
189
174
196
200
70
0
0
0
0
40
2
200
168
19
0
0
0
0
0
0
0
0
0
0
0
165
190
135
199
200
12
0
0
126
200
200
200
200
200
200
200
197
200
175
0
179
0
129
193
184
161
176
177
0
0
0
0
176
163
186
140
183
171
178
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
200
194
139
31
197
106
161
68
0
0
0
0
0
200
200
193
167
200
200
200
199
200
200
196
200
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cramer von Mises test for a discrete distribution

2013-02-20 Thread Barry Rowlingson
On Wed, Feb 20, 2013 at 10:03 AM, Santiago Guallar sgual...@yahoo.com wrote:
 Thanks Barry,

 Following your list order
 1) It pops up a window saying R for windows GUI front-end crashed. Below
 three options: look for on-line solutions; shut down the program; debug the
 program (I'm translating from Spanish)

 That's good - often people say crash when all they have seen is a
stop from R.

 2) The processor of my laptop is an Intel Core duo 1,60GHz with ram= 4 GB,
 32 bits. The R version I have installed is 2.15.2 (2012-10-26)

 Nicely up to date...

 3) I read the posting-guide. Ok, it may be basic statistics. Question
 withdrawn

 Oh don't do that! You're not asking how to do basic statistics, you
are trying to do it yourself and getting a crash. Fair question for
starters...

 I made an additional mistake: I attached the wrong files. Please run the
 code with these, and you'll see the problem.

 Will I, will I, will I

 ct1 = cvmts.test(prm, prpmr) # here R crashes

 *** caught segfault ***
address 0x5620e458, cause 'memory not mapped'

Traceback:
 1: .C(CvMTestStat, as.double(x), as.integer(length(x)),
as.double(y), as.integer(length(y)), testscore = double(1))
 2: cvmts.test(prm, prpmr)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:

Yes! This looks like a bug in that package function, a bit of
investigation seems to blame it on when you have repeated values in
the vectors:

 cvmts.test(1:10,1:10)
[1] 0.025
 cvmts.test(rep(1,10),rep(1,10))
[1] 0.955
 cvmts.test(rep(1,10),rep(2,10))

 *** caught segfault ***
address 0x514daba8, cause 'memory not mapped'

Traceback:
 1: .C(CvMTestStat, as.double(x), as.integer(length(x)),
as.double(y), as.integer(length(y)), testscore = double(1))
 2: cvmts.test(rep(1, 10), rep(2, 10))

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace

Functions shouldn't crash like this - so time for you to email the maintainer:

 packageDescription(CvM2SL2Test)$Maintainer
[1] Yuanhui Xiao yx...@gsu.edu

The function disappears into C code, but I suspect its dividing by
zero somewhere...

Barry

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cramer von Mises test for a discrete distribution

2013-02-20 Thread Santiago Guallar
Great Barry!
Thanks for your time. I will e-mail the package maintainers.
 
Santi

From: Barry Rowlingson b.rowling...@lancaster.ac.uk
To: Santiago Guallar sgual...@yahoo.com 
Cc: r-help@r-project.org r-help@r-project.org 
Sent: Wednesday, February 20, 2013 1:36 PM
Subject: Re: [R] Cramer von Mises test for a discrete distribution

On Wed, Feb 20, 2013 at 10:03 AM, Santiago Guallar sgual...@yahoo.com wrote:
 Thanks Barry,

 Following your list order
 1) It pops up a window saying R for windows GUI front-end crashed. Below
 three options: look for on-line solutions; shut down the program; debug the
 program (I'm translating from Spanish)

That's good - often people say crash when all they have seen is a
stop from R.

 2) The processor of my laptop is an Intel Core duo 1,60GHz with ram= 4 GB,
 32 bits. The R version I have installed is 2.15.2 (2012-10-26)

Nicely up to date...

 3) I read the posting-guide. Ok, it may be basic statistics. Question
 withdrawn

Oh don't do that! You're not asking how to do basic statistics, you
are trying to do it yourself and getting a crash. Fair question for
starters...

 I made an additional mistake: I attached the wrong files. Please run the
 code with these, and you'll see the problem.

Will I, will I, will I

 ct1 = cvmts.test(prm, prpmr) # here R crashes

*** caught segfault ***
address 0x5620e458, cause 'memory not mapped'

Traceback:
1: .C(CvMTestStat, as.double(x), as.integer(length(x)),
as.double(y),    as.integer(length(y)), testscore = double(1))
2: cvmts.test(prm, prpmr)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:

Yes! This looks like a bug in that package function, a bit of
investigation seems to blame it on when you have repeated values in
the vectors:

 cvmts.test(1:10,1:10)
[1] 0.025
 cvmts.test(rep(1,10),rep(1,10))
[1] 0.955
 cvmts.test(rep(1,10),rep(2,10))

*** caught segfault ***
address 0x514daba8, cause 'memory not mapped'

Traceback:
1: .C(CvMTestStat, as.double(x), as.integer(length(x)),
as.double(y),    as.integer(length(y)), testscore = double(1))
2: cvmts.test(rep(1, 10), rep(2, 10))

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace

Functions shouldn't crash like this - so time for you to email the maintainer:

 packageDescription(CvM2SL2Test)$Maintainer
[1] Yuanhui Xiao yx...@gsu.edu

The function disappears into C code, but I suspect its dividing by
zero somewhere...

Barry



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Cramer von Mises test for a discrete distribution

2013-02-19 Thread Santiago Guallar
Hi,
 
I'm trying to carry out Cramer von Mises tests between pairs of vectors 
belonging to a discrete distribution (concretely frequencies from 0 to 200). 
However, the program crashes in the attempt. The problem seems to be that these 
vectors only have positive integer numbers (+ zero). When I add a random very 
small positive decimal to the non-decimal part everything works fine (files 
prm1  prpmr1). I attach two of these vectors so you can run the following 
code. I've also thought to divide both vectors by a real constant such as pi. 
Do you think these two approaches are acceptable?
 
setwd()
require(CvM2SL2Test)
prm = scan('prm.txt')
prpmr = scan('prpmr.txt')
ct1 = cvmts.test(prm, prpmr) # here R crashes
ct1
cvmts.pval( ct1, length(prm), length(prpmr) )
 
 
Thank you for your help,
 
Santi199.09  
193.59  
199.99  
173.89  
179.99  
200.89  
198.89  
200.09  
186.59  
171.79  
118.79  
44.19   
155.79  
200.49  
201.29  
199.99  
201.09  
201.19  
200.39  
200.59  
201.19  
200.79  
201.09  
201.29  
200.79  
200.99  
201.19  
200.99  
201.49  
201.39  
200.99  
199.99  
201.29  
201.39  
201.19  
164.89  
200.79  
200.29  
201.49  
200.99  
198.99  
198.29  
200.09  
201.09  
194.29  
189.49  
170.29  
173.99  
23.99   
200.39  
200.49  
200.79  
151.19  
201.09  
131.79  
25.39   
0.29
0.69
1.39
170.49  
200.59  
201.89  
200.89  
201.19  
201.29  
200.99  
197.89  
200.89  
185.09  
166.69  
172.59  
185.99  
201.59  
201.59  
184.49  
200.99  
201.99  
200.19  
200.69  
201.19  
201.89  
197.29  
201.29  
200.39  
201.69  
200.39  
140.99  
200.69  
200.49  
201.69  
197.39  
198.79  
201.09  
200.39  
201.09  
200.79  
201.39  
200.89  
201.29  
201.39  
201.49  
201.29  
150.39  
178.29  
199.29  
201.49  
200.69  
201.29  
200.69  
182.29  
200.99  
201.19  
200.99  
201.59  
136.69  
200.59  
200.89  
201.89  
200.39  
201.49  
184.29  
185.49  
187.09  
124.29  
187.19  
64.19   
65.19   
201.39  
201.09  
201.39  
201.89  
175.39  
200.19  
200.79  
200.99  
200.19  
201.19  
201.19  
201.19  
201.59  
200.69  
200.79  
201.29  
201.69  
193.49  
197.99  
118.19  
115.89  
95.29   
92.89   
201.29  
200.99  
201.09  
201.59  
201.49  
193.99  
179.59  
198.39  
139.09  
36.09   
0.99
1.49
141.39  
174.89  
169.19  
128.59  
3.59
18.19   
0.89
0.69
0.49
1.39
59.89   
1.69
135.09  
186.99  
185.49  
190.19  
19.79   
5.79
1.19
1.19
1.49
102.09  
200.79  
201.39  
201.09  
193.19  
201.49  
180.59  
0.69
189.09  
98.79   
123.69  
119.09  
148.19  
179.69  
185.29  
199.09  
195.59  
197.99  
200.09  
172.19  
198.59  
199.99  
164.69  
201.39  
200.59  
198.39  
175.69  
200.59  
192.09  
143.49  
142.39  
196.79  
191.69  
200.99  
200.79  
200.89  
193.39  
193.39  
201.59  
201.39  
200.39  
200.89  
200.79  
195.39  
200.49  
200.99  
200.69  
201.49  
201.49  
200.59  
201.29  
200.59  
200.79  
200.79  
201.69  
200.99  
201.39  
201.09  
201.39  
200.49  
201.49  
201.09  
201.29  
200.39  

Re: [R] Cramer von Mises test for a discrete distribution

2013-02-19 Thread Barry Rowlingson
On Tue, Feb 19, 2013 at 2:49 PM, Santiago Guallar sgual...@yahoo.com wrote:
 Hi,

 I'm trying to carry out Cramer von Mises tests between pairs of vectors 
 belonging to a discrete distribution (concretely frequencies from 0 to 200). 
 However, the program crashes in the attempt. The problem seems to be that 
 these vectors only have positive integer numbers (+ zero). When I add a 
 random very small positive decimal to the non-decimal part everything works 
 fine (files prm1  prpmr1). I attach two of these vectors so you can run the 
 following code. I've also thought to divide both vectors by a real constant 
 such as pi. Do you think these two approaches are acceptable?
 
  setwd()
  require(CvM2SL2Test)
  prm = scan('prm.txt')
  prpmr = scan('prpmr.txt')
  ct1 = cvmts.test(prm, prpmr) # here R crashes

 For you maybe. For me, works fine, and:

  ct1

[1] 30.20509

  cvmts.pval( ct1, length(prm), length(prpmr) )

 - this is taking a bit longer. I gave up and killed it. Maybe it
would have eventually crashed R, but you said the other function
call crashed R.

Your two mistakes are:

 1. Saying R crashes without showing us any kind of crash report or
error message.
 2. Not listing your system and package versions.

Ah, your three mistakes are...

 3. Not reading http://www.r-project.org/posting-guide.html


Barry

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.