Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Goodness-of-fit statistics for Weibull fits

96 views
Skip to first unread message

Ante Lausic

unread,
Dec 3, 2009, 9:43:03 PM12/3/09
to
I was doing Weibull fits to a bunch of data and found the confidence intervals portion of the fit but I was wondering if it was possible to extract a goodness-of-fit statistic like the r-squared value or the SSE value for the fit.

I tried doing it in cftool but it won't recognize Weibull fits. I upload my array of numbers and add it and when I fit with Weibull, it gives the doesn't fit error even if I give it the a and b starting values that if ound with wblfit.

Thanks ahead of time,
Ante Lausic

Peter Perkins

unread,
Dec 4, 2009, 8:58:05 AM12/4/09
to
Ante Lausic wrote:
> I was doing Weibull fits to a bunch of data and found the confidence intervals portion of the fit but I was wondering if it was possible to extract a goodness-of-fit statistic like the r-squared value or the SSE value for the fit.
>
> I tried doing it in cftool but it won't recognize Weibull fits. I upload my array of numbers and add it and when I fit with Weibull, it gives the doesn't fit error even if I give it the a and b starting values that if ound with wblfit.

Ante, the first question is, what exactly do you mean by "Weibull fit" -- are you fitting a Weibull distribution or doig regression with a Weibull curve? WBLFIT is for the former, CFTOOL the latter. Please see this demo:

<http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/cfitdfitdemo.html>

Ante Lausic

unread,
Dec 4, 2009, 10:22:03 AM12/4/09
to
Peter Perkins <Peter....@MathRemoveThisWorks.com> wrote in message <hfb4hd$hmm$3...@fred.mathworks.com>...
> Ante Lausic wrote:
> > I was doing Weibull fits to a bunch of data and found the confidence intervals ....

>
> Ante, the first question is, what exactly do you mean by "Weibull fit" -- are you fitting a Weibull distribution or doig regression with a Weibull curve? WBLFIT is for the former, CFTOOL the latter. Please see this demo:
>
> <http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/cfitdfitdemo.html>

When I plot my 1-D array with wblplot, it plots it on the Weibull type graph paper and fits it. Since it is appoximately linear in this type of plot, I know it follows Weibull. I can perform wblfit to get the parameters based on this 1-D array but I wish to know how well that linear line it drew through my points on the Weibull plot is based on goodness of fit statistics.
From the demo above, they have a 2 coordinate system that they can match to the Weibull curve but I don't have the second parameters. Is it necessary to have the corresponding second variable to get goodness-of-fit statistics? Also, I need to see the graph in the Weibull scale but I don't believe the cruve fitter graph can be switched to the Weibull axes.

Peter Perkins

unread,
Dec 6, 2009, 12:57:20 PM12/6/09
to
Ante, I'm not sure you took my point.

Your original post was unclear about whether you were fitting a Weibull dist'n to a single vector of data, or fitting a nonlinear regression to two vectors of data using a Weibull curve. That demo compares those two goals. Based on your response, it sounds like you are doing the former, although I think you are fitting the distribution using a method that is superficially like a regression, as described here:

<http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/cdffitdemo.html>

rather than by maximum likelihood, which is what WBLFIT does.

The method it sounds like you're using does fit a straight line to a bivariate set of data, but it important to remember that it is NOT at all like the kind of straight line fitting that you'd do in the usual regression model. In particular, I don't believe that goodness-of-fit statistics such as r^2 and SSE have any relevance here. The usual thing that people do for a goodness of fit test on univariate data is a Kolmogorov-Smironov test, but that has the drawback that you need to test against a fully known distributionm and not one thqt you've estimated from the same data that you are testing goodness of fit on. However, Weibull is related to Extreme Value, and you might be able to get away with using the Lilliefors test as in LILLIETEST in that Statistics Toolbox.

My suggestion is always to _look_ at the fit too, an decide if it capture the data well. You've actually already done that with your "graphical fit". You might also want to look at the empirical CDF against the fitted Weibull CDF, and DFITTOOL will make that easy.

Hope this helps.

Mohamed Al-Dabbagh

unread,
Dec 14, 2009, 9:32:46 AM12/14/09
to
On Dec 4, 5:43 am, "Ante Lausic" <ante.lau...@utoronto.ca> wrote:
> I was doing Weibull fits to a bunch of data and found the confidence intervals portion of the fit but I was wondering if it was possible to extract agoodness-of-fitstatistic like the r-squared value or the SSE value for the fit.

>
> I tried doing it in cftool but it won't recognize Weibull fits. I upload my array of numbers and add it and when I fit with Weibull, it gives the doesn't fit error even if I give it the a and b starting values that if ound with wblfit.
>
> Thanks ahead of time,
> Ante Lausic

Take a look at a recent paper I published about a new method to
calculate goodness-of-fit:

http://cf.net16.net/eta

Mohamed Al-Dabbagh

0 new messages