mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-04 03:58:27 +00:00 
			
		
		
		
	stats: Add trimean
https://en.wikipedia.org/wiki/Trimean The trimean is a the most efficient 3-point L-estimator (estimator of central tendency, i.e. average), even more robust than the median at estimating the average of a sample population. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
		
							parent
							
								
									19135a3447
								
							
						
					
					
						commit
						2d305f6199
					
				@ -528,3 +528,19 @@ double igt_stats_get_iqm(igt_stats_t *stats)
 | 
			
		||||
 | 
			
		||||
	return mean;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * igt_stats_get_trimean:
 | 
			
		||||
 * @stats: An #igt_stats_t instance
 | 
			
		||||
 *
 | 
			
		||||
 * Retrieves the trimean of the @stats dataset.
 | 
			
		||||
 *
 | 
			
		||||
 * The trimean is a the most efficient 3-point L-estimator, even more
 | 
			
		||||
 * robust than the median at estimating the average of a sample population.
 | 
			
		||||
 */
 | 
			
		||||
double igt_stats_get_trimean(igt_stats_t *stats)
 | 
			
		||||
{
 | 
			
		||||
	double q1, q2, q3;
 | 
			
		||||
	igt_stats_get_quartiles(stats, &q1, &q2, &q3);
 | 
			
		||||
	return (q1 + 2*q2 + q3) / 4;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -63,6 +63,7 @@ void igt_stats_get_quartiles(igt_stats_t *stats,
 | 
			
		||||
double igt_stats_get_iqr(igt_stats_t *stats);
 | 
			
		||||
double igt_stats_get_iqm(igt_stats_t *stats);
 | 
			
		||||
double igt_stats_get_mean(igt_stats_t *stats);
 | 
			
		||||
double igt_stats_get_trimean(igt_stats_t *stats);
 | 
			
		||||
double igt_stats_get_median(igt_stats_t *stats);
 | 
			
		||||
double igt_stats_get_variance(igt_stats_t *stats);
 | 
			
		||||
double igt_stats_get_std_deviation(igt_stats_t *stats);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user