03-03-2016 07:50 AM
Hello,
I want to fit a three-parameter Weibull distribution to a set of data points. using the least squares method. I plotted ln(-ln(1-p) against ln (x-c), where p is the cumulative probability and c the locaiton parameter of the Weibull, and used the regression funciton to fit a straight line. I now want to search for a value of c, say between0.5*min(x) and 0.75*min(x), that gives the highest coefficient of determinaiton. Is there a funciton which can do this or do I have to use some kind of loop?
Regards,
Josef
03-04-2016 02:46 PM
Hi Josef,
I tried to recreate data like you described, but subtracting different c values from the x channel and plotting vs. ln(x-c) just shifted the curve horizontally. It doesn't change the shape of the curve, so it can't change the validity of the least squares fit.
What am I missing?
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-04-2016 03:00 PM
Hi Brad,
Thank you for your reply. This Matlab example explains exactly what I want to acheive (http://uk.mathworks.com/help/stats/examples/fitting-a-univariate-distribution-using-cumulative-proba... please read the section A Threshold Parameter Example. I mangaed to write all the steps in DIADEM except for
cHat = fminbnd(threshObj,.75*min(x), .9999*min(x));
The function fminbnd finds the minimum of the function threshObj between .75*min(x) and .9999*min(x).
Regards,
Josef
03-04-2016 03:17 PM
Hi Josef,
I took another look at the curves I tried to create based on your description and noticed that though the general form of the curve doesn't change with the value of the "c" variable, the resulting slope of the linear fit does.
I think you're stuck with a loop,
Brad Turpin
DIAdem Product Support Engineer
National Instruments