How do I find the function and derivative of an unknown curve?

255 Views Asked by At

I have $x$ and $y$ values to plot the curve and I need to find a tangent line of slope 1 that intersects the curve (and the point at which it intersects). I was trying to do polynomial and exponential regression to model the data and fit the curve (in R) but cannot get it to work. It fits a majority of the data but not the curve and I need the function of the curve to find the derivative and tangent.

I don't completely understand the math behind the modeling but all I know is that the fit is inaccurate when I plot it against my data. Is there any way I solve this mathematically? The curve starts slightly downwards, then slopes up gradually before it goes up exponentially

If you do a density plot, most of the values are towards the lower end of y. the values of y are right skewed. This could be influencing my model, so would one solution be to remove multiple prior points?

UPDATE: I tried to limit the number of points and now my plot looks like this (the line plotted is $8.950433e^{-20}\times1.006621^x$). The formula for the line was from taking the exponential regression of the data. From the formula, it kind of makes sense why it's a line but how do I get it to curve? enter image description here

1

There are 1 best solutions below

0
On

One cannot give an accurate solution without numerical data (a graph isn't enough). As a consequence the results shown below are approximates from scanning your graph https://i.stack.imgur.com/38bNs.png for appoximate data.

Certainly many convenient model equations could be proposed. For example with series of tangent function :

enter image description here

As well one could propose a lot of models with series of various functions.

For example series of inverse hyperbolic tangent function :

enter image description here

Even simpler an example with series of hyperbolic function :

enter image description here

Comment : If your graph comes from actual measurements the above values of the parameters have no physical signifiance. A model derived from physical properties should be better.