visual3d:documentation:pipeline:expressions:least_squares_fitting_of_data
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:documentation:pipeline:expressions:least_squares_fitting_of_data [2024/06/19 13:36] – removed sgranger | visual3d:documentation:pipeline:expressions:least_squares_fitting_of_data [2025/01/24 18:53] (current) – [Best Fit Plane] wikisysop | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Least Squares Fitting of Data ===== | ||
+ | This page contains a list of all of [[visual3d: | ||
+ | |||
+ | ==== Best Fit Plane ==== | ||
+ | |||
+ | **Best_Fit_Plane**(signal, | ||
+ | |||
+ | The general form of the equation of a plane in 3D is ax+by+cz+d = 0 where 𝑎, 𝑏, and 𝑐 are the components of the normal vector which is perpendicular to the plane or any vector parallel to the plane. | ||
+ | |||
+ | If (𝑥0, | ||
+ | |||
+ | The result of the Best_Fit_Plane function is a signal with the fource components (a,b,c,d) | ||
+ | |||
+ | < | ||
+ | ! Example: Compute a Best_Plane_Fit for one signal across a range of frames | ||
+ | Evaluate_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | ! Example: Compute a Best_Plane_Fit for multiple signals at each frame of data | ||
+ | Evaluate_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | ==== Best Fit Circle ==== | ||
+ | |||
+ | **Best_Fit_Circle**(signal, | ||
+ | |||
+ | The algorithm computes a best fit plane to the data, rotates this plane into a principal plane, computes the center and radius, the rotates these values back into the original plane. The result is 4 components: | ||
+ | - the origin' | ||
+ | - the origin' | ||
+ | - the origin' | ||
+ | - the radius. | ||
+ | |||
+ | ==== Best Fit Sphere ==== | ||
+ | |||
+ | **Best_Fit_Sphere**(signal, | ||
+ | |||
+ | < | ||
+ | ! Example : Fit a sphere to 6 points on a DIAMOND | ||
+ | |||
+ | ! Create 6 TARGETS representing the Vertices | ||
+ | Create_Target | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Create_Target | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Create_Target | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Create_Target | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Create_Target | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Create_Target | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Evaluate_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | Note that TARGETS are created and the sphere computed has each TARGET on its surface. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | < | ||
+ | ! Example : Create a TARGET where each frame is on a random location on the surface of a sphere of radius 1 | ||
+ | Evaluate_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Evaluate_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Create_Target | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | COS(DERIVED:: | ||
+ | -COS(DERIVED:: | ||
+ | SIN(DERIVED:: | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Evaluate_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | {{: | ||
+ | {{: | ||
+ | |||
+ | ==== Simple Linear Regression ==== | ||
+ | |||
+ | **Simple_Linear_Regression**(signal1, | ||
+ | |||
+ | < | ||
+ | Signal = m Signal1 + b | ||
+ | </ | ||
+ | |||
+ | An explanation of the calculation can be found [[Visual3D: | ||
+ | |||
+ | Signal1 and Signal2 are both one-component signals and the resulting METRIC contains 6 components: | ||
+ | - Slope = m -> Component 1 | ||
+ | - Intercept = b -> Component 2 | ||
+ | - Siga = uncertainty in m -> Component 3 | ||
+ | - Sigb = uncertainty in b -> Component 4 | ||
+ | - Chi2 = chi square -> Component 5 | ||
+ | - Q = The R^2 statistic -> Component 6 |
visual3d/documentation/pipeline/expressions/least_squares_fitting_of_data.1718804215.txt.gz · Last modified: 2024/06/19 13:36 by sgranger