How to fit data (2 variables) to get an equation?
6 次查看(过去 30 天)
显示 更早的评论
Hi,
I am trying to fit two variables x1 and Y1. I used cuve fitting toolbox but none of the inbuilt function is giving good result. Also seeing scatterplot it gives hint to fit e^x fuction but I am looking for an help to get an eqn which will describe the data best way.
Here is my code
load tetralldown.mat
x=tr;
y=eff;
x1=(tr-mean(tr))/std(tr); # standardization of data should have used zscore though
y1=(eff-mean(eff))/std(eff);
scatter(x1,y1)
xlabel('X variable')
ylabel('y variable')
0 个评论
回答(1 个)
Rishabh Mishra
2020-9-29
Hi,
Based on my understanding of description provided by you. I would like to point out that curve fitting is a process of finding an approximate polynomial mapping from x variable to y. Given the 2D scatter plot of X1 vs Y1 (as you have posted), for same values in X1, we have multiple values of Y1.
This violates the primary rule of function mapping which states that a given point in domain (domain is collection of x values) can have only single mapped value in range (range is collection of y values).As function mapping between X1 & Y1 is not possible, curve fitting of Y1 on X1 cannot be applied. Hence, the curve fit so obtained is inaccurate. Therefore, there is no single curve that fits the given scatter plot.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Descriptive Statistics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!