Quantcast
Channel: PTC Community: Message List
Viewing all articles
Browse latest Browse all 11712

Re: Fitting a function to Data

$
0
0

I am trying to keep up with this discussion, perhaps there are bugs perhaps there are future enhancements.

You a referring to the thread I opened here http://communities.ptc.com/message/234933#234933 ? Not sure if I did something wrong there or not. But if not, then I would either expect a similar result as without units (at least if I use base units) or an error telling me, that regressions should not be done with units. I could image that there are reasons for better not using units here, but again I am not sure and so opened the discussion to collect other opinons.

 

But you lost me .. how did you come up with g(t,v). I have not seen this fitting function .. I dont think

I guess you have seen this fitting function already, but I sure should have better written it in a more convential way as the parameters would have a meaning if we do that and that can help to find guess values.

You are referring to

g1.png

or in a later sheet

g2.png

These are simply the sums of two or (the second) an arbitrary number of gaussians which are quite usual and useful functions to try for a fit in many situations. But I was surprised that I got that nearly perfect fit with 6 gaussians and also that slight changes in the guesses have that big impact on the result.

 

A gaussian is a function of the form

g3.png

or may be written as

g4.png

where y0 is the baseline offset, A is the total area under curve from the baseline, t0 is the center of the peak, w is something like 2 sigma, approximately 0.849 times the width of the peak at half height.

 

Richard had posted sums of gaussians from time to time in the past here and he uses

g5.png

where h, w and t0 are controlling height, width and peak position.

The way of fitting multiple gaussians using the sum, matrix and minerr was stolen from Richard by me anyway.

I shouldn't had setup the function using meaningless coefficients, though.


Viewing all articles
Browse latest Browse all 11712

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>