I Fit a non-linear function to this time series

AI Thread Summary
The discussion revolves around fitting a non-linear function to a time series with approximately 5500 data points, using the equation n(t) = n_max - (n_max - n_start)*exp(-t/tau). Users are seeking methods to determine the parameters n_start, n_max, and tau in Excel, as they are familiar with Matlab's fminsearch but prefer Excel's tools. There is confusion regarding the formula, particularly the roles of n_max and n_start, with suggestions to rename n_max to n_end for clarity. Additionally, participants question the necessity of the negative term in the equation, proposing that a simple exponential decay model might be more effective. The discussion highlights challenges with Excel's trendline capabilities and solver functionality, leading some to resort to manual parameter estimation.
MacIntoShiba
Messages
7
Reaction score
1
TL;DR 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.
 
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.
 
Back
Top