finale edit: i found someone who solved my problem via matlab. therefore i wont try out the proposed solutions now, but wont delete my question in case someone might have use for the proposed solutions in the future. thx to everyone who tried to help me
I have a csv data with measure points. These points follow a exponential curve in regular sequences.
edit: had to remove the plot
Now I need to find an exponential function to fit for example for the time interval between 6 minutes and 9 minutes (the second gray bar). I created a new data for this which only contains the measure points between 6 and 9 min). But if I try the usual:
data=Import["mydataselection","CSV"];
nlm=NonlinearModelFit[data[[All,{1,2}]],a Exp[-k t+m],{a,k,m},t]
I get completely wrong numbers for a,k and m. in this case: $a=0.142679$, $m=0.441977$ and $k=0.122386$. (btw I think I need the $+m$ somewhere because I should get the same "a" and "k" for the time interval 6 to 9 and 12 to 15 etc.
The plot of this exponential function looks like this:
here you can see what the plot of the data points for 6 to 9 min looks like and on the right what the plot of the exponential fit with a Exp[-k t] looks like, which clearly doesn't fit.
In another case (working with another csv data I even got a negative "a" although the curve is very similar.
Maybe its also important to note that I have a lot of datapoints (from 6 to 9 min its about 24000 datapoints).
Can anyone help me out here?
Edit: Maybe I should note that the CSV data looks like this: x1,y1, x2,y2, ...
edit2: I can't post more pictures or the actual data because I need 10 "reputation" for that.
Also I removed the "+m", but I still can't get proper values. For example for 9 to 12 min I get positive a Exp[k t] with both positive "a" and "k"
Edit3: I switched the second pic for a better one.






3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – Feb 20 '16 at 15:22
a Exp[-k(t-t0)]where you knowt0as the starting point for a particular interval, then you'll get more consistent results among intervals for the estimates ofaandk. – JimB Feb 20 '16 at 16:31Imports your first dataset):dataset1 = Most /@ Import["http://pastebin.com/raw/RnMJkaPv", "CSV"];. Please include full code which generates the plots which you show in your question and also please clear out the question: it contains a lot of unnecessary wording and has a deficiency of actual data and no clear explanation of what you have tried and what you have got! – Alexey Popkov Feb 20 '16 at 17:35FindFormula[data, t, 10]which will give you ten potential models (either before or after taking logs) which suggests the fit is more complicated than a simple linear function oftor an exponential of a linear function oft. Also, you should state whether the objective requires fitting so some predetermined functional form or if you just need to obtain a predictive summary. – JimB Feb 20 '16 at 17:44mwas misplaced in the original formula.nlm = NonlinearModelFit[data, {a Exp[-k t] + m, m < Min[data[[All, 2]]]}, {a, k, {m, 0.075}}, t]seems to provide a reasonable fit. – JimB Feb 20 '16 at 18:05mas a parameter to be estimated along with all of the others as that way you can get defensible estimates of precision for all of the parameters and if, say, one of the time intervals was incomplete, you'd have comparable estimates ofm. Also, the person who pointed out that you really didn't have a standard exponential curve is correct with the original model proposed. It only has a part of its final definition as a standard exponential. That was a good hint that something else needed to be considered. – JimB Feb 21 '16 at 16:40