Jason Stover <[EMAIL PROTECTED]> writes:

> On Wed, Mar 21, 2007 at 01:20:05PM -0700, Ben Pfaff wrote:
>> > Second question: moments.c could also be made to compute correlations
>> > between variables in a single data pass. If changing it to do so
>> > doesn't make a mess of moments.c, does anyone mind if I make that
>> > modification, too?
>> 
>> Is there a logical or computational reason why correlations
>> should be integrated into moments instead of being a separate
>> module?
>
> Computing correlations, means and variances at the same time would
> eleminate at least one data pass. But computing them at the same time
> also would introduce a structure (or matrix) in the moments struct to
> store the correlations for each pair of variables. I don't know if the
> added complexity would be worth the benefit of eleminating data
> passes.
>
> If moments.c doesn't have a way to compute correlations, then to avoid
> the extra data passes, any procedure that needs correlations will have
> to compute them on its own.

I don't want to introduce any more data passes than necessary,
either, but I don't understand why integrating correlations into
moments would make a difference.

If correlations and moments are separate, you can compute them in
a single pass like this:

        for each case C do:
            moments1_add(C)
            correlations_add(C)

If correlations and moments are merged, you can compute them in a
single pass like this:

        for each case C do:
            moments_and_correlations_add(C)

Is there some underlying issue that I don't understand?
-- 
Ben Pfaff 
http://benpfaff.org


_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to