Elaboradar 0.1
Caricamento in corso...
Ricerca in corso...
Nessun risultato

◆ compute_slope()

template<typename T >
radarelab::Statistic< T >::compute_slope ( unsigned minimum = 2)
inline

Compute least square linear fit (no exception if only scalars where provided)

Parametri
[in]minimumMinimum amount of accumulated data to perform the computation
Restituisce
value of the slope. If N is less the minimum returns NaN

Definizione alla linea 128 del file statistics.h.

129 {
130 if(N>=minimum)
131 slope = (N*sum_xy-sum_x*sum_y)/(N*sum_x*sum_x-sum_x2);
132 else slope = sqrt(-1); // NaN
133 return slope;
134 }