[Thread Prev][Thread Next][Index]

Re: [ferret_users] Re: prob density function



Hi Paul
First about your question about the underlying grid of the data. That does not matter. In fact the example at the start of the script uses a dataset with no time axis at all. Inside the script

yes? go/help histogram_pdf

we can see that the script simply collects all of the data in the given region into a big list using the XSEQUENCE function, and sorts it. Now the data is just in a list x=1,2,3,4, sorted lowest to highest.  Then it counts the number of values in each of a set of bins. The bins are set arbitrarily in the script as 10 counts wide each.

This is definitely a script to make a copy of and change yourself, as suggested by some of the comments in the script, changing the lines
LET hpdf = 10/((hval[i=@shf:+5]-hval[i=@shf:-5])*hcount[x=@max])
and
LET/TITLE="Probability Density Function" vval = hpdf[i=@sbx:11]

I don't think this script will give you what you're describing. Maybe combining the variables this script defines with one of the bar_chart scripts would come closer.


On 2/20/2014 10:18 AM, Paul Goddard wrote:
Sorry to bother again.  After looking through the script, I have some more questions. attached is a file containing minimal daily temperatures for 20 years from a model output. I would like to create a PDF plot with the x-axis being Temperature and the Y-axis being the probability. When I run the go histogram_pdf command on my data, the output is a scatter plot of points, the x-axis is temperature, and the y-axis is hpdf.

A few questions.  I was hoping to make a PDF where the display is a line graph, and the area under the curve equals one.  Is this possible with this script? And if so, do I make modifications to delta i, or @sbx, .. etc? 

Thank you for your help.  I attached the data set and a pdf of the PDF using the go histogram_pdf command with default settings.

Paul


On Wed, Feb 19, 2014 at 2:05 PM, Paul Goddard <goddarpb@xxxxxxxxx> wrote:
Hello,

I have a large dataset of 20 years of daily data (7300 values) for the variable temperature.  I would like to calculate the probability density function for a temperature on any given day. I used the histogram_pdf.jnl file; though it looks like this program was written for data with monthly time steps... perhaps I am wrong.  I am wondering what changes I need to make to the script to ensure my results are valid.

Thanks in advance!

Paul



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement