<< distfun_wbllike Weibull distfun_wblplot >>

distfun >> distfun > Weibull > distfun_wblpdf

distfun_wblpdf

Weibull PDF

Calling Sequence

y = distfun_wblpdf ( x , a , b )

Parameters

x :

a matrix of doubles, the outcome, x>=0

a :

a matrix of doubles, the scale parameter, a>0.

b :

a matrix of doubles, the shape parameter, b>0.

y :

a matrix of doubles, the density

Description

Computes the Weibull probability distribution function.

Any scalar input argument is expanded to a matrix of doubles of the same size as the other input arguments.

The function definition is:

\begin{eqnarray}
f(x,a,b)=\frac{b}{a} \left(\frac{x}{a}\right)^{b-1}
\exp\left(-(x/a)^b\right)
\end{eqnarray}

if x>=0.

If b=1, this corresponds to the Exponential distribution.

If b=2, this corresponds to the Rayleigh distribution.

The value of the density at x=0 depends on b.

Compatibility

This distribution has the same parameters as in Matlab.

In R, the parameters a and b are switched, so that the statement in distfun :

y=distfun_wblpdf(x,a,b)

is the same as the statement in R :

y=dweibull(x,b,a)

Examples

// Check with a and b to be expanded
computed = distfun_wblpdf ( 0.1:0.2:0.7 , 2 , 3 )
expected = [0.0037495  0.0336363  0.0922965  0.1760382]

// Plot the function
a = 1;
b = [0.5 1 1.5 5];
cols = [1 2 3 5];
nf = size(cols,"*");
lgd = [];
scf();
for k = 1 : nf
x = linspace(0,2.5,1000);
y = distfun_wblpdf(x,a,b(k));
plot(x,y)
str = msprintf("a=%s, b=%s",..
string(a),string(b(k)));
lgd($+1) = str;
end
h = gcf();
for k = 1 : nf
hk = h.children.children.children(nf - k + 1);
hk.foreground = cols(k);
end
xtitle("Weibull PDF","x","y");
legend(lgd);
h.children.data_bounds=[0,0;2.5,2.5];

Authors


Report an issue
<< distfun_wbllike Weibull distfun_wblplot >>