R/RcppExports.R

Defines functions mmsbm_fit alphaGrad alphaLBound getZ approxB

Documented in alphaGrad alphaLBound approxB getZ mmsbm_fit

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' @rdname auxfuns
approxB <- function(y, d_id, pi_mat, directed = TRUE) {
    .Call(`_NetMix_approxB`, y, d_id, pi_mat, directed)
}

#' @rdname auxfuns
getZ <- function(pi_mat) {
    .Call(`_NetMix_getZ`, pi_mat)
}

#' @rdname auxfuns
alphaLBound <- function(par, tot_nodes, c_t, x_t, s_mat, t_id, var_beta, mu_beta) {
    .Call(`_NetMix_alphaLBound`, par, tot_nodes, c_t, x_t, s_mat, t_id, var_beta, mu_beta)
}

#' @rdname auxfuns
alphaGrad <- function(par, tot_nodes, c_t, x_t, s_mat, t_id, var_beta, mu_beta) {
    .Call(`_NetMix_alphaGrad`, par, tot_nodes, c_t, x_t, s_mat, t_id, var_beta, mu_beta)
}

#' @name mmsbm_fit
#' @title Fitter Function for dynamic MMSBM Model
#' 
#' @description This is the interface to the C++ fitter for the dynamic mixed-membership
#' stochastic blockmodel for network regression.
#' 
#' @param z_t Numeric matrix; transpose of monadic design matrix. Should not include intercept row.
#' @param x_t Numeric matrix; transpose of dyadic design matrix.
#' @param y Numeric vector; vector of edge values. Must have same number of elements as \code{ncol(x_t)}
#' @param time_id_dyad Integer vector; zero-based time-period identifier for each dyad.
#' @param time_id_dyad Integer vector; zero-based time-period identifier for each node.
#' @param nodes_per_period Integer vector; total number of unique nodes observed in each time period.
#' @param node_id_dyad Integer matrix; zero-based sender and receiver identifier per dyad.
#' @param mu_b Numeric matrix; matrix of prior means for elements in blockmodel matrix.
#' @param var_b Numeric matrix; matrix of prior variances for elements in blockmodel matrix.
#' @param pi_init Numeric matrix; matrix of initial mixed-memberships. Nodes along columns.
#' @param kappa_init_t Numeric matrix; matrix of initial marginal HMM state probabilities. Time-periods along columns.
#' @param b_init_t Numeric matrix; square matrix of initial values of blockmodel.
#' @param beta_init Numeric vector; flat array (column-major order) of initial values of monadic coefficients.
#' @param gamma_init Numeric vector; vector of initial values of dyadic coefficients
#' @param control List; see the \code{mmsbm.control} argument of \code{\link{mmsbm}}
#' 
#' @return Unclassed list with named components; see \code{Value} of \code{\link{mmsbm}}
#' @section Warning:
#'          This function is for internal use only. End-users should always resort to \code{\link{mmsbm}}.
#'          In particular, that interface post-processes the return value of this internal in important ways. 
#'          
#' @author Santiago Olivella (olivella@@unc.edu), Adeline Lo (adelinel@@princeton.edu), Tyler Pratt (tyler.pratt@@yale.edu), Kosuke Imai (imai@@harvard.edu)
NULL

mmsbm_fit <- function(z_t, x_t, y, time_id_dyad, time_id_node, nodes_per_period, node_id_dyad, node_id_period, mu_b, var_b, mu_beta, var_beta, mu_gamma, var_gamma, pi_init, kappa_init_t, b_init_t, beta_init_r, gamma_init_r, control) {
    .Call(`_NetMix_mmsbm_fit`, z_t, x_t, y, time_id_dyad, time_id_node, nodes_per_period, node_id_dyad, node_id_period, mu_b, var_b, mu_beta, var_beta, mu_gamma, var_gamma, pi_init, kappa_init_t, b_init_t, beta_init_r, gamma_init_r, control)
}

Try the NetMix package in your browser

Any scripts or data that you put into this service are public.

NetMix documentation built on May 29, 2024, 6:39 a.m.