# Find the mathematical relationship between the x value and the y value.

I have this data:

--> x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]';
--> y = [1.031, 0.813, 0.795, 0.795, 0.795, 0.795, 0.795, 0.795, 0.795, 0.795]';


That generates this curve:

I need to calculate the formula that generates that graphic.

How can I calculate that formula?

• It sure doesn't look like the values are going down as $x$ increases. – Gerry Myerson May 6 '18 at 6:14
• Yes, you are right. The values aren't going down as x increases. – VansFannel May 6 '18 at 7:04
• If you want to fit those ten points exactly, and if you don't care what happens anywhere else, look up "Lagrange interpolation". – Gerry Myerson May 6 '18 at 10:14

The question is not clear enough. Do you want an exact formula or an approximate formula ?

A exact formula, that is an equation for three linear segments, would involve the Heaviside function. I suppose that is not that what you want.

An approximate formula is ambiguous without more specification (criterium of fitting, range of acceptable deviation, etc.). They are an infinity of formulas depending on those specifications.

For example the formula : $$y\simeq 0.795+3.094\:e^{-2.573\:x}$$

Of course, with this formula, the points are accurate, but not the cuve compared to the straight segments between the points as drawn on your graph.

• Thanks. I have to find the mathematical relationship between the y value and the x value. – VansFannel May 6 '18 at 7:13
• That is my answer. What do you want : An exact relationship or an approximate relationship ? – JJacquelin May 6 '18 at 7:15
• Thanks again. For an exact relationship, do you need more values? I think I don't need a lot of accuracy. – VansFannel May 6 '18 at 7:23
• What do you want : An exact relationship ONLY for the 10 given points, or an exact relationship for the given points AND for the straight lines between the points as they are drawn on your graph ? – JJacquelin May 6 '18 at 7:27
• An exact relationship ONLY for the ten given points. – VansFannel May 6 '18 at 7:29