NCL Home > Documentation > Functions > Statistics, Extreme values

# extval_weibull

Calculates the probability (PDF) and cumulative (CDF) distribution functions of the Weibull Type III distribution given the shape, scale and location parameters.

Available in version 6.4.0 and later.

## Prototype

```	function extval_weibull (
x          : numeric,
shape  [*] : numeric,
scale  [*] : numeric,
center [*] : numeric,
opt    [1] : integer
)

return_val [ variable of type list containing 2 variables [/ PDF, CDF /]
```

## Arguments

x

A numeric array.

shape

One dimensional array containing the shape parameter(s).

scale

One dimensional array containing the scale parameter(s). Must be the same size as shape.

center

One dimensional array containing the center (aka, location) parameter(s). Must be the same size as shape.

opt

Currently, not used. Set to zero.

## Return value

A variable of type 'list.' The list contains two variables: the PDF and the CDF. See Example(s).

## Description

Use the equations associated with the Weibull distribution to derive the associated PDFs and CDFs.

## Examples

Example 1

See plots at Example 4 of the Extreme Value Applications page.

```   shape  = (/-0.5, 0.0, 0.5 /)
scale  = (/ 1.0, 1.0, 1.0 /)            ; sigma
center = (/ 0.0, 0.0, 0.0 /)            ; location, shift

; Generate PDF and GDF distribution

pdfcdf = extval_weibull(x, shape, scale, center, 0)  ; return a variable of type 'list'
pdf    = pdfcdf[0]                      ; explicitly extract the 2 returned variables (for convenience only).
cdf    = pdfcdf[1]
delete(pdfcdf)       ; not necessary

printVarSummary(pdf)
printVarSummary(cdf)

```
The (edited) output is:
```
Variable: pdf
Type: float
Total Size: 4800 bytes
1200 values
Number of Dimensions: 2
Dimensions and sizes:	[4] x [300]
Coordinates:
Number Of Attributes: 5
_FillValue :	9.96921e+36
long_name :	Weibull: Extreme Value Type III: PDF
shape :	( 0.5,  1, 1.5,  5 )
scale :	(  1,  1,  1,  1 )
center :	(  0,  0,  0,  0 )

(0)	---

Variable: cdf
Type: float
Total Size: 4800 bytes
1200 values
Number of Dimensions: 2
Dimensions and sizes:	[4] x [300]
Coordinates:
Number Of Attributes: 5
_FillValue :	9.96921e+36
long_name :	Weibull: Extreme Value Type III: CDF
shape :	( 0.5,  1, 1.5,  5 )
scale :	(  1,  1,  1,  1 )
center :	(  0,  0,  0,  0 )

```