2

Which ways I can smooth data where are random fluctuations? This is linear graph of my data input:Linear graph

Big curves (about time 100 etc) are desirable.

I already tried sliding window. Which way do you recommend?

2 Answers2

2

The usual thing to do, is to convolve your data $f(t)$ with some window function $w_\delta(t)$ of a charactersitic width $\delta>0$, i.e.

$$\bar{f}(t) = \int_{-\infty} ^\infty dt'\, f(t')\cdot w_\delta (t',t)$$

A very popular variant is to use a gaussian window

$$w_\delta(t',t)=\frac{1}{\sqrt{2\pi\delta^2}}\exp\left({-\frac{(t'-t)^2}{2\delta^2}}\right).$$

Edit

As your data is given as discrete points, use numerical integration, that's also what smoothing algorithms usually do. For example if your data is given on equidistant places $t_n=t_0+n\Delta t$, you can approximate your integral as $$\int_{t_0} ^{t_N} dt' R(t')\approx \Delta t\left(\tfrac{1}{2}R(t_0)+R(t_1)+...+R(t_{N-1})+\tfrac{1}{2}R(t_N)\right)$$ using the trapezoidal rule, replacing $R(t')$ by the integrand you need.

flonk
  • 2,434
0

I am pretty sure moving averages are what you are looking for. There are a few differend kinds of them, all behave as low pass filters on your data. The example of convolution with a gaussian given by flonk is the continuous analog of moving averages in the discrete case.

Christoph
  • 24,912