# Is there a polynomial curve fit function(s) in Calc?

Is there a polynomial curve fit function(s) in Calc ?

As per the comments by @Pedro1 it is time to provide an updated answer to this question. The v4.2 release notes under Chart indicate these trend line enhancements:

• Support more than one trend line per series (TomaÅ¾ Vajngerl)
• Force intercept for trend lines fdo#40314 (TomaÅ¾ Vajngerl)
• Extrapolation of trend lines fdo#40316 (TomaÅ¾ Vajngerl)
• Polynomial trend lines fdo#35712 (TomaÅ¾ Vajngerl)
• Moving average trend lines fdo#40315 (TomaÅ¾ Vajngerl)

Thus, with respect to this question, there is now a polynomial curve fit function. These enhancements cover all the issues (shortcomings) listed by the CorePolyGUI extension, and a few others as well. The CorePolyGUI extension may now therefore be redundant.

## As noted by others, this answer is now outdated. There is now a polynomial curve fitting function built into the LibreOffice chart/graphing facility.

CorelPolyGUI is an extension for LibreOffice that implements polynomial curve fits.

You can find it here: http://extensions.libreoffice.org/extension-center/improved-trend-lines

You can also use the linest function. LibreOffice doesnāt automatically generate the values for x^2, x^3, etc when you use the linest function for polynomial regressions. You have to generate those values yourself in columns adjacent to the values for x, then run the regression across the set of cells that includes those values for different orders of x and the values for y.

The instructions from http://help.libreoffice.org/Chart/Trend_Lines

A polynomial regression curve cannot be added [to a chart] automatically. You must calculate this curve manually.

Create a table with the columns x, xĀ², xĀ³, ā¦ , xāæ, y up to the desired degree n.

Use the formula =LINEST(Data_Y,Data_X) with the complete range x to xāæ (without headings) as Data_X.

The first row of the LINEST output contains the coefficients of the regression polynomial, with the coefficient of xāæ at the leftmost position.

The first element of the third row of the LINEST output is the value of rĀ². See the LINEST function for details on proper use and an explanation of the other output parameters.

Also, see the manual for linest at http://help.libreoffice.org/3.4/Calc/Array_Functions#LINEST

Note that using linest with an array requires that the user exit the cell containing the linest function with Ctrl+Shift+Enter, not just pressing Enter.

1 Like

The answer is quite easy: NO. And there has never been one. Iām a physics and chemistry teacher, and I like to use Libreoffice at school, but when it comes to explain an oblique shot I canāt show off this software. Of course, I can build the graphic position-time, but I canāt get the right equation.

I hate to say this, but in my opinion, this is the only question where Excel is better than Calc.

P.D: excuse me if I have made some mistakes, Iām still learning English

@unquimico, maybe itās time to update to 4.2.1 and test the new polynomial regressions

There is no polynomial trend line yet. Polycorel is ok, but not quite as elegant as the integrated features of MS Office. There is however FOSS alternative: gnumeric. Itās got more capabilities when it comes to regressions, but lacks a bit in compatibility with LibreOffice. I tend to use them side by side and I export finished graphs to pngās for \LaTeX\ documents. I sincerely hope LibreOffice will take the opportunity to implement the extra features of the gnumeric fork(at least I think itās a fork, donāt quote me on it and donāt shoot me if Iām wrong) into the more standard LibreOffice.

@ByteMe, actually you are wrong Polynomial curves have been added in the 4.2 branch (see following link, under Chart)