grasshopper2 Rhinorhino3d.com
ComponentAuto-generatedMaths
Fit Function
00000000-398f-47b7-9c11-f1506d391335
object preview
This page was generated from the component’s built-in descriptions. An in-depth article has not been written for it yet.

Fit a function of a specific type through a set of (x,y) samples.

Input parameters:

  1. Sm → Two-dimensional samples to fit.
  2. Tp → Type of function to fit.
    •  0 → Linear
    •  1 → Quadratic
    •  2 → Cubic
    •  3 → Quartic
    •  4 → Quintic
    •  5 → Sextic
    •  6 → Septic
    •  7 → Octic
    •  8 → Gaussian
    •  9 → Decay
    • 10 → Logarithm
    • 11 → Sinusoid
  3. Mt → Error metric to minimise during fitting.
  4. Tr → Mechanism for discarding badly fitted samples between fitting rounds.
    • 0 → None
    • 1 → Percentage
    • 2 → Deviation
    • 3 → Sigma
    • 4 → Error Target
  5. Th → Optional trimming threshold, interpreted by the trimming mechanism. A percentage of samples to discard for Percentage trimming, a deviation limit for Deviation trimming, a multiple of the standard deviation for Sigma trimming, or an error value to reach for Error Target trimming.

Output parameters:

  1. Fn → Function of the chosen type which best fits the samples.
  2. Dv → Signed vertical deviation of the fitted function from each sample.
  3. Ix → Indices of the samples used in the final fit.
  4. Er → Total deviation of the samples used in the final fit, according to the chosen metric. Root Mean Square for least squares, Mean Absolute Deviation for least deviations, and Largest Absolute Deviation for minimax.