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 12:49] – sgranger | visual3d:documentation:pipeline:expressions:least_squares_fitting_of_data [2025/01/24 18:53] (current) – [Best Fit Plane] wikisysop | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{{{{{{{this page contains a list of all functions that are used to find a line or plane of best fit to your data. | + | ===== Least Squares Fitting |
- | ===== best fit plane ===== | + | This page contains a list of all of [[visual3d: |
- | **best_fit_plane**(signal, | + | ==== Best Fit Plane ==== |
- | [[[https:// | + | **Best_Fit_Plane**(signal, |
- | 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, start_event_signal, end_event_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. |
- | fit a 2d circle to the path of a signal. | + | If (𝑥0,𝑦0, |
- | the algorithm computes a best fit plane to the data, rotates this plane into a principal plane, computes | + | |
- | the result is 4 components; the x,y,z location of the origin | + | |
- | \\ | + | |
+ | The result of the Best_Fit_Plane function is a signal with the fource components (a,b,c,d) | ||
- | ===== best fit sphere ===== | + | < |
+ | ! Example: Compute a Best_Plane_Fit for one signal across a range of frames | ||
+ | Evaluate_Expression | ||
+ | /EXPRESSION=Best_Fit_Plane(CURRENT_SIGNAL, | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
- | **best_fit_sphere**(signal, | + | < |
+ | ! Example: Compute a Best_Plane_Fit for multiple signals at each frame of data | ||
+ | Evaluate_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
- | example : fit a sphere to 6 points on a diamond | + | ==== Best Fit Circle ==== |
- | create 6 targets representing the vertices | + | |
- | [[visual3d: | + | **Best_Fit_Circle**(signal, start_event_signal, end_event_signal) - Fits a 2D circle to the path of a signal. |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | ! / | + | |
- | **;** | + | |
- | [[visual3d: | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | ! / | + | |
- | **;** | + | |
- | [[visual3d: | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | ! / | + | |
- | **;** | + | |
- | [[visual3d: | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | ! / | + | |
- | **;** | + | |
- | [[visual3d: | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | ! / | + | |
- | **;** | + | |
- | [[visual3d: | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | ! / | + | |
- | **;** | + | |
- | **evaluate_expression** | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | ! / | + | |
- | **;** | + | |
- | note that targets are created and the sphere computed has each target on its surface. sphere1.jpgsphere6view.jpg | + | |
- | example : create | + | The algorithm computes |
- | **evaluate_expression** | + | - the origin' |
- | / | + | - the origin' |
- | / | + | - the origin' |
- | / | + | - the radius. |
- | / | + | |
- | ! / | + | |
- | **;** | + | |
- | **evaluate_expression** | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | **;** | + | |
- | [[visual3d: | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | cos(derived:: | + | |
- | -cos(derived:: | + | |
- | sin(derived:: | + | |
- | ! / | + | |
- | **;** | + | |
- | **evaluate_expression** | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | / | + | |
- | ! / | + | |
- | **;** | + | |
- | random8view.jpg | + | |
- | sphererandom.jpg | + | |
- | ===== simple linear regression ===== | + | |
- | **simple_linear_regression**(signal1, | + | ==== Best Fit Sphere ==== |
- | signal2 = m signal1 + b | + | **Best_Fit_Sphere**(signal, |
- | an explanation of the calculation can be found [[visual3d: | + | |
- | signal1 and signal2 are one component signals | + | |
- | resulting metric | + | |
- | 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 | + | |
- | }}}}}}}} | + | < |
+ | ! 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.1718801397.txt.gz · Last modified: 2024/06/19 12:49 by sgranger