Is polynomial regression implemented?

It does not seem to be a way to have a few columns of data and specify a polynomial that will be used to calculate the regression.

For example, if we have certain X-Y columns, how do we fit a polynomial model other than using a ax+b fit on the linear regression ?

I use libreoffice 7.2, in Ubuntu 22

Have thoroughly read this link already Is there a polynomial curve fit function(s) in Calc?

In google sheets, this is how it looks like Polynomial Regression in Google Sheets (Step-by-Step)

What’s that? ax+b is obviously linear (affine). I don’t understand. If you read about the usage of LINEST() for polynomial “best approximation”: What’s bad with it?

I answer the post below.

You can read polynomial approximation, LINEST wont include other than linear approximations. You can well fit stuff other than lines, this is called trends as far as I can see.

I finally got it:

Method 1.

  1. Press in the data points of the chart (or maybe selecting two columns works as well)
  2. Go to insert > trendline

Method 2

  • Just right clicking in the data and select insert trendline

and voala

If you want a solution of the kind “polynomial trendline” for a chart , you should explicitly talk of a chart.
BTW: Such trendlines are internally created using exactly the same algorithm as LINEST().

  • I’m aware it is the same algorithm that is the point of the post, this is why it should be possible to do it from statistics>regression, but it isn’t.

  • And this also isn’t available in LINEST it will use a linear function to calculate, there is no way to specify a polynomial

  • Also not available under TREND

However, there is another bug I think because if you do it in the chart, and select a trendline using a polynomial of degree X, it doesn’t pay attention to that and just includes quadratic polynomial.

Actually after tinkering the data it did plot the equation, which is great:

Got why as well, this was my mistake because the data was quadratic, this meant the prev coefficients must have been 0, changing some data, it finally printed the polynomial :slight_smile:

The question was " Is polynomial regression implemented?" (in Calc)

Standard polynomial approximation is multilinear approximation by means of the method “least-sum-of-squares-of-deviations”. This is what LINEST() does if values for y; x, x^2, x^3, … x^n are passed to it in the correct order.
(The returned coefficients for the polynomial are returned in the traditional reversed order.)
See also this example with n=5:
sillyPolinomialTrendline_vs_LlinestExample.ods (46.4 KB)

I see, that is interesting. However, there is no description or indication of this within the program, so we can not really guess, apologizes but I wont download a random file from a forum.

It requests some basic mathematical knowledge, what is independent from any spreadsheet software.

From the Wiki article:
" Linearity. This means that the mean of the response variable is a linear combination of the parameters (regression coefficients) and the predictor variables. Note that this assumption is much less restrictive than it may at first seem."

The method of “LeastSquares” was first designed by C.F. Gauss in 1801 and published a few years later. It’s still the basis for much of approximation (often called “regression” for reasons I don’t know).

Many users do not expect LINEST() to be capable of polynomial approximations just because of its name.
Many years ago I tried it with a small tutorial in the “other forum” you know. I was bitten off by a colleague there who is also known to you.
Now a newcomer tells me he would not download any “random example” (by which he means mine) from a forum. That hundreds of experienced users have done that with thousands of my examples is hard to believe?
May all newbies become happy with ChatGPT. Mathematics is out.

For what reason this thread was marked solved I don’t know. After all the question wasn’t about charts.

2 Likes

Don’t take it personally. People are generally funny, showing in public that they are not afraid of downloading and executing random files from the Internet, even without knowing what exactly they download (because they write here on the “forum”, which means they downloaded dozens of HTML and CSS and JS, inter-referencing each other, which their browsers happily executed…), but they refuse to download a file explicitly created by a friendly volunteer to help personally them, in a controlled “I click it, see it downloaded, open it using the application I choose, with security settings set in that application - which is “do not execute and access external data” by default”… So better just smile :smiley:

2 Likes