#include "Smoothing.h"
#include "autopas/tuning/searchSpace/Evidence.h"
#include "autopas/utils/Math.h"
Functions | |
std::tuple< std::vector< double >, bool > | calculateWeightsSimple (const std::vector< autopas::Evidence > &points, size_t pointsPerEstimation, size_t maxDistFromIntervalEdge) |
Calculates the weights for the k-neighbors of the last point in the vector using the tri-cube function. | |
double | calculateYFitSimple (const std::vector< autopas::Evidence > &points, size_t pointsPerEstimation, const std::vector< double > &weights) |
Calculates the smoothed y-value of the last point in the vector. | |
std::tuple< std::vector< double >, bool > calculateWeightsSimple | ( | const std::vector< autopas::Evidence > & | points, |
size_t | pointsPerEstimation, | ||
size_t | maxDistFromIntervalEdge | ||
) |
Calculates the weights for the k-neighbors of the last point in the vector using the tri-cube function.
If the sum of weights is <= 0 all neighbors are at the same x coordinate as the point and smoothing will not change the point. This case is indicated by the bool in the return tuple.
points | Sorted collection of observations. |
pointsPerEstimation | Number of neighbors to consider for smoothing. |
maxDistFromIntervalEdge | Largest distance between the point that shall be fitted and its neighbors. |
double calculateYFitSimple | ( | const std::vector< autopas::Evidence > & | points, |
size_t | pointsPerEstimation, | ||
const std::vector< double > & | weights | ||
) |
Calculates the smoothed y-value of the last point in the vector.
The fitted value is the sum of projections of the y-values of the neighbors in the chosen interval. Each projection is the sum of the respective weight and the proportion of the residuals of the weighted sum of squared residuals.
points | |
pointsPerEstimation | |
weights |