Module assert_linear

Module assert_linear 

Source
Expand description

Checks that a set of measurements looks like a linear function rather than like a quadratic function. Algorithm:

  1. Linearly scale input to be in [0; 1)
  2. Using linear regression, compute the best linear function approximating the input.
  3. Compute RMSE and maximal absolute error.
  4. Check that errors are within tolerances and that the constant term is not too negative.

Ideally, we should use a proper “model selection” to directly compare quadratic and linear models, but that sounds rather complicated:

https://stats.stackexchange.com/questions/21844/selecting-best-model-based-on-linear-quadratic-and-cubic-fit-of-data

We might get false positives on a VM, but never false negatives. So, if the first round fails, we repeat the ordeal three more times and fail only if every time there’s a fault.

Structs§

AssertLinear
Round 🔒