PercentileArray (Function)

image\trumpet2.gif Disclaimer

The PercentileArray function returns the value in an array that corresponds to the PctRank input.

Syntax

PercentileArray(PctRank, PriceArray, Size)

Parameters

Name

Type

Description

PctRank

Numeric

Sets the percentile value to use.   Enter .25 for 25%.

PriceArray

Numeric Array

Specifies the name of a numeric array containing values upon which the average deviation is calculated.

Size

Numeric

Sets the number of data elements (size) in the array to evaluate.

Returns

A numeric value containing the percentile (k-th value) of a specified period, as defined by Price and Length. The Function will return –1 (negative 1) if the Size is greater than the referenced array.

Usage

Calculates the Percentile (k-th value) of a specified period.

The percentile is a value within the bounds of the array, such that PctRank percent of the observations are less than the PctRank value, and (1 - PctRank) percent of the observations are greater than the PctRank value.

Remarks

The value for the Size input parameter should always be a whole number greater than 0. It is typically equal to the number of data elements in the array minus 1, since the 0 element is not used by most array functions in EasyLanguage.

Example

Assigns to Value1 the value below which half (50%, represented by a PctRank of 0.5) of the array elements lie.

Array: myArray[10](0);

{… (assign values to array) }

Value1 = PercentileArray ( 0.5, myArray, 10 );