Search code examples
mathmatchdata-stream

Check if stream of numerical values matches specific function


The title is a bit inaccurate. But I don't know how to be more precise. Feel free to edit it.

I have data stream. Every cycle (a few milli seconds) I get a new set of 3 floats that represent an acceleration. So basically the acceleration on the X-, Y- and Z-axis.

I have a function f(x) : R^3 -> R^3. In this case I can split f(x) into threee different functions. f(X), f(Y), f(Z). f(Z) = 0 for all Z. f(Y) = 0 for all Y. Let's say f(X) looks like the density normal derivation with my = 2 and sigma = 1, so N(2,1).

Now I want to check if the values from the data stream actually match the function f(x). Of course they won't match completely. Therefore I would like to know if the values follow a similar curve like f(x).

The question is, how do I do that mathmatically and programmatically? (Don't really need source code. Just an idea how to solve this problem)


Solution

  • Here are a few ideas:

    1. Calculate the sum of squared errors at each point in time. Since these will only increase as you add more points, you might want to normalize these by the total measurement time and determine what your cutoff value should be.
    2. Calculate the FFT of the data and compare it to the FFT of the known function.
    3. Calculate the student's T test to see if the known and measured distributions have the same mean.
    4. Calculate F-test to see if the known and measured distributions have the same standard deviation.
    5. Investigate time series analysis techniques to see what is typically done to compare streams of time-dependent data.