NCL Home > Documentation > Functions > Statistics, Extreme values

# extval_pareto

Calculates the probability (PDF) and cumulative (CDF) distribution functions of the Pareto distributions (Generalized, Type I, TYpe II) given the shape, scale and location parameters.

Available in version 6.4.0 and later.

## Prototype

```	function extval_pareto (
x          : numeric,
shape  [*] : numeric,
scale  [*] : numeric,
center [*] : numeric,
ptype  [1] : integer,
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). If ptype=0, it must be the same size as shape. The argument is ignored for ptype=1 or 2.

ptype

An integer which specifies which distribution:

• ptype=0 means the Generalized Pareto
• ptype=1 means the Pareto Type I
• ptype=2 means the Pareto Type II

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 Pareto distribution to derive the associated PDFs and CDFs.

## Examples

Example 1

```
N      = 100
xMin   = 0.05
xMax   = 5.5
x      = fspan(xMin,xMax,N)

shape  = (/0.5, 1.0, 2.0, 3.0, 1.0, 2.0, 3.0/)
scale  = (/1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0/)
center = (/0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/)

; Generate PDF and GDF distribution

ptype  = 0                              ; Generalized Pareto
pdfcdf = extval_pareto(x, shape, scale, center, ptype, 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) ourput is:

```   Variable: pdf
Type: float
Total Size: 5600 bytes
1400 values
Number of Dimensions: 2
Dimensions and sizes:	[7] x [200]
Coordinates:
Number Of Attributes: 5
_FillValue :	9.96921e+36
long_name :	Pareto: Generalized: PDF
shape :	( 0.5,  1,  2,  3,  1,  2,  3 )
scale :	(  1,  1,  1,  1,  2,  2,  2 )
location :	(  0,  0,  0,  0,  0,  0,  0 )
(0)
(0)	Pareto: Generalized: PDF : min=0.0233236   max=0.863838

Variable: cdf
Type: float
Total Size: 5600 bytes
1400 values
Number of Dimensions: 2
Dimensions and sizes:	[7] x [200]
Coordinates:
Number Of Attributes: 5
_FillValue :	9.96921e+36
long_name :	Pareto: Generalized: CDF
shape :	( 0.5,  1,  2,  3,  1,  2,  3 )
scale :	(  1,  1,  1,  1,  2,  2,  2 )
location :	(  0,  0,  0,  0,  0,  0,  0 )
(0)
(0)	Pareto: Generalized: CDF : min=0.0455188   max=0.918367

```