Hello. I was hoping that someone could help me with probability distribution functions (pdf) and Igor. I have a collection of data where I would like to create a pdf for the instances at different concentrations. I have found the function StatsLogNormalPDF, but that seems to just create a pdf once you already know all the fit parameters and such. However I need to create/fit a pdf from data, preferably of a few different types to test their applicability.
Does anyone know how/if Igor can do this? Am I just missing something?
It sounds as if you need to look at the Histogram operation. In particular, the /P flag normalizes the output as a pdf. For example, suppose you have data that looks like:
Make/O/N=10000 myWave=gnoise(10)
Start by creating an output wave:
Make/o pdfWave
Run the histogram:
Histogram/B=4/P myWave,pdfWave
Display pdfWave
In this case, the input was a Gaussian distribution so you can, if you wish, fit the result to a Gaussian. To do that execute:
It seems that one aspect of your question has not been covered in the previous discussion. AG has shown how to create an empirical probability density function from a Histogram (and also thereby a cumulative distribution function). But you also mention a key phrase :"....a few different types to test their applicability." It seems to me that the next step is to do a goodness-of-fit test against your models, such as by Fisher's chi-squared test. As usual, there is an Igor operation for that:
You would use the built in stats function in your own function (or from the command line) as
make/O pdfwave
pdfwave = StatsRayleighPDF(mywave)
Where mywave is your data wave to transform and pdfwave is the output wave. StatsRaleighPDF takes two optional parameters, which I've left out here. You should read up on the function in the on line manual for more details.
It sounds as if you need to look at the Histogram operation. In particular, the /P flag normalizes the output as a pdf. For example, suppose you have data that looks like:
Make/O/N=10000 myWave=gnoise(10)
Start by creating an output wave:
Make/o pdfWave
Run the histogram:
Histogram/B=4/P myWave,pdfWave
Display pdfWave
In this case, the input was a Gaussian distribution so you can, if you wish, fit the result to a Gaussian. To do that execute:
CurveFit/M=2/W=0 gauss, pdfWave/D
I hope this helps,
A.G.
WaveMetrics, Inc.
February 13, 2012 at 09:35 am - Permalink
Becky
February 14, 2012 at 01:33 am - Permalink
I'm struggling with a similar problem:
I wanna apply/plot a Rayleigh distribution to a wave (It's wind speed per hour).
So I found
StatsRayleighPDF
but I really don't know how to use that....Tried to do something like this, but it's obviously wrong:
Make/N=37/O test;DelayUpdate
Display test
return
Could you give me an example, how to use those PDF ?
Thanks
Dave
October 20, 2015 at 01:33 am - Permalink
It seems that one aspect of your question has not been covered in the previous discussion. AG has shown how to create an empirical probability density function from a Histogram (and also thereby a cumulative distribution function). But you also mention a key phrase :"....a few different types to test their applicability." It seems to me that the next step is to do a goodness-of-fit test against your models, such as by Fisher's chi-squared test. As usual, there is an Igor operation for that:
October 20, 2015 at 03:22 am - Permalink
You would use the built in stats function in your own function (or from the command line) as
pdfwave = StatsRayleighPDF(mywave)
Where mywave is your data wave to transform and pdfwave is the output wave. StatsRaleighPDF takes two optional parameters, which I've left out here. You should read up on the function in the on line manual for more details.
October 20, 2015 at 05:20 am - Permalink