[R] Zipf distribution fitting with VGAM

From: zhyzhou <zhyzhou_at_mail.ustc.edu.cn>
Date: Thu, 15 May 2008 01:40:24 -0700 (PDT)

Dear R users:

I want to fit my data with zipf distribution using VGAM package, I used the following script:

	w<-read.csv("the data file path")
	y<-1:length(w)
	fit = vglm(y ~ 1, zipf(link=identity, init=0.5), tra=TRUE, weight=w)

After run it, I encountered the problem : gharmonic(extra$N, s = ss - 1) : bad input for argument "s"

After that, i use the following script to generate a series of data that obey zipf distribution:

N<-5
y<-1:N
zipf.data<-(y^(-0.5))/sum((1:N)^(-0.5))

and use the zipf.data as the weights, run the following script:

fit = vglm (y ~ 1, zipf(link=identity), tra=TRUE, weight=zipf.data)

i still got the error: gharmonic(extra$N, s = ss - 1) : bad input for argument "s"

How to fix the problem. I only want to fit my data with zipf distribution and get the para s.

Thanks in advance.

-- 
View this message in context: http://www.nabble.com/Zipf-distribution-fitting-with-VGAM-tp17248345p17248345.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_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.
Received on Thu 15 May 2008 - 12:05:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 15 May 2008 - 12:30:43 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive