Boost logo

Boost Users :

Subject: Re: [Boost-users] Histogram
From: Arman Khalatyan (arm2arm_at_[hidden])
Date: 2010-04-28 11:20:27


Hi,
you can use http://www.codeproject.com/KB/recipes/zigurat.aspx example

or read the BOOST manual on accumulators.
typedef accumulator_set<double,
stats<boost::accumulators::tag::tail_quantile<left> > > accumulator_t_left;
typedef accumulator_set<double,
stats<boost::accumulators::tag::tail_quantile<right> > >
accumulator_t_right;

accumulator_t_right acc0( boost::accumulators::tag::tail<right>::cache_size
= c );
{
// here push your data in to acc0
acc0(r);
}
get the quantile or whatever:
double tqueryP=quantile(acc0, quantile_probability = 0.50 );

cheers Arman.

On Wed, Apr 28, 2010 at 3:54 PM, David Doria <daviddoria_at_[hidden]> wrote:

> On Tue, Apr 27, 2010 at 4:19 PM, David Doria <daviddoria_at_[hidden]> wrote:
> > Does boost have a way to make a histogram of a vector?
> >
> > I want to be able to do queries such as:
> >
> > "Which numbers are in the 90th percentile?"
> >
> > Thanks,
> >
> > David
> >
>
> Maybe a better explanation is I want a c++ function that will do what
> the Matlab hist() function does:
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/hist.html
>
> Thanks,
>
> David
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

-- 
------------------------------------------
Dr Arman Khalatyan,
Observatoire Astronomique de Marseille-Provence
Laboratoire d'Astrophysique de Marseille
-----------------------------------------


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net