API_HELPER_METHODS_STATISTICAL_OPERATIONS

API_HELPER_METHODS_STATISTICAL_OPERATIONS

Source:

Methods

(static) exports.changeAbsolute_n_days(featureCollection, targetDate, numberOfDays) → {Map.<string, number>}

Source:

computes the new indicator for an absolute change compared to number of previous days internally tests are run, e.g. if a previous day is available or not

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfDays number

the number of days to subtract from the submitted reference date

Returns:

returns the map of all input features that have both timestamps and whose absolute changeValues were successfully converted to a number. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.changeAbsolute_n_months(featureCollection, targetDate, numberOfMonths) → {Map.<string, number>}

Source:

computes the new indicator for an absolute change compared to number of previous months internally tests are run, e.g. if a previous month is available or not

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfMonths number

the number of months to subtract from the submitted reference date

Returns:

returns the map of all input features that have both timestamps and whose absolute changeValues were successfully converted to a number. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.changeAbsolute_n_years(featureCollection, targetDate, numberOfYears) → {Map.<string, number>}

Source:

computes the new indicator for an absolute change compared to number of previous years internally tests are run, e.g. if a previous year is available or not

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfYears number

the number of years to subtract from the submitted reference date

Returns:

returns the map of all input features that have both timestamps and whose absolute changeValues were successfully converted to a number. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.changeAbsolute_referenceDate(featureCollection, targetDate, referenceDate) → {Map.<string, number>}

Source:

computes the new indicator for an absolute change compared to a previous reference date (e.g. prior year or month or day) internally tests are run, e.g. if a previous reference date is available or not

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the target date in the string format YYYY-MM-DD, e.g. 2018-01-01

referenceDate string

the reference date in the past in the string format YYYY-MM-DD, e.g. 2016-01-01 for two years past or 2017-12-01 for one month past

Returns:

returns the map of all input features that have both timestamps and whose absolute changeValues were successfully converted to a number. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.changeRelative_n_days_percent(featureCollection, targetDate, numberOfDay) → {Map.<string, number>}

Source:

computes the new indicator for a relative change in percent compared to number of previous days internally tests are run, e.g. if a previous day is available or not if the indicator value for compareDate is '0' then the resulting value will be st as NoData value ('null')

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfDay number

the number of days to subtract from the submitted reference date

Returns:

returns the map of all input features that have both timestamps and whose relative changeValues were successfully converted to a number. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.changeRelative_n_months_percent(featureCollection, targetDate, numberOfMonth) → {Map.<string, number>}

Source:

computes the new indicator for a relative change in percent compared to number of previous months internally tests are run, e.g. if a previous month is available or not if the indicator value for compareDate is '0' then the resulting value will be st as NoData value ('null')

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfMonth number

the number of months to subtract from the submitted reference date

Returns:

returns the map of all input features that have both timestamps and whose relative changeValues were successfully converted to a number. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.changeRelative_n_years_percent(featureCollection, targetDate, numberOfYears) → {Map.<string, number>}

Source:

computes the new indicator for a relative change in percent compared to number of previous years internally tests are run, e.g. if a previous year is available or not if the indicator value for compareDate is '0' then the resulting value will be st as NoData value ('null')

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfYears number

the number of years to subtract from the submitted reference date

Returns:

returns the map of all input features that have both timestamps and whose relative changeValues were successfully converted to a number. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.changeRelative_referenceDate_percent(featureCollection, targetDate, referenceDate) → {Map.<string, number>}

Source:

computes the new indicator for a relative change in percent compared to a previous reference date (e.g. prior year or month or day) internally tests are run, e.g. if a previous reference date is available or not

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the target date in the string format YYYY-MM-DD, e.g. 2018-01-01

referenceDate string

the reference date in the past in the string format YYYY-MM-DD, e.g. 2016-01-01 for two years past or 2017-12-01 for one month past

Returns:

returns the map of all input features that have both timestamps and whose relative changeValues in percent were successfully converted to a number. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.computeContinuity(feature, dates) → {number}

Source:

Computes the continuity value for the feature considering the submitted array of consecutive dates

Parameters:
Name Type Description
feature Feature

a valid GeoJSON Feature, that must contain a properties attribute storing the indicator time series according to KomMonitor's data model

dates Array.<string>

