Why does fit(..., 'lowess') return zero?

When using fit() to model a surface, I get a zero value at a seemingly random location. Why is this?
x = [-4, -3, -3, -3, -2, -1, -1, 0, 1, 2, 3, 3, 4]';
y = [0, -3, 1, 3, 0, -3, -1, 4, 1, -4, 1, 3, 0]';
z = [1.8449, 2.0116, 2.2877, 1.6313, 1.9229, 1.9516, 1.9282, 1.9436, 2.7744, 2.6486, 2.5890, 2.8023, 3.1996]';
fitType = 'lowess';
fitobject = fit([x, y], z, fitType);
fitobject(-0.9, 1.9) % Returns 2.1479
fitobject(-1, 2) % Returns 0?
fitobject(-1.1, 2.1) % Returns 2.1963

4 件のコメント

Torsten
Torsten 2022 年 3 月 22 日
Did you plot the surface ? This will help to interprete the values.
Robot
Robot 2022 年 3 月 22 日
編集済み: Robot 2022 年 3 月 22 日
Thanks @Torsten for the input. My question is more related to what are the algorithm details that would produce such a sharp local minimum? I would not arrive at this result intuitively.
x = [-4, -3, -3, -3, -2, -1, -1, 0, 1, 2, 3, 3, 4]';
y = [0, -3, 1, 3, 0, -3, -1, 4, 1, -4, 1, 3, 0]';
z = [1.8449, 2.0116, 2.2877, 1.6313, 1.9229, 1.9516, 1.9282, 1.9436, 2.7744, 2.6486, 2.5890, 2.8023, 3.1996]';
fitType = 'lowess';
fitobject = fit([x, y], z, fitType);
fitobject(-0.999999, 1.999999) % Returns 2.1095
fitobject(-1, 2) % Returns 0
fitobject(-1.000001, 2.000001) % Returns 2.2439
plot(fitobject)
Robot
Robot 2022 年 3 月 23 日
I tried many different permutations of z. Many, but not all, produce fitobject(-1, 2) = 0. I think this suggests a bug.
Is anyone able to reproduce this result in higher levels of MATLAB?
Torsten
Torsten 2022 年 3 月 23 日
編集済み: Torsten 2022 年 3 月 23 日
I'd send the .m file together with the data to MATLAB support.
Do you use the most recent MATLAB version ?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLinear and Nonlinear Regression についてさらに検索

製品

リリース

R2017b

質問済み:

2022 年 3 月 22 日

編集済み:

2022 年 3 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by