diff --git a/R/R6Class-BipartiteSBM_fit.R b/R/R6Class-BipartiteSBM_fit.R index 2efd79a..0c15dc1 100644 --- a/R/R6Class-BipartiteSBM_fit.R +++ b/R/R6Class-BipartiteSBM_fit.R @@ -67,16 +67,7 @@ BipartiteSBM_fit <- }, #' @description function to perform optimization #' @param estimOptions a list of parameters controlling the inference algorithm and model selection. See details. - #' @details The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters - #' \itemize{ - #' \item{"nbCores"}{integer for number of cores used. Default is 2} - #' \item{"verbosity"}{integer for verbosity (0, 1). Default is 1} - #' \item{"plot"}{boolean, should the ICL by dynamically plotted or not. Default is TRUE} - #' \item{"exploreFactor"}{control the exploration of the number of groups} - #' \item{"exploreMin"}{explore at least until exploreMin even if the exploration factor rule is achieved. Default 4. See the package blockmodels for details.} - #' \item{"exploreMin"}{Stop exploration at exploreMax even if the exploration factor rule is not achieved. Default Inf. See the package blockmodels for details.} - #' \item{"fast"}{logical: should approximation be used for Bernoulli model with covariates. Default to \code{TRUE}} - #' } + #' @inherit estimateSimpleSBM details optimize = function(estimOptions = list()){ if(private$model == 'ZIgaussian') stop("Inference not yet implemented for Bipartite ZI gaussian network") diff --git a/R/R6Class-MultipartiteSBM_fit.R b/R/R6Class-MultipartiteSBM_fit.R index 4ce2fdb..586fa51 100644 --- a/R/R6Class-MultipartiteSBM_fit.R +++ b/R/R6Class-MultipartiteSBM_fit.R @@ -103,15 +103,7 @@ MultipartiteSBM_fit <- }, #' @description estimation of multipartiteSBM via GREMLINS #' @param estimOptions options for MultipartiteBM - #' @details The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters - #' \itemize{ - #' \item{"nbCores"}{integer for number of cores used. Default is 2} - #' \item{"verbosity"}{integer for verbosity (0, 1). Default is 1} - #' \item{"nbBlocksRange"}{List of length the number of functional groups, each element supplying the minimal and maximal number of blocks to be explored. The names of the list must be the names of the functional groups. Default value is from 1 to 10)} - #' \item{"initBM"}{Boolean. True if using simple and bipartite SBM as initialisations. Default value = TRUE} - #' \item{"maxiterVEM"}{Number of max. number of iterations in the VEM. Default value = 100} - #' \item{"maxiterVE"}{Number of max. number of iterations in the VE. Default value = 100} - #'} + #' @inherit estimateSimpleSBM details optimize = function(estimOptions) { currentOptions <- list( diff --git a/R/R6Class-MultiplexSBM_fit.R b/R/R6Class-MultiplexSBM_fit.R index d5b54d5..575bba8 100644 --- a/R/R6Class-MultiplexSBM_fit.R +++ b/R/R6Class-MultiplexSBM_fit.R @@ -75,14 +75,12 @@ MultiplexSBM_fit <- #' @description estimation of multipartiteSBM via GREMLINS #' @param estimOptions options for MultipartiteBM #' @details The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters - #' \itemize{ - #' \item{"nbCores"}{integer for number of cores used. Default is 2} - #' \item{"verbosity"}{integer for verbosity (0, 1). Default is 1} - #' \item{"nbBlocksRange"}{List of length the number of functional groups, each element supplying the minimal and maximal number of blocks to be explored. The names of the list must be the names of the functional groups. Default value is from 1 to 10)} - #' \item{"initBM"}{Boolean. True if using simple and bipartite SBM as initialisations. Default value = TRUE} - #' \item{"maxiterVEM"}{Number of max. number of iterations in the VEM. Default value = 100} - #' \item{"maxiterVE"}{Number of max. number of iterations in the VE. Default value = 100} - #'} + #' * "nbCores" integer for number of cores used. Default is 2 + #' * "verbosity" integer for verbosity (0, 1). Default is 1 + #' * "nbBlocksRange" List of length the number of functional groups, each element supplying the minimal and maximal number of blocks to be explored. The names of the list must be the names of the functional groups. Default value is from 1 to 10) + #' * "initBM" Boolean. True if using simple and bipartite SBM as initialisations. Default value = TRUE + #' * "maxiterVEM" Number of max. number of iterations in the VEM. Default value = 100 + #' * "maxiterVE" Number of max. number of iterations in the VE. Default value = 100 optimize = function(estimOptions) { if (self$dependentNetwork == FALSE) { diff --git a/R/R6Class-SBM.R b/R/R6Class-SBM.R index 384ac56..2af8621 100644 --- a/R/R6Class-SBM.R +++ b/R/R6Class-SBM.R @@ -200,7 +200,7 @@ predict.SBM <- function(object, covarList = object$covarList, theta_p0 = 0, ...) #' @param plotOptions list with parameters for 'meso' type plot and data type plot. Details are given below #' @param ... additional parameters for S3 compatibility. Not used #' @details The list of parameters \code{plotOptions} for the mesoscopic plot is: -#' \itemize{ +#' \describe{ #' \item{"seed": }{seed to control the layout} #' \item{"title": }{character string for the title. Default value is NULL} #' \item{"layout": }{Default value = NULL} @@ -224,7 +224,7 @@ predict.SBM <- function(object, covarList = object$covarList, theta_p0 = 0, ...) #' \item{"edge.curved": }{Default value is = 0.3.} #' } #' For type = 'data' or 'expected plot', the list of parameters \code{plotOptions} is -#' \itemize{ +#' \describe{ #' \item{"legend": }{Boolean. Set TRUE if you want to see the legend. Default value is FALSE} #' \item{"legend.title":}{Boolean. Set TRUE if you want to print the title of the legend. Default value is FALSE} #' \item{"legend.position":}{Position of the legend. Possible values are 'bottom', 'top','left,'right'. Default value is 'bottom'} diff --git a/R/R6Class-SimpleSBM_fit.R b/R/R6Class-SimpleSBM_fit.R index 44e22fd..c8e678c 100644 --- a/R/R6Class-SimpleSBM_fit.R +++ b/R/R6Class-SimpleSBM_fit.R @@ -68,17 +68,7 @@ SimpleSBM_fit <- #-------------------------------------------- #' @description function to perform optimization #' @param estimOptions a list of parameters controlling the inference algorithm and model selection. See details. - #' - #' @details The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters - #' \itemize{ - #' \item{"nbCores"}{integer for number of cores used. Default is 2} - #' \item{"verbosity"}{integer for verbosity (0, 1). Default is 1} - #' \item{"plot"}{boolean, should the ICL by dynamically plotted or not. Default is TRUE} - #' \item{"exploreFactor"}{control the exploration of the number of groups} - #' \item{"exploreMin"}{explore at least until exploreMin even if the exploration factor rule is achieved. Default 4. See the package blockmodels for details.} - #' \item{"exploreMin"}{Stop exploration at exploreMax even if the exploration factor rule is not achieved. Default Inf. See the package blockmodels for details.} - #' \item{"fast"}{logical: should approximation be used for Bernoulli model with covariates. Default to \code{TRUE}} - #' } + #' @inherit estimateSimpleSBM details optimize = function(estimOptions = list()){ if(private$model == 'ZIgaussian') stop("Inference not yet implemented for ZI gaussian network") diff --git a/R/estimate.R b/R/estimate.R index 74c7c77..87219c9 100644 --- a/R/estimate.R +++ b/R/estimate.R @@ -130,7 +130,7 @@ estimateSimpleSBM <- function(netMat, #' @param covariates a list of matrices with same dimension as mat describing covariates at the edge level. No covariate per Default. #' @param estimOptions a list of parameters controlling the inference algorithm and model selection. See details. #' -#' @inheritSection estimateSimpleSBM details +#' @inherit estimateSimpleSBM details #' #' @return a list with the estimated parameters. See details... #' diff --git a/man/BipartiteSBM_fit.Rd b/man/BipartiteSBM_fit.Rd index 0be82c2..d9bc366 100644 --- a/man/BipartiteSBM_fit.Rd +++ b/man/BipartiteSBM_fit.Rd @@ -10,17 +10,6 @@ R6 Class definition of an Bipartite SBM fit } \details{ This class is designed to give a representation and adjust an LBM fitted with blockmodels. - -The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters -\itemize{ -\item{"nbCores"}{integer for number of cores used. Default is 2} -\item{"verbosity"}{integer for verbosity (0, 1). Default is 1} -\item{"plot"}{boolean, should the ICL by dynamically plotted or not. Default is TRUE} -\item{"exploreFactor"}{control the exploration of the number of groups} -\item{"exploreMin"}{explore at least until exploreMin even if the exploration factor rule is achieved. Default 4. See the package blockmodels for details.} -\item{"exploreMin"}{Stop exploration at exploreMax even if the exploration factor rule is not achieved. Default Inf. See the package blockmodels for details.} -\item{"fast"}{logical: should approximation be used for Bernoulli model with covariates. Default to \code{TRUE}} -} } \section{Super classes}{ \code{\link[sbm:SBM]{sbm::SBM}} -> \code{\link[sbm:BipartiteSBM]{sbm::BipartiteSBM}} -> \code{BipartiteSBM_fit} diff --git a/man/MultipartiteSBM_fit.Rd b/man/MultipartiteSBM_fit.Rd index 811f6ac..27d47c1 100644 --- a/man/MultipartiteSBM_fit.Rd +++ b/man/MultipartiteSBM_fit.Rd @@ -10,16 +10,6 @@ R6 Class definition of a Multipartite SBM fit } \details{ This class is designed to give a representation and adjust a Multipartite SBM fitted with GREMLIN. - -The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters -\itemize{ -\item{"nbCores"}{integer for number of cores used. Default is 2} -\item{"verbosity"}{integer for verbosity (0, 1). Default is 1} -\item{"nbBlocksRange"}{List of length the number of functional groups, each element supplying the minimal and maximal number of blocks to be explored. The names of the list must be the names of the functional groups. Default value is from 1 to 10)} -\item{"initBM"}{Boolean. True if using simple and bipartite SBM as initialisations. Default value = TRUE} -\item{"maxiterVEM"}{Number of max. number of iterations in the VEM. Default value = 100} -\item{"maxiterVE"}{Number of max. number of iterations in the VE. Default value = 100} -} } \section{Super classes}{ \code{\link[sbm:SBM]{sbm::SBM}} -> \code{\link[sbm:MultipartiteSBM]{sbm::MultipartiteSBM}} -> \code{MultipartiteSBM_fit} diff --git a/man/MultiplexSBM_fit.Rd b/man/MultiplexSBM_fit.Rd index de0a5bf..5807089 100644 --- a/man/MultiplexSBM_fit.Rd +++ b/man/MultiplexSBM_fit.Rd @@ -13,12 +13,12 @@ This class is designed to give a representation and adjust a Multiplex SBM fitte The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters \itemize{ -\item{"nbCores"}{integer for number of cores used. Default is 2} -\item{"verbosity"}{integer for verbosity (0, 1). Default is 1} -\item{"nbBlocksRange"}{List of length the number of functional groups, each element supplying the minimal and maximal number of blocks to be explored. The names of the list must be the names of the functional groups. Default value is from 1 to 10)} -\item{"initBM"}{Boolean. True if using simple and bipartite SBM as initialisations. Default value = TRUE} -\item{"maxiterVEM"}{Number of max. number of iterations in the VEM. Default value = 100} -\item{"maxiterVE"}{Number of max. number of iterations in the VE. Default value = 100} +\item "nbCores" integer for number of cores used. Default is 2 +\item "verbosity" integer for verbosity (0, 1). Default is 1 +\item "nbBlocksRange" List of length the number of functional groups, each element supplying the minimal and maximal number of blocks to be explored. The names of the list must be the names of the functional groups. Default value is from 1 to 10) +\item "initBM" Boolean. True if using simple and bipartite SBM as initialisations. Default value = TRUE +\item "maxiterVEM" Number of max. number of iterations in the VEM. Default value = 100 +\item "maxiterVE" Number of max. number of iterations in the VE. Default value = 100 } } \section{Super classes}{ diff --git a/man/SimpleSBM_fit.Rd b/man/SimpleSBM_fit.Rd index 19e8433..7c6a32a 100644 --- a/man/SimpleSBM_fit.Rd +++ b/man/SimpleSBM_fit.Rd @@ -10,17 +10,6 @@ R6 Class definition of a Simple SBM fit } \details{ This class is designed to give a representation and adjust an SBM fitted with blockmodels. - -The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters -\itemize{ -\item{"nbCores"}{integer for number of cores used. Default is 2} -\item{"verbosity"}{integer for verbosity (0, 1). Default is 1} -\item{"plot"}{boolean, should the ICL by dynamically plotted or not. Default is TRUE} -\item{"exploreFactor"}{control the exploration of the number of groups} -\item{"exploreMin"}{explore at least until exploreMin even if the exploration factor rule is achieved. Default 4. See the package blockmodels for details.} -\item{"exploreMin"}{Stop exploration at exploreMax even if the exploration factor rule is not achieved. Default Inf. See the package blockmodels for details.} -\item{"fast"}{logical: should approximation be used for Bernoulli model with covariates. Default to \code{TRUE}} -} } \section{Super classes}{ \code{\link[sbm:SBM]{sbm::SBM}} -> \code{\link[sbm:SimpleSBM]{sbm::SimpleSBM}} -> \code{SimpleSBM_fit} diff --git a/man/estimateBipartiteSBM.Rd b/man/estimateBipartiteSBM.Rd index 3b17778..22f7d76 100644 --- a/man/estimateBipartiteSBM.Rd +++ b/man/estimateBipartiteSBM.Rd @@ -30,6 +30,19 @@ a list with the estimated parameters. See details... This function performs variational inference of bipartite Stochastic Block Models, with various model for the distribution of the edges: Bernoulli, Poisson, or Gaussian models. } +\details{ +The list of parameters \code{estimOptions} essentially tunes the optimization process and the variational EM algorithm, with the following parameters +\itemize{ +\item "nbCores integer for number of cores used. Default is 2 +\item "verbosity" integer for verbosity (0, 1). Default is 1 +\item "plot" boolean, should the ICL by dynamically plotted or not. Default is TRUE +\item "exploreFactor" control the exploration of the number of groups +\item "exploreMin" explore at least until exploreMin even if the exploration factor rule is achieved. Default 4. See the package blockmodels for details. +\item "exploreMax" Stop exploration at exploreMax even if the exploration factor rule is not achieved. Default Inf. See the package blockmodels for details. +\item "nbBlocksRange" minimal and maximal number or blocks explored +\item "fast" logical: should approximation be used for Bernoulli model with covariates. Default to \code{TRUE} +} +} \examples{ ### ======================================= ### BIPARTITE BINARY SBM (Bernoulli model) diff --git a/man/plot.SBM.Rd b/man/plot.SBM.Rd index b765b48..d4a9952 100644 --- a/man/plot.SBM.Rd +++ b/man/plot.SBM.Rd @@ -31,7 +31,7 @@ Basic matrix plot method for SBM object or mesoscopic view } \details{ The list of parameters \code{plotOptions} for the mesoscopic plot is: -\itemize{ +\describe{ \item{"seed": }{seed to control the layout} \item{"title": }{character string for the title. Default value is NULL} \item{"layout": }{Default value = NULL} @@ -55,7 +55,7 @@ The list of parameters \code{plotOptions} for the mesoscopic plot is: \item{"edge.curved": }{Default value is = 0.3.} } For type = 'data' or 'expected plot', the list of parameters \code{plotOptions} is -\itemize{ +\describe{ \item{"legend": }{Boolean. Set TRUE if you want to see the legend. Default value is FALSE} \item{"legend.title":}{Boolean. Set TRUE if you want to print the title of the legend. Default value is FALSE} \item{"legend.position":}{Position of the legend. Possible values are 'bottom', 'top','left,'right'. Default value is 'bottom'}