## Calculating the Median of an Array in GoldSim

**Download**

# Description

The median is one measure of the central tendancy of a data set. The median is the numerical value separating the higher half of a data sample from the lower half. And, the median of a finite list of numbers can be found by arranging all of the observations from lowest value to highest value and picking the middle value if there is an odd number of observations. If there is an even number of observations, then the two middle values are averaged to find the median.

In this example model, the median is calculated for an array, for the columns in a matrix and for a time series. Script elements and basic GoldSim Function elements are both used to calculate the median. Different implementations of median calculation are contained within the four containers in this model.

# Additional Information

## Keywords

Median, Script element

## Categories

GoldSim Features & Capabilities, Time Series & Lookup Tables, Arrays