CLsqFit:GetX
The GetX method returns a table containing the value of every point for the n-th basis dimension, starting at 1. If fitting one variable (that is, 1 basis dimension), then you do not need to specify the dimension. The returned table contains CLsqFit:GetNumPts() values.
tX = CLsqFit:GetX( nDim* ) tX1, tX2, tX, tWt4 = CLsqFit:GetX() |
The following example shows how to fit a 2x3 polynomial to (x,y,z) data, then makes a scatter plot of the observed values against the y value (dimension 2) :
L = CLsqFit:new() |
-- create a CLsqFit object |
L:SetNumCoefs( 2, 3 ) |
-- Fit a 2-D polynomial with 2x3 coefficients |
|
-- add a point for x = 3.2, y = 4.65, z = 12.5 |
-- (add more points to the fit) |
|
L:Fit() |
-- Fit the polynomial |
|
-- make a scatter plot of observed value against X[2] |