QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_box_statistics.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *
9 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 *****************************************************************************/
11
12#ifndef QWT_BOX_STATISTICS_H
13#define QWT_BOX_STATISTICS_H
14
15#include "qwt_global.h"
16#include "qwt_samples.h"
17
18#include <qvector.h>
19
34{
35public:
45 {
48
51
54
57
59 StandardError
60 };
61
64
66 void setWhiskerMethod(WhiskerMethod method);
67
69 WhiskerMethod whiskerMethod() const;
70
72 void setWhiskerCoefficient(double coeff);
73
75 double whiskerCoefficient() const;
76
78 static QwtBoxSample calculate(
79 double position,
80 const QVector<double>& sortedData,
81 WhiskerMethod method = Tukey,
82 double coefficient = 1.5);
83
85 static QwtBoxSample calculateFromRaw(
86 double position,
87 const QVector<double>& rawData,
88 WhiskerMethod method = Tukey,
89 double coefficient = 1.5);
90
92 static QVector<double> extractOutliers(
93 const QwtBoxSample& sample,
94 const QVector<double>& sortedData);
95
97 static void calculateFull(
98 double position,
99 const QVector<double>& rawData,
100 QwtBoxSample& sample,
101 QwtBoxOutlierSample& outliers,
102 WhiskerMethod method = Tukey,
103 double coefficient = 1.5);
104
105private:
107 static double quantile(const QVector<double>& sorted, double p);
108
110 static double median(const QVector<double>& sorted);
111
113 static double iqr(const QVector<double>& sorted);
114
116 static double mean(const QVector<double>& data);
117
119 static double standardDeviation(const QVector<double>& data);
120
122 static QVector<double> sortData(const QVector<double>& data);
123
124 WhiskerMethod m_method;
125 double m_coefficient;
126};
127
128#endif // QWT_BOX_STATISTICS_H
Definition qwt_clipper.h:40
单个箱线图位置的异常值
Definition qwt_samples.h:680
箱线图(boxplot)样本
Definition qwt_samples.h:534
从原始数据计算箱线图统计量的辅助类
Definition qwt_box_statistics.h:34
WhiskerMethod
须须计算方法
Definition qwt_box_statistics.h:45
@ MinMax
Min/Max method: whiskers at actual data min/max
Definition qwt_box_statistics.h:53
@ StandardDeviation
Standard deviation method: whiskers at mean ± coeff×SD
Definition qwt_box_statistics.h:56
@ Percentile
Percentile method: whiskers at specified percentile range
Definition qwt_box_statistics.h:50
@ Tukey
Tukey's method: whiskers extend to 1.5×IQR from Q1/Q3 (default)
Definition qwt_box_statistics.h:47