Any ideas for making this exponential decay function match the actual data better?
Hi all,
I have been trying to fit some weight data that was collected over time to an exponential decay function. I have come up with the following:
f(t) = An + (A0 – An) * exp (- t / tau)
Where: An = final data point measured, A0 = initial data point measured, and tau = a time constant that I am seeking to fit/solve for.
I am using the following code to set up the decay and solve for tau. Data is the collected weight data and t is the times at which the data was collected:
funlist={@(tau, t) An + (A0 – An) .* exp(-t / tau),1}; % define function
[tau]=fminspleas(funlist,1,time,data); % tau estimate
A0 = data(1);
An = data(end);
fn_data=@(t) funlist{1}(tau,t);
When I go to plot the data points to compare it with the fit, I notice the decay function does not do well at later time points where there is a greater plateau (see attached). I am wondering if anyone has any code or functions suggestions to help improve the fit of the curve? Any suggestions are welcome. Thank you very much!Hi all,
I have been trying to fit some weight data that was collected over time to an exponential decay function. I have come up with the following:
f(t) = An + (A0 – An) * exp (- t / tau)
Where: An = final data point measured, A0 = initial data point measured, and tau = a time constant that I am seeking to fit/solve for.
I am using the following code to set up the decay and solve for tau. Data is the collected weight data and t is the times at which the data was collected:
funlist={@(tau, t) An + (A0 – An) .* exp(-t / tau),1}; % define function
[tau]=fminspleas(funlist,1,time,data); % tau estimate
A0 = data(1);
An = data(end);
fn_data=@(t) funlist{1}(tau,t);
When I go to plot the data points to compare it with the fit, I notice the decay function does not do well at later time points where there is a greater plateau (see attached). I am wondering if anyone has any code or functions suggestions to help improve the fit of the curve? Any suggestions are welcome. Thank you very much! Hi all,
I have been trying to fit some weight data that was collected over time to an exponential decay function. I have come up with the following:
f(t) = An + (A0 – An) * exp (- t / tau)
Where: An = final data point measured, A0 = initial data point measured, and tau = a time constant that I am seeking to fit/solve for.
I am using the following code to set up the decay and solve for tau. Data is the collected weight data and t is the times at which the data was collected:
funlist={@(tau, t) An + (A0 – An) .* exp(-t / tau),1}; % define function
[tau]=fminspleas(funlist,1,time,data); % tau estimate
A0 = data(1);
An = data(end);
fn_data=@(t) funlist{1}(tau,t);
When I go to plot the data points to compare it with the fit, I notice the decay function does not do well at later time points where there is a greater plateau (see attached). I am wondering if anyone has any code or functions suggestions to help improve the fit of the curve? Any suggestions are welcome. Thank you very much! exponential decay, custom cuve fitting MATLAB Answers — New Questions