help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Statistics of a histogram


From: Carlo de Falco
Subject: Re: Statistics of a histogram
Date: Fri, 30 Jan 2009 18:57:51 +0000


On 30 Jan 2009, at 18:44, Shaun Jackman wrote:

Hi,

I have a matrix representing samples of data [x n] meaning that x(i)
was observed n(i) times. Are there functions to calculate the
statistics of observations in this format? I can calculate the mean
easily enough:
sum(x .* n) / sum(n)

How do find the pth percentile?

assuming

a = [ x1,n1; x2,n2; ... ];

I beleive you could do something like:

nn = cumsum(a(:,2));
nn /= nn(end);
xp = max( a(nn<p/100,1) )

but I'm sure there is some octave-forge function to do this, have you looked at the statistics package?

Cheers,
Shaun

c.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]