[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: unnormalized covariances
From: |
John Darrington |
Subject: |
Re: unnormalized covariances |
Date: |
Sat, 6 Mar 2010 20:34:39 +0000 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Thu, Mar 04, 2010 at 05:37:47PM -0500, Jason Stover wrote:
I need to use the "un-normalized" covariances for the
regression, meaning just dot products, not divided by
sample sizes. Does anyone mind if I add the following functions
to covariance.c?
static const gsl_matrix *
covariance_calculate_double_pass_unnormalized (struct covariance *cov)
{
size_t i, j;
for (i = 0 ; i < cov->dim; ++i)
{
for (j = 0 ; j < cov->dim; ++j)
{
int idx;
double *x = gsl_matrix_ptr (cov->moments[MOMENT_VARIANCE], i, j);
idx = cm_idx (cov, i, j);
if ( idx >= 0)
{
x = &cov->cm [idx];
}
}
}
So far as I can see, this code has no effect.
We need to be very clear about what exactly the function
const gsl_matrix *covariance_moments (const struct covariance *cov, int m);
is returning. Otherwise a lot of other things will break.
Perhaps we should have a different function to return non-normalised moments.
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.
signature.asc
Description: Digital signature