After merge
authorBenjamin Auder <benjamin.auder@somewhere>
Mon, 9 Jul 2018 19:04:33 +0000 (21:04 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Mon, 9 Jul 2018 19:04:33 +0000 (21:04 +0200)
pkg/DESCRIPTION
pkg/R/multiRun.R
pkg/R/plot.R
pkg/src/morpheus_init.c [new file with mode: 0644]

index e1050a3..3872e96 100644 (file)
@@ -1,13 +1,15 @@
 Package: morpheus
 Title: Estimate Parameters of Mixtures of Logistic Regressions
-Description: Mixture of lOgistic Regressions Parameters (H)Estimation with
-    (U)Spectral methods. The main methods take d-dimensional inputs and a vector
+Description: Mixture of logistic regressions parameters (H)estimation with
+    (U)spectral methods. The main methods take d-dimensional inputs and a vector
     of binary outputs, and return parameters according to the GLMs mixture model
-    (please refer to the package vignette).
+    (General Linear Model). For more details see chapter 3 in the PhD thesis of
+               Mor-Absa Loum: <http://www.theses.fr/s156435>, available here
+               <https://www.math.u-psud.fr/~loum/IMG/pdf/these.compressed-2.pdf>.
 Version: 0.2-0
-Author: Benjamin Auder <Benjamin.Auder@math.u-psud.fr> [aut,cre],
-    Mor-Absa Loum <Mor-Absa.Loum@math.u-psud.fr> [aut]
-Maintainer: Benjamin Auder <Benjamin.Auder@math.u-psud.fr>
+Author: Benjamin Auder <Benjamin.Auder@u-psud.fr> [aut,cre],
+    Mor-Absa Loum <Mor-Absa.Loum@u-psud.fr> [aut]
+Maintainer: Benjamin Auder <Benjamin.Auder@u-psud.fr>
 Depends:
     R (>= 3.0.0),
 Imports:
index 1cebaab..fefdd34 100644 (file)
@@ -17,7 +17,7 @@
 #' @return A list of nf aggregates of N results (matrices).
 #'
 #' @examples
-#' \dontrun{
+#' \donttest{
 #' β <- matrix(c(1,-2,3,1),ncol=2)
 #'
 #' # Bootstrap + computeMu, morpheus VS flexmix ; assumes fargs first 3 elts X,Y,K
index 265f1cd..614f5c5 100644 (file)
@@ -21,7 +21,7 @@ extractParam <- function(mr, x=1, y=1)
 #' @param y Column index of the element inside the aggregated parameter
 #'
 #' @examples
-#' \dontrun{
+#' \donttest{
 #' β <- matrix(c(1,-2,3,1),ncol=2)
 #' mr <- multiRun(...) #see bootstrap example in ?multiRun : return lists of mu_hat
 #' μ <- normalize(β)
@@ -104,7 +104,7 @@ plotCoefs <- function(mr, params)
                avg_param <- as.double(params_hat[[i]])
                std_param <- as.double(stdev[[i]])
                matplot(cbind(params[o],avg_param[o],avg_param[o]+std_param[o],avg_param[o]-std_param[o]),
-                       col=c(2,1,1,1), lty=c(1,1,2,2), type="l", lwd=2, xlab="param", ylab="value")
+                       col=1, lty=c(1,5,2,2), type="l", lwd=2, xlab="param", ylab="value")
        }
 
        #print(o) #not returning o to avoid weird Jupyter issue... (TODO:)
diff --git a/pkg/src/morpheus_init.c b/pkg/src/morpheus_init.c
new file mode 100644 (file)
index 0000000..0777777
--- /dev/null
@@ -0,0 +1,25 @@
+#include <stdlib.h> // for NULL
+#include <R_ext/Rdynload.h>
+
+/* FIXME: 
+   Check these declarations against the C/Fortran source code.
+*/
+
+/* .C calls */
+extern void hungarianAlgorithm(void *, void *, void *);
+extern void Moments_M2(void *, void *, void *, void *, void *);
+extern void Moments_M3(void *, void *, void *, void *, void *);
+
+static const R_CMethodDef CEntries[] = {
+    {"hungarianAlgorithm", (DL_FUNC) &hungarianAlgorithm, 3},
+    {"Moments_M2",         (DL_FUNC) &Moments_M2,         5},
+    {"Moments_M3",         (DL_FUNC) &Moments_M3,         5},
+    {NULL, NULL, 0}
+};
+
+void R_init_morpheus(DllInfo *dll)
+{
+    R_registerRoutines(dll, CEntries, NULL, NULL, NULL);
+    R_useDynamicSymbols(dll, FALSE);
+}
+