how to fit a surface to 3d data points

4 ビュー (過去 30 日間)
Alessandraro
Alessandraro 2019 年 4 月 17 日
コメント済み: Star Strider 2019 年 6 月 12 日
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?

採用された回答

Star Strider
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 件のコメント
Alessandraro
Alessandraro 2019 年 6 月 12 日
編集済み: Alessandraro 2019 年 6 月 12 日
Thank you. I am sorry, can I ask you why you calculate SStot
SStot = sum(([(z(:)-D(:))./(1-D(:)) (1-z(:))].^2 - mean(z(:))).^2);
calculating mean(z(:)) instead of mean([(z(:)-D(:))./(1-D(:)) (1-z(:))].^2)?
Thank you.
Star Strider
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 ExchangeInterpolation についてさらに検索

タグ

製品


リリース

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by