This is an example for a small dataset with 17 values. The graph to this values looks a bit like a gaussian distribution.
0
0.05
0.1
0.2
0.4
0.7
0.85
0.95
1
0.95
0.85
0.7
0.4
0.2
0.1
0.05
0
Unfortunatly I also need to get values in between. So I need to find a formula, which describes nearly this kind of values - it doesn't have to fit the values exactly.
If I use f(2), I do get 0.1, if I do f(3) I do get 0.2, so obviously f(2.5) should be 0.15.
I tried to start with a parabola function:
f(x) = -x ** 2 + 1
But I would have to move it one to the right and also it doesn't work for the lower y values. I think this attempt will not work...
Update
const getValue = (x) => {
const u = Math.floor(x)
const res = (1 + u - x) * u + (x - u) * (u + 1)
console.log(res)
return res
}
