Ransac
Algorithm
Until a higher percentage threshold is reached or N samples are tested.
- He randomly selects the smallest sample to build or install the model.
- Other data points are classified as sheets or outliers.
- Model accepted or rejected
Inputs
- error tolerance for determining factors and emissions
- Threshold Higher Percentage
- Checked maximum number of samples.
Possible improvements
- Make sure that no combination is checked more than once.
- If itβs better to choose combinations, use this.
- After many identifiers are found, use the new set of identifiers for further search.
Source: Fischler and Bolles - Random Sample Consensus: Model Modeling Paradigm with Image Analysis and Automated Mapping Applications
Your expression
Your model is a sine, defined as f (x) = amplitude * sin (period * x) + offset. Installing this model will not be so simple, because it depends on three parameters. I think that this will risk in the long run and the possibility of retraining. A possible solution would be to run the algorithm several times for different periods and maintain a fixed offset and amplitude.
iterationThreshold = 10000; iterationCount = 0 errorthreshold = 0.05; while(numel(inliers(:,1)) > inlierThreshold) samples = extractMinimumSamples(points); [sineX, sineY] = fitSine(samples); inliers = determineInliers(points, SineX, SineY) iterationCount = iterationCount + 1; if(iterationCount => iterationThreshold) break; end end
See also possible improvements for modifications to this code.
source share