Re: fit F distribution
- From: "Tom Lane" <tlane@xxxxxxxxxxxxx>
- Date: Tue, 21 Oct 2008 18:15:39 -0400
I tried with my own data though and tried many different starting values
but the following error kept coming up:
?? Error using ==> mlecustom>llf_pdfcdf at 431
The PDF function returned NaN or infinite values.
Leo, your variable has mean 3.1338 and variance 4.5367. There's no F
distribution with those values. To get a mean of about 3 you'd need your
second parameter to be 3, and the variance is infinite in that case. This
doesn't prove there's no maximum likelihood estimate, but I can imagine the
mle function might run into trouble trying parameter values that approach
the boundary of the parameter space or for some other reason cause trouble.
I also tried Peter's idea, but didn't wind up with an F distribution.
Is there a theoretical or other reason you need an F distribution? For no
good reason I picked the value 3 and was able to fit x/3 by an F
distribution reasonably well:
p =ecdf(x)
p = mle(x/3,'pdf',@fpdf,'start',1:2)
9.7097 18.9723
xx = linspace(0,14); line(xx,fcdf(xx/3,p(1),p(2)),'color','r')
I can even estimate the scale parameter:
q =q = mle(x,'pdf',@(x,v1,v2,s) (1./s) .* fpdf(x/s,v1,v2),'start',[10 10 3])
47.4769 7.9663 2.3680
line(xx,fcdf(xx/q(3),q(1),q(2)),'color','m')
-- Tom
.
- References:
- fit F distribution
- From: leo nidas
- Re: fit F distribution
- From: Tom Lane
- Re: fit F distribution
- From: leo nidas
- fit F distribution
- Prev by Date: Command line resize figure?
- Next by Date: Re: Custom Fitting to a Distribution
- Previous by thread: Re: fit F distribution
- Next by thread: Re: fit F distribution
- Index(es):
Relevant Pages
|