On Oct 6, 2010, at 7:38 PM, Abey George wrote:

I am trying to only fit this distribution to the data to see how well it fits it. Getting the parameters is secondary. Did correct the square brackets in the exponential equation but still get the same result. There is only 1 variable to data2 and that is points.

I was asking for the data. The process of trying to guess what other errors you are making is tedious.

I am trying to fit this distribution to points data scored by teams.

The result for any(data2 < 0.5 | data2 > 0.5+50) is TRUE.

It should NOT be TRUE if you are using those limits as your bounding parameters. So there is a further source of problem .... very possibly why you are getting NaNs.

--
David.


Thanks
Abey


On Mon, Oct 4, 2010 at 11:33 AM, David Winsemius <dwinsem...@comcast.net > wrote:

On Oct 3, 2010, at 3:47 PM, Abey George wrote:

Hi,
I am trying to fit a Johnson SB distribution using fitdist function in fitdistrplus Library. I have defined the Johnson SB distribution from (
http://www.ntrand.com/johnson-sb-distribution/) . But it gives me the
follwing errors. Any help would be appreciated

Are you really trying to estimate the bounding values as well as the gamma and delta parameters. Those would seem to be more likely determined by the nature of the problem, e.g., policy limits on the insured sums if this were a financial problem.



#xi = xi

#lambda =l
#delta =d
#gamma = g

djohn = function(x,xi,l,d,g)
(d/(l*sqrt(2*pi)*((x-xi)/l)*(1-((x-xi)/l))))*exp[-0.5*(g +
d*log(((x-xi)/l)/(1-((x-xi)/l))))^2]

You used exp[ ] where you probably wanted exp().



pjohn = function(x,xi,l,d,g) pnorm(g + d*log(((x-xi)/l)/(1-((x-xi)/ l))))

qjohn = function(p,xi,l,d,g)   xi + (l*exp((qnorm(p) - g)/d))/(1 +
exp((qnorm(p) - g)/d))

f1c <- fitdist(data2,"john",start=list(xi = 0.5 ,l = 50, d = 1, g = 1))

You have not given us the "data2" variables, so we have no way of checking whether any of them appear outside the range [epsilon, lambda+epsilon]. Using your data2 vector, what are the results of :

any(data2 < 0.5 | data2 > 0.5+50)   #?


Error in fitdist(data2, "john", start = list(xi = 0.5, l = 50, d = 1, :
 the function mle failed to estimate the parameters,
              with the error code 100
In addition: Warning message:
In log(((x)/l)/(1 - ((x)/l))) : NaNs produced


Cheers
AG

David Winsemius, MD
West Hartford, CT

______________________________________________
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.

Reply via email to