X-Git-Url: https://git.auder.net/?p=morpheus.git;a=blobdiff_plain;f=pkg%2FR%2Futils.R;h=6d1c36161204b25db17c2c237bcfb77b62ba3556;hp=6ac9beca5911aa52cef7ab9ac465d061d3ba0b04;hb=d08fef424150599b8095727c0f9870ca9535fb65;hpb=7737c2fa8362b2bf590c2e2f9dcbd75424c51271 diff --git a/pkg/R/utils.R b/pkg/R/utils.R index 6ac9bec..6d1c361 100644 --- a/pkg/R/utils.R +++ b/pkg/R/utils.R @@ -74,23 +74,6 @@ normalize = function(X) computeMoments = function(X, Y) list( colMeans(Y * X), .Moments_M2(X,Y), .Moments_M3(X,Y) ) -# Computes the Omega matrix for generalized least square method -# -# @param X matrix of covariates (of size n*d) -# @param Y vector of responses (of size n) -# @param theta list with p, beta, b -# -# @return Matrix of size dimxdim where dim=d+d^2+d^3 -# -.Moments_M3 = function(X, Y) -{ - n = nrow(X) - d = ncol(X) - M3 = array(0,dim=c(d,d,d)) - array( .C("Moments_M3", X=as.double(X), Y=as.double(Y), pn=as.integer(n), - pd=as.integer(d), M3=as.double(M3), PACKAGE="morpheus")$M3, dim=c(d,d,d) ) -} - # Find the optimal assignment (permutation) between two sets (minimize cost) # # @param distances The distances matrix, in columns (distances[i,j] is distance between i