array of dates for which the continuity value shall be computed as string of format YYYY-MM-DD in increasing order, i.e. ["2015-12-31", "2016-12-31", "2017-12-31"]

Returns:

returns the continuity value of the feature considering the concrete consecutive years of dates array. or null if any date of dates array is not included within feature

Type
number

(static) exports.computeLinearRegressionSlope(indicatorValueArray, yearsArray) → {number}

Source:

Computes the linear regression slope from an indicator value array and a temporal array of consecutive years; both arrays must have the same element length

Parameters:
Name Type Description
indicatorValueArray Array.<number>

numeric indicator value array representing the time-series in increasing order

yearsArray Array.<number>

numeric value array containing consecutive years in increasing order, i.e. [2015,2016,2017,2018,2019]

Returns:

returns the pearson correlation of the two input arrays or null if the input arrays do not have the same length or contain non-numeric values

Type
number

(static) exports.computePearsonCorrelation(valueArray_A, valueArray_B) → {number}

Source:

Computes the pearson correlation from two numeric input arrays that must have the same element length

Parameters:
Name Type Description
valueArray_A Array.<number>

numeric value array

valueArray_B Array.<number>

numeric value array

Returns:

returns the pearson correlation of the two input arrays or null if the input arrays do not have the same length or contain non-numeric values

Type
number

(static) exports.computeTrend(feature, dates) → {number}

Source:

Computes the trend value for the feature considering the submitted array of consecutive dates

Parameters:
Name Type Description
feature Feature

a valid GeoJSON Feature, that must contain a properties attribute storing the indicator time series according to KomMonitor's data model

dates Array.<string>

array of dates for which the trend value shall be computed as string of format YYYY-MM-DD in increasing order, i.e. ["2015-12-31", "2016-12-31", "2017-12-31"]

Returns:

returns the trend value of the feature considering the concrete consecutive years of dates array. or null if any date of dates array is not included within feature

Type
number

(static) exports.continuity_consecutive_n_days(featureCollection, targetDate, numberOfDays) → {Map.<string, number>}

Source:

computes the new indicator as continuity for prior consecutive days (Pearson correlation); internally tests are run, e.g. if a previous day is available or not

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfDays number

the number of prior consecutive days for which the continuity shall be computed

Returns:

returns the map of all input features whose continuity value were successfully computed. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.continuity_consecutive_n_months(featureCollection, targetDate, numberOfMonths) → {Map.<string, number>}

Source:

computes the new indicator as continuity for prior consecutive months (Pearson correlation); internally tests are run, e.g. if a previous month is available or not

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfMonths number

the number of prior consecutive months for which the continuity shall be computed

Returns:

returns the map of all input features whose continuity value were successfully computed. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.continuity_consecutive_n_years(featureCollection, targetDate, numberOfYears) → {Map.<string, number>}

Source:

computes the new indicator as continuity for prior consecutive years (Pearson correlation); internally tests are run, e.g. if a previous year is available or not

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfYears number

the number of prior consecutive years for which the continuity shall be computed

Returns:

returns the map of all input features whose continuity value were successfully computed. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.convertPropertyArrayToNumberArray(propertyArray) → {Array.<number>}

Source:

Takes a property array of arbitrary input objects and returns a valueArray of numeric values which have been converted to a number by Number(value). Any property value of the input array, whose conversion results in Number.NaN using the check Number.isNan(Number(value)) or is boolean will be completely removed from the array Thus the resulting array may have fewer entries than the original array.

Parameters:
Name Type Description
propertyArray Array.<Object>

an array of arbitrary values (can be String, number, boolean, object)

Returns:

returns the array of all values that were successfully converted to a number. responseArray.length may be smaller than inputArray.length, if inputArray contains boolean items or items whose Number-conversion result in Number.NaN

Type
Array.<number>

(static) exports.convertPropertyMapToNumberMap_fromIdValueMap(indicatorIdValueMap) → {Map.<string, number>}

Source:

Takes a map of indicator feature id and value pairs and returns a map containing only entries with numeric indicator values which have been converted to a number by Number(value). Any property value of the input map entries, whose conversion results in Number.NaN using the check Number.isNan(Number(value)) or is boolean will be completely removed from the map Thus the resulting may may have fewer entries than the original map.

