Fit a non-linear function to this time series

Click For Summary

Discussion Overview

The discussion revolves around fitting a non-linear function to an experimentally obtained time series, specifically using the equation n(t) = n_max - (n_max - n_start)*exp(-t/tau). Participants explore methods for determining the parameters n_start, n_max, and tau, with a focus on using Excel for this task.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant suggests using Excel's capabilities to find exponential fit functions and manually defining "best fit" through quality calculations.
  • Another participant expresses frustration with Excel's trendline and solver functionality, opting to find parameters by hand instead.
  • A participant questions the formulation of the equation, specifically the role of n_max and its relationship to n_start, suggesting that n_max might be better termed n_end.
  • Concerns are raised about the negative term in the equation, with a suggestion to consider modeling it as simple exponential decay for potential simplification.

Areas of Agreement / Disagreement

Participants express differing views on the formulation of the equation and the appropriateness of using Excel for fitting the model. There is no consensus on the best approach or the interpretation of the parameters involved.

Contextual Notes

Participants note limitations in Excel's functionality for this type of analysis, and there are unresolved questions regarding the mathematical formulation of the model and the implications of parameter definitions.

MacIntoShiba
Messages
7
Reaction score
1
TL;DR
Fit non-linear function to a time series
I have an experimantally obtained time series: n_test(t) with about 5500 data points. Now I assume that this n_test(t) should follow the following equation:
n(t) = n_max - (n_max - n_start)*exp(-t/tau).

How can I find the values for n_start, n_max and tau so as to find the best fit to the n_test(t) time series? I am aware that with Matlab this could be accomplished with fminsearch, however I would like to implement something in Excel.
 
Physics news on Phys.org
Excel should find exponential fit functions, too. Not sure about the offset, however.
You can also define "best fit" manually by calculating the fit quality as function of these parameters (in any way you like) and then use the solver to minimize that cell by changing the three parameters.
 
Excel is not really working along, doesn't have a usefull trendline I can plot through it. The solver doesn't really work either. Ill now finding the paramters by hand. For now that will suffice, this is not a daily recurring task.
 
MacIntoShiba said:
Summary:: Fit non-linear function to a time series

I have an experimantally obtained time series: n_test(t) with about 5500 data points. Now I assume that this n_test(t) should follow the following equation:
n(t) = n_max - (n_max - n_start)*exp(-t/tau).

How can I find the values for n_start, n_max and tau so as to find the best fit to the n_test(t) time series? I am aware that with Matlab this could be accomplished with fminsearch, however I would like to implement something in Excel.
I don't get the formula - is nmax supposed to be the max between start and t? if so, when is the max ever anything but the start as you begin by subtracting n start from itself? Then if nstart >0 each iteration of the exponential term remains zero - you never get a value to multiply by the exponential.
 
Last edited:
BWV said:
I don't get the formula - is nmax supposed to be the max between start and t? if so, when is the max ever anything but the start as you begin by subtracting n start from itself? Then if nstart >0 each iteration of the exponential term remains zero - you never get a value to multiply by the exponential.
A better name for n_max is n_end. Thus in the beginning the concentration is n_start, after an infinite amount of time it's n_max (or n_end, better name).
 
MacIntoShiba said:
A better name for n_max is n_end. Thus in the beginning the concentration is n_start, after an infinite amount of time it's n_max (or n_end, better name).
Why the minus term? Can’t you model it as simple exponential decay, then you can linearize by taking the log
 
MacIntoShiba said:
Excel is not really working along, doesn't have a usefull trendline I can plot through it. The solver doesn't really work either. Ill now finding the paramters by hand. For now that will suffice, this is not a daily recurring task.
That problem description doesn't help understanding what went wrong.
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 30 ·
2
Replies
30
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K