|
| void | EvaluateLinearTecOffsetValues (const TecOffsetDelayValues &fit, std::span< const double > x, std::span< double > y) |
| |
| std::optional< TecOffsetDelayValues > | GradientTecDelaySolve (std::span< const double > x, std::span< const double > y, std::span< const double > weights) |
| |
| std::optional< TecOffsetDelayValues > | GradientTecOffsetDelaySolve (std::span< const double > x, std::span< const double > y, std::span< const double > weights) |
| |
| std::optional< TecOffsetDelayValues > | LinearTecDelaySolve (std::span< const double > x, std::span< const double > y, std::span< const double > weights) |
| |
| std::optional< TecOffsetDelayValues > | LinearTecOffsetDelaySolve (std::span< const double > x, std::span< const double > y, std::span< const double > weights) |
| |
| void | PlotCostValues (const std::string &filename, std::span< const double > x_data, std::span< const double > y_data, std::span< const double > weights, size_t max_wraps) |
| |
| double | TecOffsetDelayCost (std::span< const double > x_data, std::span< const double > y_data, std::span< const double > weights, const TecOffsetDelayValues &fit) |
| |
| TecOffsetDelayValues | TecOffsetDelayGridSearch (std::span< const double > x_data, std::span< const double > y_data, std::span< const double > weights, bool include_b, size_t max_wraps, TecOffsetDelayFittingMethod method=TecOffsetDelayFittingMethod::LeastSquares) |
| |
Contains functionality for fitting TEC, offset and delay to phase data.
Perform a grid search for the TEC, offset and delay parameters. It optimizes a, b, c in the function y(x) = a/x + b + c x, modulus 2pi, to minimize the cost function.
The cost function during the grid search is the sum of -cos(y_i - model_i), i.e. it assumes the values follow the Van Mises distribution. During refinement, the cost depends on the specified method: least squares or Von Mises. When using least squares, the problem is linear and therefore fast. The Van Mises uses a non-linear minimization function and is therefore considerably slower.
This function scales as max_wraps^2 x n (n being the data size). The advantage of this method is that it is guaranteed to find the global minimum in the noiseless case, but it is slow for large values of max_wraps. If this becomes a bottleneck, a random sampling could be considered instead.
- Parameters
-
| x_data | The frequency values, must be positive and in strictly increasing order. At least 3 values must be specified. |
| y_data | The phase values to be fitted (normally between 0 and 2pi, but this is not required). |
| include_b | true to fit b, false to assume b=0. |
| max_wraps | The maximum number of wraps expected. The grid searched will have dimensions of 2 x max_wraps, spread in such a way that the global minimum is guaranteed to be found. |