From: Alex on 22 Jun 2010 11:42 Hello I have plotted two different data sets. http://yfrog.com/0afitdistributionforblueap Blue and Red data sets For every different value on axis x I have taken only 10 measurements as it takes so much time for the experiment to run. I would like to fit two distributions for these two data sets. One for each one. I do not know what function to use in matlab. If I got it right I have to a)pick one distribution that looks that it will fit (how do you do that) and b) change the parameters of the distribution to fit as much with my data. How do you do that??\ I would like to thank you all for your help and contribution. Best Regards Alex
From: Peter Perkins on 22 Jun 2010 12:36 On 6/22/2010 11:42 AM, Alex wrote: > Hello I have plotted two different data sets. > http://yfrog.com/0afitdistributionforblueap > Blue and Red data sets For every different value on axis x I have taken > only 10 measurements as it takes so much time for the experiment to run. > I would like to fit two distributions for these two data sets. Looking at your picture, I don't think you do. I'm guessing you need to fit two regression curves. Take a look at this demo <http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/cfitdfitdemo.html> and see if it helps. Assuming you do want to fit regression curves, this demo might be helpful: <http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/wnlsdemo.html> > One for > each one. I do not know what function to use in matlab. If I got it > right I have to > a)pick one distribution that looks that it will fit (how do you do that) Noone can help you with that. They're your data. There may be a "standard method" in whatever application area you are working in. > and > b) change the parameters of the distribution to fit as much with my > data. How do you do that??\ Assuming you're fitting a regression curve, the usual method is by least squares. A function such as NLINFIT (Statistics Toolbox) or LSQCRVEFIT (Optimization Toolbox) is probably what you're looking for. Hope this helps.
From: Alex on 24 Jun 2010 02:34 I would like to thank you for your help. Yes you are right I would like to do regression analysis. So regarding my two plots (red and blue) http://yfrog.com/0afitdistributionforblueap what do I have to do? The link you gave me writes a few things about weights but I didnt get it. Best REgards Alex Peter Perkins <Peter.Perkins(a)MathRemoveThisWorks.com> wrote in message <hvqopq$jmh$1(a)fred.mathworks.com>... > On 6/22/2010 11:42 AM, Alex wrote: > > Hello I have plotted two different data sets. > > http://yfrog.com/0afitdistributionforblueap > > Blue and Red data sets For every different value on axis x I have taken > > only 10 measurements as it takes so much time for the experiment to run. > > I would like to fit two distributions for these two data sets. > > Looking at your picture, I don't think you do. I'm guessing you need to > fit two regression curves. Take a look at this demo > > <http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/cfitdfitdemo.html> > > and see if it helps. > > Assuming you do want to fit regression curves, this demo might be helpful: > > <http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/wnlsdemo.html> > > > One for > > each one. I do not know what function to use in matlab. If I got it > > right I have to > > a)pick one distribution that looks that it will fit (how do you do that) > > Noone can help you with that. They're your data. There may be a > "standard method" in whatever application area you are working in. > > > > and > > b) change the parameters of the distribution to fit as much with my > > data. How do you do that??\ > > Assuming you're fitting a regression curve, the usual method is by least > squares. A function such as NLINFIT (Statistics Toolbox) or LSQCRVEFIT > (Optimization Toolbox) is probably what you're looking for. > > Hope this helps.
From: Peter Perkins on 24 Jun 2010 13:08 On 6/24/2010 2:34 AM, Alex wrote: > > I would like to thank you for your help. > Yes you are right I would like to do regression analysis. > So regarding my two plots (red and blue) > http://yfrog.com/0afitdistributionforblueap > what do I have to do? The link you gave me writes a few things about > weights but I didnt get it. It appears that you have multiple y values measured at each x value. One way to fit that kind of data is to just list out all the separate observations. Another way is to take the mean at each x value, and use weights equal to the numer of observations at each x value. The second of the two links I posted demonstrates this. A function such as NLINFIT (Statistics Toolbox) or LSQCRVEFIT (Optimization Toolbox) is probably what you're looking for. But as I said, you are entirely on your own when picking a specific nonlinear model to fit to the data.
From: Alex on 27 Jun 2010 13:51
I would like to thank you again for the time you spend for me. It seems that I managed to do the regression analysis successfully http://yfrog.com/5cfittedpointsoftheexperip There are two points that seem to strange at 1.4 and 1.6 one for each line. I used the function (1+(1+exp(x-b(1)/b(2))) and matlab created a nice plot for me. :) I would like to ask you a) where there are these two strange points in my figure? b) is it possible to know exactly what are the values of b(1) and b(2)?. So to write down that the function is c) Is it possible to have two legends in my figure? As you can see there is only one :( I would like to thank you in advance for your help and cooperation Best Regards Alex. Peter Perkins <Peter.Perkins(a)MathRemoveThisWorks.com> wrote in message <i003el$23j$1(a)fred.mathworks.com>... > On 6/24/2010 2:34 AM, Alex wrote: > > > > I would like to thank you for your help. > > Yes you are right I would like to do regression analysis. > > So regarding my two plots (red and blue) > > http://yfrog.com/0afitdistributionforblueap > > what do I have to do? The link you gave me writes a few things about > > weights but I didnt get it. > > It appears that you have multiple y values measured at each x value. > One way to fit that kind of data is to just list out all the separate > observations. Another way is to take the mean at each x value, and use > weights equal to the numer of observations at each x value. The second > of the two links I posted demonstrates this. > > A function such as NLINFIT (Statistics Toolbox) or LSQCRVEFIT > (Optimization Toolbox) is probably what you're looking for. But as I > said, you are entirely on your own when picking a specific nonlinear > model to fit to the data. |