AutoPas  3.0.0
Loading...
Searching...
No Matches
Functions
Smoothing.cpp File Reference
#include "Smoothing.h"
#include "autopas/tuning/searchSpace/Evidence.h"
#include "autopas/utils/Math.h"
Include dependency graph for Smoothing.cpp:

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.
 

Detailed Description

Author
F. Gratl
Date
23/11/2020

Function Documentation

◆ calculateWeightsSimple()

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.

Parameters
pointsSorted collection of observations.
pointsPerEstimationNumber of neighbors to consider for smoothing.
maxDistFromIntervalEdgeLargest distance between the point that shall be fitted and its neighbors.
Returns
Tuple of a vector containing the weights for the neighbors and a bool indicating whether the fitting should be used.

◆ calculateYFitSimple()

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.

Parameters
points
pointsPerEstimation
weights
Returns