Weibull Distribution

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Heimann
Posts: 17
Joined: Saturday 11 August, 2012 - 19:37

Weibull Distribution

Post 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
Jeroen
Posts: 9
Joined: Monday 17 January, 2011 - 10:02

Re: Weibull Distribution

Post 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
Heimann
Posts: 17
Joined: Saturday 11 August, 2012 - 19:37

Re: Weibull Distribution

Post 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
Heimann
Posts: 17
Joined: Saturday 11 August, 2012 - 19:37

Re: Weibull Distribution

Post 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:
Jeroen
Posts: 9
Joined: Monday 17 January, 2011 - 10:02

Re: Weibull Distribution

Post 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.
Mashallah
Posts: 1
Joined: Monday 22 February, 2016 - 08:05

Re: Weibull Distribution

Post 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. ?????
Post Reply