Almost first draft for optim with W (still Compute_Omega to write)
[morpheus.git] / pkg / src / functions.c
index 0d632d3..41065bd 100644 (file)
@@ -53,3 +53,18 @@ void Moments_M3(double* X, double* Y, int* pn, int* pd, double* M3)
                }
        }
 }
+
+void Compute_Omega(double* X, double* Y, double* M, int* pn, int* pd, double* W)
+{
+       int n=*pn, d=*pd;
+  //double* W = (double*)calloc(d+d*d+d*d*d,sizeof(double));
+
+  // TODO: formula 1/N sum( t(g(Zi,theta)) g(Zi,theta) )
+  // = 1/N sum( t( (XiYi-...) - M[i] ) ( ... ) )
+  // --> similar to Moments_M2 and M3 above
+  for (int j=0; j<
+  for (int i=0; i<n; i++)
+  {
+    W[] += 
+  }
+}