comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Histogram & Cumulative Distribution Functions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Histogram & Cumulative Distribution Functions [message #40759] Fri, 27 August 2004 03:56
sdj is currently offline  sdj
Messages: 20
Registered: November 2003
Junior Member
Dear All,

I have the following problem to address and I was wondering if
somebody could help me out:

I have a 1-D dataset which is "more or less" normally distributed. I
would like to fit a gaussian distribution to it, then calculate the
cumulative distribution function, and ultimately calculate the 95%
percentile.

The 1-D dataset represents sst values over 300 months.

The steps I would like to go through are the following:
i) Calculate the distribution function (histogram) of my original
dataset
i) Plot the resulting histogram of my original dataset ("SST Value" vs
"No. of Obs")
iii) Fit a Gaussian to the original dataset distribution function with
the original SST dataset Mean and Standard Deviation values.
iv) [O]Plot the resulting Gaussian distribution function.
v) Calculate the cumulative distribution function of the resulting
Gaussian distribution function.
vi) Plot the cumulative distribution function ("SST value" vs
"Percentage of Total Obs")
vii) Calculate the 95% percentile value: i.e. what is the Variable
Value within which 95% of the data is LE to.

I have tried playing around with the functions HISTOGRAM, HIST_EQUAL
and GAUSS (from the Johns Hopkins University/Applied Physics
Laboratory) functions, and I manage to get to step no. iv), but from
there on I cannot seem to progress. I have pasted the code to get to
step no. iv below.

Any suggestions ?

Thanks in advance for your help.

Regards,
Pepe


*************************************************
Pepe S. D. Juevara

- No debe cambiarse de caballo al cruzar el r�o -
*************************************************

;Steps i) to ii)
;Calculate the original histogram and plot the data
h=histogram(dataset, nbins=30, locations=l)
plot, l, h,spym=10

;Steps iii) to iv)
;Calculate the gaussian fit and oplot the data
fit=gauss(l, h)
oplot, l, fit

;Step v
;Calculate binstep size
bs = l[1]- l[0]
cdf=hist_equal(fit, binsize=bs,/histogram_only)
plot, l, cdf
;doesn't work !
[Message index]
 
Read Message
Previous Topic: learning to animate
Next Topic: Combinatorial

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Dec 03 11:38:29 PST 2025

Total time taken to generate the page: 0.14165 seconds