This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: gsl_histogram_sum proposal
The "stat" functions should operate on the histogram as a whole in my
opinion. In general the user should not need to deal with bin
numbers, they are not very meaningful.
The 2d stat functions are missing for the normal reason -- lack of
time.
Achim Gaedke writes:
> Hmmm.... Gerald, you are right. But I don't like two things:
> 1) A lot of functions doing almost the same
> 2) One function doing everything with a lot of parameters
>
> For 1d it is acceptable to do only this, but what about 2d?
>
> gsl_histogram2d_sum(gsl_histogram2d * h, size_t m_begin, size_t m_end,
> size_t n_begin, size_t n_end)
>
> Due to five parameters, I liked to implement my simple proposal, too. I think,
> this is maximum satifying. What is best depends on your fancy...
>
> Another question is, why are gsl_histogram2d_mean and gsl_histogram2d_sigma not
> implemented? Is it possible to do that by assuming a bivariate normal
> distribution?
> That are 2 results for mean (1st moment) and 4 (?!) results for sigma (2nd
> moment), but here my ad hoc knowledge ends...
>
>
> Gerard Jungman wrote:
> >
> > I have a trivial comment. But, after all, my forte is trivial
> > interface issues. It would probably be better to have something
> > like the following.
> >
> > double
> > gsl_histogram_sum(gsl_histogram * h, size_t i_begin, size_t i_end)
> > {
> > double sum = 0;
> > size_t i;
> >
> > i_begin = ( i_begin > h->n ? h->n : i_begin );
> > i_end = ( i_end > h->n ? h->n : i_end );
> >
> > for (i = i_begin; i < i_end; i++)
> > {
> > sum += h->bin[i];
> > }
> >
> > return sum;
> > }
> >
> > Once the desire comes to sum from 0 to n, the desire
> > to sum with arbitrary limits will surefly follow.
> >
> > --
> > G. Jungman
>
>