[R] Error in optim while using fitdistr() function

From: Jason Q. McClintic <jqmcclintic_at_stthomas.edu>
Date: Sun, 10 Feb 2008 09:15:15 -0600

I get the digest, so I apologize if this is a little late.

For your situation (based on the description and what I think your code is doing, more on that below), it looks like you are modeling a Poisson flow where the number of hits per unit time is a random integer with some mean value.

If I understand your code correctly, you are trying to put your data into k bins of width f<-(max(V1)-min(V1))/k. In that case I would think something like this would work more efficiently:

m<-min(V1);
k<-floor(1 + log2(length(V1)));
f<-(max(V1)-min(V1))/k;

binCount<-NULL;
for(i in seq(length=k)){
  binIndex<-which((m+(i-1)*f<V1)&(V1<m+i*f));   binCount[i]<-sum(V2[binIndex]);
};

where i becomes the index of time intervals.

Hope it helps.

Sincerely,

Jason Q. McClintic

r-help-request_at_r-project.org wrote:
> Send R-help mailing list submissions to
> r-help_at_r-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://stat.ethz.ch/mailman/listinfo/r-help
> or, via email, send a message with subject or body 'help' to
> r-help-request_at_r-project.org
>
> You can reach the person managing the list at
> r-help-owner_at_r-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-help digest..."
>



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 Sun 10 Feb 2008 - 15:18:38 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 Sun 10 Feb 2008 - 17:30:13 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