Parameters:
Name Type Description
indicatorIdValueMap Map.<string, Object>

a map of indicator ID and value pairs, where key=ID and value=indicatorValue

Returns:

returns the map of all input map entries whose values were successfully converted to a number. responseMap.size may be smaller than inputMap.size, if inputMap contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.covariance(populationArray_A, populationArray_B) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#covariance to compute the covariance value of the submitted value arrays

Parameters:
Name Type Description
populationArray_A Array.<number>

first data array of numeric values (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

populationArray_B Array.<number>

second data array of numeric values (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the covariance value of the submitted data arrays

Type
number

(static) exports.formatDateAsString(date) → {string}

Source:

Converts a Javascript Date object into string of pattern 'YYYY-MM-DD'

Parameters:
Name Type Description
date *

a Javascript Date object (e.g. initialized by new Date())

Returns:

the date in the format YYYY-MM-DD, e.g. 2017-01-01

Type
string

(static) exports.geomean(populationArray) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#geomean to compute the geometric mean value of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the mean shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the geometric mean value of the submitted array of numeric values

Type
number

(static) exports.geomean_fromIdValueMap(indicatorIdValueMapArray) → {Map.<string, number>}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#geomean to compute the geometric mean value of the submitted array of indicator id and value map objects. Only values for those features will be computed, that have an input value for all entries of the input indicatorIdValueMapArray.

Parameters:
Name Type Description
indicatorIdValueMapArray Array.<Map.<string, number>>

an array of map objects containing indicator feature ID and numeric value pairs (will be piped through function convertPropertyMapToNumberMap_fromIdValueMap to ensure that only numeric values are submitted)

Returns:

returns a map containing the indicator feature id and computed geometric mean value of the submitted array of indicator id and value map objects. Only values for those features will be computed, that have an input value for all entries of the input indicatorIdValueMapArray.

Type
Map.<string, number>

(static) exports.getChange_absolute(featureCollection, targetDate, compareDate) → {Map.<string, number>}

Source:

Computes the absolute difference/change of indicator values between the submitted dates (if both are present in the dataset) using the formula - value[compareDate]

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

compareDate string

the compare date in the string format YYYY-MM-DD, e.g. 2015-01-01 to who the indicator value difference/change shall be computed

Returns:

returns the map of all input features that have both timestamps and whose changeValues were successfully converted to a number. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.getChange_relative_percent(featureCollection, targetDate, compareDate) → {Map.<string, number>}

Source:

Computes the relative difference/change in percent of indicator values between the submitted dates (if both are present in the dataset) using the formula * (( value[targetDate] - value[compareDate] ) / value[compareDate])

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

compareDate string

the compare date in the string format YYYY-MM-DD, e.g. 2015-01-01 to who the indicator value difference/change shall be computed

Returns:

returns the map of all input features that have both timestamps and whose changeValues in percent were successfully converted to a number. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.getSubstractNDaysDate_asString(referenceDateString, numberOfDays) → {string}

Source:

Subtracts n days from the reference date

Parameters:
Name Type Description
referenceDateString string

the reference date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfDays number

the number of days to subtract from the submitted reference date

Returns:

the new date (referenceDate minus numberOfDays) in the format YYYY-MM-DD, e.g. 2017-12-15

Type
string

(static) exports.getSubstractNMonthsDate_asString(referenceDateString, numberOfMonths) → {string}

Source:

Subtracts n months from the reference date

Parameters:
Name Type Description
referenceDateString string

the reference date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfMonths number

the number of months to subtract from the submitted reference date

Returns:

the new date (referenceDate minus numberOfMonths) in the format YYYY-MM-DD, e.g. 2017-12-01

Type
string

(static) exports.getSubstractNYearsDate_asString(referenceDateString, numberOfYears) → {string}

Source:

Subtracts n years from the reference date

Parameters:
Name Type Description
referenceDateString string

the reference date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfYears number

the number of years to subtract from the submitted reference date

Returns:

the new date (referenceDate minus numberOfYears) in the format YYYY-MM-DD, e.g. 2017-01-01

Type
string

(static) exports.max(populationArray) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#max to compute the max value of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the max value shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the max value of the submitted array of numeric values

Type
number

(static) exports.mean(populationArray) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#mean to compute the mean value of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the mean shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the mean value of the submitted array of numeric values

Type
number

(static) exports.mean_fromIdValueMap(indicatorIdValueMapArray) → {Map.<string, number>}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#mean to compute the mean value of the submitted array of indicator id and value map objects. Only values for those features will be computed, that have an input value for all entries of the input indicatorIdValueMapArray.

Parameters:
Name Type Description
indicatorIdValueMapArray Array.<Map.<string, number>>

an array of map objects containing indicator feature ID and numeric value pairs (will be piped through function convertPropertyMapToNumberMap_fromIdValueMap to ensure that only numeric values are submitted)

Returns:

returns a map containing the indicator feature id and computed mean value of the submitted array of indicator id and value map objects. Only values for those features will be computed, that have an input value for all entries of the input indicatorIdValueMapArray.

Type
Map.<string, number>

(static) exports.meanSquareError(populationArray) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#meansqerr to compute the mean square error value of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the mean square error value shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the mean square error value value of the submitted array of numeric values

Type
number

(static) exports.median(populationArray) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#median to compute the median value of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the median shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the median value of the submitted array of numeric values

Type
number

(static) exports.min(populationArray) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#min to compute the min value of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the min value shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the min value of the submitted array of numeric values

Type
number

(static) exports.min_fromIdValueMap(indicatorIdValueMapArray) → {Map.<string, number>}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#min to compute the min value of the submitted array of indicator id and value map objects. Only values for those features will be computed, that have an input value for all entries of the input indicatorIdValueMapArray.

Parameters:
Name Type Description
indicatorIdValueMapArray Array.<Map.<string, number>>

an array of map objects containing indicator feature ID and numeric value pairs (will be piped through function convertPropertyMapToNumberMap_fromIdValueMap to ensure that only numeric values are submitted)

Returns:

returns a map containing the indicator feature id and computed min value of the submitted array of indicator id and value map objects. Only values for those features will be computed, that have an input value for all entries of the input indicatorIdValueMapArray.

Type
Map.<string, number>

(static) exports.minMaxNormalization_inverted_singleValue(min, max, value) → {number}

Source:

Implements an inverted min max normalization value of the submitted value using the formula - ((value - min) / (max - min));

Parameters:
Name Type Description
min Number

the min value used in upper normalization formula

max Number

the max value used in upper normalization formula

value Number

the value to be normalized

Returns:

returns the inverted normalized value

Type
number

(static) exports.minMaxNormalization_inverted_wholeValueArray(populationArray) → {number}

Source:

Implements an inverted min max normalization value array of the submitted value array using the formula - ((value - min) / (max - min));

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the min max normalized value array shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the inverted normalized value array of the submitted value array

Type
number

(static) exports.minMaxNormalization_singleValue(min, max, value) → {number}

Source:

Implements a min max normalization value of the submitted value using the formula - min) / (max - min);

Parameters:
Name Type Description
min Number

the min value used in upper normalization formula

max Number

the max value used in upper normalization formula

value Number

the value to be normalized

Returns:

returns the normalized value

Type
number

(static) exports.minMaxNormalization_wholeValueArray(populationArray) → {number}

Source:

Implements a min max normalization value array of the submitted value array using the formula - min) / (max - min);

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the min max normalized value array shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the normalized value array of the submitted value array

