LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview double exponential fitting

Solved!
Go to solution

Hello , Experts. I have an 1 D array data which I want to use double exponential fitting like the python  numkit.fitting --> FitExp2.  Why i need to use it since the data overall trend is downward and the decline is fast at beginning. i want to make double exponential fitting base on maybe 100 data , then replace to the first 10 data of the original array. 

I tried a lot but could not find how to make it base on the curve fit tool or formular node. can you help to share how to make it and that will be appreciated if demo VI can be shared. 

0 Kudos
Message 1 of 16
(1,737 Views)

I recommend to use a VI model instead of the formula. Much better performance and easier to debug.

 

Start reading here.

 

 


@James_tt wrote:

Why i need to use it since the data overall trend is downward and the decline is fast at beginning. i want to make double exponential fitting base on maybe 100 data , then replace to the first 10 data of the original array. 


I don't understand what you are saying here. replace the first 10 points with what exactly? And why exactly?

0 Kudos
Message 2 of 16
(1,729 Views)

Hello 

Thanks for the great support and comments.  I would like to use the first 10 points from the new fitting data to replace first 10 points in the original 1D array. then I will use new fitting such as moving average base on the new generated array to get more reliable result. 

 

brs

James

0 Kudos
Message 3 of 16
(1,720 Views)

So what's wrong with the first 10 points?

Why would replacing real data make anything more reliable? Are you excluding them from the fit?

0 Kudos
Message 4 of 16
(1,707 Views)

thanks for the comments.

those first 10 points are changing too fast and have big variation if compare with rest of hundreds data. overall trend is going down. that impacts rest data fitting. i have tried moving average. exponential. polynominal. all got impacted from that. such as a data group. 120 ,80,70,83,68,72,61,50,31,21,2.1,2.2,1.9....these is also small variation for the data after 10points. i have to use fitting to handle big amount data to complete the long term track and simulation. Finally, I need to pickup many points includes the first 3~7 points from the last updated fitting array. 

0 Kudos
Message 5 of 16
(1,699 Views)

sorry, I missed one point from your question. I need those first 10 points for the final data . But not directly use those.  Need double exponential fitting for those then take those  fitted data in use for another fitting.  The final result will be created from "another fitting"

 

brs

 

0 Kudos
Message 6 of 16
(1,696 Views)

It would help if you could show us the data.

0 Kudos
Message 7 of 16
(1,665 Views)

I pickup part of my data to attachment.  that will be a big move for my labview skill if get to know how to make double exponential fitting function.

 

thanks in advance. 

 

brs

0 Kudos
Message 8 of 16
(1,628 Views)

So you want a double epxonential fit (5 parameters: offset, amplitude1, ampltude2, tau1, tau2)

 

Well, as a first step let's just quickly look at your data in a graph.

 

  • The range is almost 3 orders of magnitude
  • >95% of your data is just noisy flat baseline, giving you an excellent guess for the offset (~20!) because ~400 points define it.
  • The first 10+ points are garbage (clipped?) and if we would extrapolate to zero, the real amplitude could be tens of millions.
  • This leaves us about 10 or less points to define the remaining four parameters of a double exponential (two Amplitudes and two Tau's in index units)
  • Only a few percent of your data contributes to the decay and you want to fit four parameters to that??
  • This will not work, independent of any programming language! Your data is not sufficient to define a double exponential decay.

 

Here's your data on a graph with logarithmic mapped Y axis.

 

altenbach_0-1682187257730.png

 

 

Do you have better data? Can you tell us more about the data? What do the decays signify?

 

If we just look at the first 25 points, you can see that the data is actually sigmoidal on a logarithmic Y axis, so it is clearly NOT a double exponential in any shape or form.

 

altenbach_1-1682187801576.png

 

 

Message 9 of 16
(1,618 Views)

First of all, really appreciate your help. 

I manually checked data set and found my description had been wrong. 

In the data set which I provided, It is exactly correct as you mentioned the first 10 points are garbage. I am aiming to start the fitting from the 11th points to 100th point. 

I also found my previous data processing step has bug. it is corrected now and the new data set as attachment. 

I also realized if fit all elements from 11th to last. It generates too aggressive trend.  probably 10 elements for Double exponential fitting are good enough.  

 

Regards .

0 Kudos
Message 10 of 16
(1,545 Views)