#time-series #forecast #tsf

nightly tsf-rs

Rust 中实现时间序列预测

2 个版本

0.1.1 2020 年 12 月 4 日
0.1.0 2020 年 12 月 4 日

#15 in #forecast


被用于 fosc-rs

MIT 许可证

5KB
77 行代码(不包括注释)

时间序列预测 (TSF)

 use tsf_rs::TSF;
 use ta_common::traits::Indicator;
let mut tsf = TSF::new(5);
assert_eq!(tsf.next(81.59), None);
assert_eq!(tsf.next(81.06), None);
assert_eq!(tsf.next(82.87), None);
assert_eq!(tsf.next(83.00), None);
assert_eq!(tsf.next(83.61), Some(84.22));
assert_eq!(tsf.next(83.15), Some(84.21399999999998));
assert_eq!(tsf.next(82.84), Some(83.12099999999998));
assert_eq!(tsf.next(83.99), Some(83.68099999999998));
assert_eq!(tsf.next(84.55), Some(84.44399999999997));
assert_eq!(tsf.next(84.36), Some(85.017));
assert_eq!(tsf.next(85.53), Some(85.97899999999998));
assert_eq!(tsf.next(86.54), Some(86.81799999999997));
assert_eq!(tsf.next(86.89), Some(87.63199999999998));
assert_eq!(tsf.next(87.77), Some(88.67199999999997));
assert_eq!(tsf.next(87.29), Some(88.22899999999996));

依赖项

~14KB