[][src]Function rstats::awmeanstd

pub fn awmeanstd(dvec: &[i64]) -> Result<MStats>

Liearly weighted arithmetic mean and standard deviation of an i64 slice.
Linearly descending weights from n down to one.
Time dependent data should be in the stack order - the last being the oldest.

Example

use rstats::awmeanstd;
const VEC1:[i64;14] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14];
let res = awmeanstd(&VEC1).unwrap();
assert_eq!(res.mean,5.333333333333333_f64);
assert_eq!(res.std,3.39934634239519_f64);