@jsh/filter
Since v8.0.52Avg
값을 순차적으로 입력해 산술 평균을 갱신합니다.
사용 예시
|
|
MovAvg
고정 길이 윈도우 기반 이동 평균을 계산합니다.
사용 예시
|
|
Lowpass
저역 통과 필터로 잡음을 완화합니다.
사용 예시
|
|
Kalman
칼만 필터를 사용해 시계열을 추정합니다.
사용 예시
|
|
KalmanSmoother
스무딩용 칼만 필터로 보다 완만한 추세를 제공합니다.
사용 예시
|
|
칼만 필터와 스무더 비교
SCRIPT({
const { now } = require("@jsh/system");
const { arrange, Simplex } = require("@jsh/generator");
const m = require("@jsh/filter")
const simplex = new Simplex(1234);
const kalmanFilter = new m.Kalman(0.1, 0.001, 1.0);
const kalmanSmoother = new m.KalmanSmoother(0.1, 0.001, 1.0);
const real = 14.4;
}, {
s_x = []; s_values = []; s_filter = []; s_smooth = [];
for( x of arrange(0, 10, 0.1)) {
x = Math.round(x*100)/100;
measure = real + simplex.eval(x) * 4;
s_x.push(x);
s_values.push(measure);
s_filter.push(kalmanFilter.eval(now(), measure));
s_smooth.push(kalmanSmoother.eval(now(), measure));
}
$.yield({
title:{text:"Kalman filter vs. smoother"},
xAxis:{type:"category", data:s_x},
yAxis:{ min:10, max: 18 },
series:[
{type:"line", data:s_values, name:"values"},
{type:"line", data:s_filter, name:"filter"},
{type:"line", data:s_smooth, name:"smoother"}
],
tooltip: {show: true, trigger:"axis"},
legend: { bottom: 10},
animation: false
});
})
CHART(size("600px", "400px"))

최근 업데이트