version
0.0.1
Defines the C++ API for MsPASS
|
Generic object to compute common robust statistics from a vector container of data. More...
#include <VectorStatistics.h>
Public Member Functions | |
VectorStatistics (std::vector< T > din) | |
VectorStatistics (T *din, int n) | |
T | median () |
T | mean () |
T | q1_4 () |
T | q3_4 () |
T | interquartile () |
T | mad (T center) |
T | ssq () |
T | upper_bound () |
T | lower_bound () |
T | range () |
T | quantile (size_t n) |
Generic object to compute common robust statistics from a vector container of data.
Robust estimators commonly use statistics based on ranked data. This fits naturally with an STL vector container that is by definition sortable by a standard method. This object has methods that return common statistics derived from sorted vector data.
mspass::utility::VectorStatistics< T >::VectorStatistics | ( | std::vector< T > | din | ) |
Primary constructor.
din | is vector container from which statistics are to be derived. Currently assume default sort is used. Probably should have an optional order template parameter for the container. |
mspass::utility::VectorStatistics< T >::VectorStatistics | ( | T * | din, |
int | n | ||
) |
Construct from a C style pointer to an array of T.
T mspass::utility::VectorStatistics< T >::interquartile |
Return the interquartile (q3/4 - q1/4)
T mspass::utility::VectorStatistics< T >::lower_bound |
T mspass::utility::VectorStatistics< T >::mad | ( | T | center | ) |
Return the median absolute distance robust measure of spread.
References mspass::utility::VectorStatistics< T >::median().
T mspass::utility::VectorStatistics< T >::mean |
T mspass::utility::VectorStatistics< T >::median |
T mspass::utility::VectorStatistics< T >::q1_4 |
Return the lower quartile.
T mspass::utility::VectorStatistics< T >::q3_4 |
Return the upper (3/4) quartile.
T mspass::utility::VectorStatistics< T >::quantile | ( | size_t | n | ) |
Return nth value from the sorted data that is the nth 1-quantile. Will throw a MsPASSError if n exceed the data length.
T mspass::utility::VectorStatistics< T >::range |
Return full range of data (largest - smallest)
T mspass::utility::VectorStatistics< T >::ssq |
T mspass::utility::VectorStatistics< T >::upper_bound |