How to find quartic regression of a given set of data

2.2k Views Asked by At

I have a set of data like this

When plotting the curve for the above set of data I get a graph like this

How would I go about figuring out the quartic regression formula for a curve that would best fit the plotted points?

EDIT: This site does it perfectly. I just can't figure out how it works

EDIT2: The data set is basically a frequency distribution. With the X axis showing the difference between two specific days and the y axis shows how many times that difference has occurred (ex: difference of 0 days happened 26 times, 1 day happened 14 times etc). So although it does tend towards 0 it can increase suddenly which is why I thought of a polynomial regression.

1

There are 1 best solutions below

1
On

Suggestions in response to the comment

What I ultimately need is a curve of best fit for the graph.

"Curve of best fit" is not a well defined term. You have to decide what works best for your application.

Splines are the standard way to find a smooth curve that goes through all the points. That may be what the online app you link to does under the covers.

If you have $n$ points you can interpolate and find a polynomial of degree $n$ that goes through all the points. That will often oscillate a lot and not "look right".

You can find a polynomial of fixed low degree (suggested by the "quartic" in your title) that is the best approximation (in a precise sense) but does not necessarily go through the points. The simplest example is the (linear) regression line.

Y0ur data seem to decrease (more or less) toward $0$. No polynomial will behave like that. Perhaps a function of the form $y = ce^{-kx}$ would work. (It would not go through all the points.) Excel can find $c$ and $k$ from the data (you may have to transform it first).