help-octave
[Top][All Lists]
Advanced

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

Working with histogram data


From: Shaun Jackman
Subject: Working with histogram data
Date: Mon, 4 Jan 2010 10:53:07 -0800

How can I use functions that expect a set of samples with data in the
form of a histogram? I have vectors x and n (the observation x was seen
n times; x is integer), and I'd like to calculate the mean and standard
deviation (for example). My best idea so far is to write a function
unhistogram like so:

samples = unhistogram(x, n);
mean(samples)
std(samples)

For this limited example it would be easy enough to write forms of mean
and std that take histograms rather than samples, but I'd like to be
able to use the gamut of stock functions that expect a set of
observations.

Thanks,
Shaun




reply via email to

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