Skip to main content
added 18 characters in body
Source Link
Federico Poloni
  • 20.2k
  • 2
  • 82
  • 120

I'm using a 5-point Triangle Moving Average:

Sj = (Yj-2 + 2Yj-1 + 3Yj + 2Yj+1 + Yj+2) / 9$$S_j = (Y_{j-2} + 2Y_{j-1} + 3Y_j + 2Y_{j+1} + Y_{j+2}) / 9$$

The problem is that I often need to smooth my data more than once, and when I do this too much, it becomes noticeability very slow (and I'm using C++).

Is there a way to optimize this formula?

Like maybe skipping every other data point and then using interpolation in the end, or something clever?

Thanks

I'm using a 5-point Triangle Moving Average:

Sj = (Yj-2 + 2Yj-1 + 3Yj + 2Yj+1 + Yj+2) / 9

The problem is that I often need to smooth my data more than once, and when I do this too much, it becomes noticeability very slow (and I'm using C++).

Is there a way to optimize this formula?

Like maybe skipping every other data point and then using interpolation in the end, or something clever?

Thanks

I'm using a 5-point Triangle Moving Average:

$$S_j = (Y_{j-2} + 2Y_{j-1} + 3Y_j + 2Y_{j+1} + Y_{j+2}) / 9$$

The problem is that I often need to smooth my data more than once, and when I do this too much, it becomes noticeability very slow (and I'm using C++).

Is there a way to optimize this formula?

Like maybe skipping every other data point and then using interpolation in the end, or something clever?

Thanks

Source Link

Triangular Smoothing Formula Optimization

I'm using a 5-point Triangle Moving Average:

Sj = (Yj-2 + 2Yj-1 + 3Yj + 2Yj+1 + Yj+2) / 9

The problem is that I often need to smooth my data more than once, and when I do this too much, it becomes noticeability very slow (and I'm using C++).

Is there a way to optimize this formula?

Like maybe skipping every other data point and then using interpolation in the end, or something clever?

Thanks