Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::statsutil Namespace Reference

Classes

struct  RegresionResult
 

Functions

IVW_MODULE_PLOTTING_API RegresionResult linearRegresion (const BufferBase &X, const BufferBase &Y)
 
IVW_MODULE_PLOTTING_API std::ostream & operator<< (std::ostream &os, RegresionResult res)
 
template<typename T , typename std::enable_if<!util::is_floating_point< T >::value, int >::type = 0>
std::vector< T > percentiles (std::vector< T > data, const std::vector< double > &percentiles)
 Compute value below a percentage of observations in the data. Uses the nearest rank method, i.e. ceil(percentile * N), where N = number of elements in data.
 

Detailed Description

statsutil

Function Documentation

◆ percentiles()

template<typename T , typename std::enable_if<!util::is_floating_point< T >::value, int >::type = 0>
std::vector< T > inviwo::statsutil::percentiles ( std::vector< T > data,
const std::vector< double > & percentiles )

Compute value below a percentage of observations in the data. Uses the nearest rank method, i.e. ceil(percentile * N), where N = number of elements in data.

NaNs (Not a Numbers) are excluded from the computation. The following example will return {1,2}

auto percentiles = utilstats::percentiles({1, 0, 3, 2}, {0.25, 0.75});
std::vector< T > percentiles(std::vector< T > data, const std::vector< double > &percentiles)
Compute value below a percentage of observations in the data. Uses the nearest rank method,...
Definition statsutils.h:84

See also https://en.wikipedia.org/wiki/Percentile

Parameters
datato compute percentiles on
percentilesin the range [0 1]
Returns
values below the percentage given by the percentiles.
Exceptions
Exceptionif any percentile is less than 0 or larger than 1