[Solved] Estimate differentials with exponential function

Discuss the spreadsheet application
Post Reply
zap
Posts: 2
Joined: Mon Apr 13, 2020 11:03 pm

[Solved] Estimate differentials with exponential function

Post by zap »

I have a column with rising values. Say, column A is like:
123
134
156
196
215
268
...
Now I want to estimate these numbers with a exponential function y = a^x.
If I use just LOGEST(A1:A6;;0) it will compute a.
But I would like to fit the y as if it would be relative to first value, e.g:

123-123
134-123
156-123
196-123
...

How I can compute LOGTEST without creating a separate row with subtracted values for this?
E.g. something like LOGEST(A1:A6-A1;;0) but this doesn't work.
Does Calc have functions that output matrices that can be used as arguments to other functions at all?
Last edited by zap on Tue Apr 14, 2020 4:43 pm, edited 2 times in total.
LibreOffice 5.4 on Fedora Linux
FJCC
Moderator
Posts: 9280
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Matrix math

Post by FJCC »

Ones reason that

Code: Select all

=LOGEST(A1:A6-A1;;0)
does not work is that there is no solution to 0 = a^x. You can try

Code: Select all

=LOGEST(A2:A6-$A$1;;0)
entered as an array formula, that is, confirmed with CTRL + Shift + Enter instead of a plain Enter.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
MrProgrammer
Moderator
Posts: 4908
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Matrix math

Post by MrProgrammer »

zap wrote:If I use just LOGEST(A1:A6;;0) it will compute a. But I would like to fit the y as if it would be relative to first value
To use LOGEST, all of the Y values must be positive, since Calc will need to calculate their logarithms. Thus you cannot subtract 123 since 123-123 is zero. However if you want to look at relative values you could divide all the values by 123. The formula would be =LOGEST(A1:A6/A1;;0). This is an array formula so type it and and press ⇪⌘Enter (Shift+Command+Enter) on a Mac or Ctrl+Shift+Enter on other platforms; if you press Enter by mistake, use Edit → Delete Contents → Formulas, then try again.

If you need any additional assistance, attach a document demonstrating the situation (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the document itself). Explain what results you expect, that is, your goal.
zap wrote:Does Calc have functions that output matrices that can be used as arguments to other functions at all?
Yes, though we use the term "array" instead of "matrix". See List of Calc Array functions, one of which is LOGEST.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
zap
Posts: 2
Joined: Mon Apr 13, 2020 11:03 pm

Re: [Solved] Estimate differentials with exponential functio

Post by zap »

Thank you for help! My real problem was that I was subtracting the first term, and indeed there's no log(0).
I was getting "Error 502" which I wrongly interpreted as that the syntax is incorrect, but in reality it was meaning "invalid argument to function".
The link to array formula docs was also very helpful; I searched for it but wasn't able to find it (maybe because I used the term "matrix math" or something like that).
LibreOffice 5.4 on Fedora Linux
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: [Solved] Estimate differentials with exponential functio

Post by Lupp »

zap wrote:My real problem was that I was subtracting the first term, and indeed there's no log(0).
I'm not quite sure.
You didn't tell anything about the primary (X-) values.
You didn't tell for what reasons you tryed to find an exponential function with estiamted parameters.
You didn't tell if you actually had only 6 data (pairs?), or in what way you chose the sample...

I was in the mood to play a bit with your data and to make a kind of essay of them.
See yourself:
aoo101633approximation.ods
(94.78 KiB) Downloaded 124 times
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Post Reply