how to fit a surface to 3d data points
5 次查看(过去 30 天)
显示 更早的评论
Hi, I have a set of 3D data points (x,y,z) that I want to fit using the equation
A*x^2+B*y^2+C*x*y = [ z (1-z) ]^2
A, B, C being the parameters I have to estimate.
can anyone help me?
0 个评论
采纳的回答
Star Strider
2019-4-17
If your data points are each vectors, try this:
x = rand(1, 10); % Create Data
y = rand(1, 10); % Create Data
z = rand(1, 10); % Create Data
DM = [x(:).^2, y(:).^2, x(:).*y(:)]; % Design Matrix
P = DM \ (z(:).*(1-z(:))).^2; % Estimate Parameters
A = P(1);
B = P(2);
C = P(3)
Experiment to get the result you want.
6 个评论
Star Strider
2019-6-12
Because that is how ‘SStot’ is calculated, at least as I interpret it in the context of yoiur model. See the Wikipedia article on: Coefficient of determination (link).
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!