X-Git-Url: https://git.auder.net/?p=morpheus.git;a=blobdiff_plain;f=pkg%2Fsrc%2Ffunctions.c;h=f251eb349fe2be411b05273753ea0b7ebc617ab2;hp=e534c57200a1e1c0843f8a335a71bf6b395c02f7;hb=9a6881ed8a16c31a3dbe995e3b1af76c1db6b5a0;hpb=6dd5c2acccd10635449230faa824b7e8906911bf diff --git a/pkg/src/functions.c b/pkg/src/functions.c index e534c57..f251eb3 100644 --- a/pkg/src/functions.c +++ b/pkg/src/functions.c @@ -54,6 +54,8 @@ void Moments_M3(double* X, double* Y, int* pn, int* pd, double* M3) } } +#include + // W = 1/N sum( t(g(Zi,theta)) g(Zi,theta) ) // with g(Zi, theta) = i-th contribution to all moments (size dim) - real moments void Compute_Omega(double* X, double* Y, double* M, int* pn, int* pd, double* W) @@ -97,6 +99,8 @@ void Compute_Omega(double* X, double* Y, double* M, int* pn, int* pd, double* W) g[j] -= Y[i] * X[mi(i,idx1,n,d)]; g[j] += Y[i] * X[mi(i,idx1,n,d)]*X[mi(i,idx2,n,d)]*X[mi(i,idx3,n,d)] - M[j]; } + + // TODO: 1/n des gj empirique doit tendre vers 0 // Add 1/n t(gi) %*% gi to W for (int j=0; j