Surface fitting tool. What does center and scale do?
31 views (last 30 days)
Show older comments
Hi everybody,
As the title says, I'm playing with surface fitting tool to create my surface using linear method. Can someone please explain to me what the option center and scale is doing to my graph. I have tried to do same thing with griddata function and I get the same result for my surface as I get using fitting tool but only when center and scale box is unchecked.
Thanks in advance.
0 Comments
Accepted Answer
Tom Lane
on 5 Sep 2012
If you have the Statistics Toolbox, the following commands will reproduce the sftool results:
[X,Y,Z] = peaks;
x2fx([X(:) Y(:)],'q')\Z(:) % without centering/scaling
x2fx(zscore([X(:) Y(:)]),'q')\Z(:) % with centering scaling
The idea is that the x variable is replaced by (x-mean(x))/std(x) and the y variable is replace similarly. This is done before any polynomial terms are computed. The transformation won't change the fit theoretically, but it will make the results better conditioned on a computer with finite precision.
3 Comments
Tom Lane
on 6 Sep 2012
Can you tell me what type of fit you used? You mentioned linear in your original question. I assume that is linear interpolation?
Unfortunately we have stepped out of my area of expertise. I think this interpolant is based on a Delauney triangulation, and I would expect that to be affected by different scaling of the X and Y data. I don't know enough about the method or your data to have any intuition about whether one ought to be smoother or better than the other.
More Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!