Sage Modeling and Simulation Library

Extensions..::..GetValueAtPercentile<(Of <(<'T>)>)> Method

Given a list of source items, and a function that returns a double value for each, this method ascertains the double value that represents the given percentile in that population. For example, given a list of students, and a function that returns their grades, this method will return the grade that represents the 50th percentile across that population of students.

Namespace:  Highpoint.Sage.Mathematics
Assembly:  Sage4 (in Sage4.dll)

Syntax


public static double GetValueAtPercentile<T>(
	this List<T> srcItems,
	double percentile,
	Func<T, double> valueGetter,
	bool interpolate
)

Type Parameters

T
The type of items in the list of source items.

Parameters

srcItems
Type: List<(Of <(<'T>)>)>
The source items for which we want to know the percentile.
percentile
Type: Double
The percentile on the interval [0.0, 100.0] at which we seek the value from the source items.
valueGetter
Type: Func<(Of <(<'T, Double>)>)>
The function that ascertains the value of each source item.
interpolate
Type: Boolean
if set to true, we interpolate between located items' values.

Return Value