How to fit data (2 variables) to get an equation?

6 views (last 30 days)
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')

Answers (1)

Rishabh Mishra
Rishabh Mishra on 29 Sep 2020
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.

Community Treasure Hunt

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

Start Hunting!