Page 1 of 1

Weibull Distribution

Posted: Saturday 11 August, 2012 - 20:23
by Heimann
I Use Minitab Software for choice best distribution form my data
in minitab for Weibull distribution Use Shape & Scale paramiters but in ED Use mean of the distribution and alpha parameter of the distribution with this Syntax:
Weibull(e1, e2 {, e3})
Parameter 1 (e1) is the mean of the distribution. Parameter 2 (e2) is the alpha parameter of the distribution. Parameter 3 (e3) is a specific random generator. If parameter 3 is omitted the default generator (1) is used

Are these correct?
Scale Parameter=mean of the distribution
shape parameter=alpha parameter
Always in ED Correct?

thamks for your Answers
Heimann

Re: Weibull Distribution

Posted: Monday 13 August, 2012 - 13:06
by Jeroen
The internal (delphi) code of the Weibull distrubution is shown in the Help file.

function Weibull(Mean, Alpha: Double; Generator: Integer): Double;
var
Beta: Double;
begin
Beta := (Mean * Alpha) / GammaFunc(1 / Alpha);
Result := Beta * Macht(-Ln(Ran(Generator)) , 1 / Alpha);
end;

Here Alpha is the shape parameter and Beta the scale parameter.
So you'll have to convert your Beta (scale parameter) to the ED mean:
Mean := (Beta / Alpha) * GammaFunc(1 / Alpha);

The (Delphi) code for the GammaFunc is supplied in the help file and comes from Numerical Recipes.
You'll either have to get the mean from MiniTab software or compute it using the function above. Let me know if you need help converting is to 4DScript.
You can also use Excel: mean = EXP(GAMMALN(Beta))

Regards,
Jeroen

Re: Weibull Distribution

Posted: Saturday 18 August, 2012 - 06:08
by Heimann
Hello Jeroen
thanks for your reply
What about Gamma?and for other Distributions(such as logistic, log logistic,log normal)
in all of them must convert Scale parameter to mean in ED?
in minitab:
gamma(scale,shape)
logistic(local,scale)
loglogistic(local,scale)
logistic(local,scale)

Best regards
Heimann D

Re: Weibull Distribution

Posted: Saturday 01 September, 2012 - 12:55
by Heimann
I'm Using This 4D script in Cycle time:
Weibull((Beta / Alpha) * GammaFunc(1 / Alpha), Alpha)
Here Alpha is the shape parameter and Beta the scale parameter
in ED correct?

thanks for your reply
Heimann :oops:

Re: Weibull Distribution

Posted: Monday 03 September, 2012 - 14:00
by Jeroen
All ED 4DScript funtions contain a mean. So yes, you'll have to convert the scale parameters. All Delphi source code is given in the help file.
E.g:
- Gamma:To convert Gamma(alpha, beta) to Gamma(mean, alpha) you have to find the formula for the average in a statistics book, wikipedia the documentation of minitab, or convert it from the 4DScript help. In this case Mean = alpha * beta. So it becomes Gamma(alpha * beta, alpha).
- Logistic(local, scale) -> (I am not sure what they present in Minitab, but according to wikipedia local should be equal to mean) mean = local and stdev = sqrt((scale * scale * pi * pi)/3).
- LogLogistic(shape, scale) -> mean = (scale * pi / shape) / sin (pi / shape) (only valid for shape > 1!!!).

----------------------------------------------------------------------------------------------------------------
Note that GammaFunc is not a valid 4DScript function! Easiest would be to convert your values in Excel as I described above.

Re: Weibull Distribution

Posted: Monday 22 February, 2016 - 11:15
by Mashallah
You'll either have to get the mean from MiniTab software or compute it using the function above. Let me know if you need help converting is to 4DScript. ?????