Type
number

(static) exports.percentile(populationArray, k) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#percentile to compute the percentile of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

a(will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)n array of numeric values for which the percentile shall be computed

k number

value between - 1, exclusive to specify the k-th percentile to be computed

Returns:

returns the k-th percentile of the submitted array of numeric values

Type
number

(static) exports.quantiles(populationArray, quantilesArray) → {Array.<number>}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#quantiles to compute the quantiles of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the quantiles shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

quantilesArray Array.<number>

an array of quantile values (i.e. 0.5, 0.75)

Returns:

returns the quantiles of populationArray according to the quantilesArray

Type
Array.<number>

(static) exports.quartiles(populationArray) → {Array.<number>}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#quartiles to compute the quartiles of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the quartiles shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the quartiles of the submitted array of numeric values

Type
Array.<number>

(static) exports.range(populationArray) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#range to compute the range value of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the range value shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the range value of the submitted array of numeric values - min

Type
number

(static) exports.rank(populationArray) → {Array.<number>}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#rank to compute the rank array of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the mean shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the ranks of the submitted array of numeric values

Type
Array.<number>

(static) exports.standardDeviation(values, computeSampledStandardDeviation) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#stdev to compute the standard deviation for an array of values. By defaut, the population standard deviation is returned. Passing true for the flag parameter returns the sample standard deviation.

Parameters:
Name Type Description
values Array.<number>

an array of numeric values for which the standard deviation shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

computeSampledStandardDeviation boolean | null

OPTIONAL flag. If set to true then 'sample' standard deviation is computed, which is also called the 'corrected standard deviation', and is an unbiased estimator of the population standard deviation. If set to false or undefined then the population standard deviation is computed, which is also the 'uncorrected standard deviation', and is a biased but minimum-mean-squared-error estimator

Returns:

returns the standard deviation

Type
number

(static) exports.sum(populationArray) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#sum to compute the sum value of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the sum value shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

Returns:

returns the sum value of the submitted array of numeric values

Type
number

(static) exports.trend_consecutive_n_days(featureCollection, targetDate, numberOfDays) → {Map.<string, number>}

Source:

computes the new indicator as trend for prior consecutive days; internally tests are run, e.g. if a previous day is available or not

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfDays number

the number of prior consecutive days for which the trend shall be computed

Returns:

returns the map of all input features whose trend value were successfully computed. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.trend_consecutive_n_months(featureCollection, targetDate, numberOfMonths) → {Map.<string, number>}

Source:

computes the new indicator as trend for prior consecutive months; internally tests are run, e.g. if a previous month is available or not

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfMonths number

the number of prior consecutive months for which the trend shall be computed

Returns:

returns the map of all input features whose trend value were successfully computed. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.trend_consecutive_n_years(featureCollection, targetDate, numberOfYears) → {Map.<string, number>}

Source:

computes the new indicator as trend for prior consecutive years; internally tests are run, e.g. if a previous year is available or not

Parameters:
Name Type Description
featureCollection FeatureCollection

a valid GeoJSON FeatureCollection, whose features must contain a properties attribute storing the indicator time series according to KomMonitor's data model

targetDate string

the reference/target date in the string format YYYY-MM-DD, e.g. 2018-01-01

numberOfYears number

the number of prior consecutive years for which the trend shall be computed

Returns:

returns the map of all input features whose trend value were successfully computed. responseMap.size may be smaller than featureCollection.features.size, if featureCollection contains boolean value items or items whose Number-conversion result in Number.NaN

Type
Map.<string, number>

(static) exports.variance(populationArray, computeSampledVariance) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#variance to compute the variance value of the submitted value array

Parameters:
Name Type Description
populationArray Array.<number>

an array of numeric values for which the variance value shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

computeSampledVariance boolean | null

OPTIONAL flag. If set to true then 'sample' variance is computed. If set to false or undefined then the population variance is computed

Returns:

returns the variance value of the submitted array of numeric values - min

Type
number

(static) exports.zScore_byMeanAndStdev(value, mean, stdev) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#jStat.zscore to compute the zScore of the submitted value given the mean and standard deviation of the associated population.

Parameters:
Name Type Description
value number

the numeric value for which the zScore shall be computed

mean number

the numeric mean value of the associated population

stdev number

the numeric standard deviation of the associated population

Returns:

returns the zScore of the submitted value

Type
number

(static) exports.zScore_byPopulationArray(value, populationArray, computeSampledStandardDeviation) → {number}

Source:
See:

Encapsulates jStat's function https://jstat.github.io/all.html#jStat.zscore to compute the zScore of the submitted value given the mean and standard deviation of the associated population.

Parameters:
Name Type Description
value number

the numeric value for which the zScore shall be computed

populationArray Array.<number>

an array of numeric values for which the standard deviation shall be computed (will be piped through function convertPropertyArrayToNumberArray() to ensure that only numeric values are submitted)

computeSampledStandardDeviation boolean | null

OPTIONAL flag. If set to true then 'sample' standard deviation is computed, which is also called the 'corrected standard deviation', and is an unbiased estimator of the population standard deviation. If set to false or undefined then the population standard deviation is computed, which is also the 'uncorrected standard deviation', and is a biased but minimum-mean-squared-error estimator

Returns:

returns the zScore of the submitted value

Type
number