auxfuns: Internal functions and generics for 'mmsbm' package

approxBR Documentation

Internal functions and generics for mmsbm package

Description

These are various utilities and generic methods used by the main package function.

Usage

approxB(y, d_id, pi_mat, directed = TRUE)

getZ(pi_mat)

alphaLBound(par, tot_nodes, c_t, x_t, s_mat, t_id, var_beta, mu_beta)

alphaGrad(par, tot_nodes, c_t, x_t, s_mat, t_id, var_beta, mu_beta)

.cbind.fill(...)

.scaleVars(x, keep_const = TRUE)

.transf_muvar(orig, is_var, is_array, des.mat, nblock = NULL, nstate = NULL)

.bar.legend(colPalette, range)

.mpower(mat, p)

.findPerm(block_list, target_mat = NULL, use_perms = TRUE)

.transf(mat)

.compute.alpha(X, beta)

.vcovBeta(
  all_phi,
  beta_coef,
  n.sim,
  n.blk,
  n.hmm,
  n.nodes,
  n.periods,
  mu.beta,
  var.beta,
  est_kappa,
  t_id_n,
  X
)

.e.pi(alpha_list, kappa, C_mat = NULL)

.initPi(
  soc_mats,
  dyads,
  edges,
  nodes_pp,
  dyads_pp,
  n.blocks,
  periods,
  directed,
  ctrl
)

Arguments

y, d_id, pi_mat, directed

Internal arguments for blockmodel approximation.

par

Vector of parameter values.

tot_nodes

Integer vector; total number of nodes each node interacts with.

c_t

Integer matrix; samples from Poisson-Binomial counts of a node instantiating a group.

x_t

Numeric matrix; transposed monadic design matrices.

s_mat

Integer matrix; Samples of HMM states by time period.

t_id

Integer vector; for each node, what time-period is it observed in? zero-indexed.

mu_beta, var_beta

Numeric arrays; prior mean and variances of monadic coefficients.

...

Numeric vectors; vectors of potentially different length to be cbind-ed.

x, keep_const

Internal arguments for matrix scaling.

orig

Object to be transformed.

is_var

Boolean. Is the object to be transformed a variance term?

is_array

Boolean. Is the object to be transformed an array?

des.mat

Numeric matrix. Design matrix corresponding to transformed object.

nblock

Number of groups in model, defaults to NULL.

nstate

Number of hidden Markov states in model, defaults to NULL.

colPalette

A function produced by colorRamp.

range

The range of values to label the legend.

mat

Numeric matrix.

p

Numeric scalar; power to raise matrix to.

block_list

List of matrices; each element is a square, numeric matrix that defines a blockmodel,

target_mat

Numeric matrix; reference blockmodel that those in block_list should be aligned to. Optional, defaults to NULL.

use_perms

Boolean; should all row/column permutations be explored when realigning matrices? defaults to TRUE.

X

Numeric matrix; design matrix of monadic predictors.

beta

Numeric array; array of coefficients associated with monadic predictors. It of dimensions Nr. Predictors by Nr. of Blocks by Nr. of HMM states.

all_phi, beta_coef, n.sim, n.blk, n.hmm, n.nodes, n.periods, mu.beta, var.beta, est_kappa, t_id_n

Additional internal arguments for covariance estimation.

alpha_list

List of mixed-membership parameter matrices.

kappa

Numeric matrix; matrix of marginal HMM state probabilities.

C_mat

Numeric matrix; matrix of posterior counts of block instantiations per node.

soc_mats, dyads, edges, nodes_pp, dyads_pp, n.blocks, periods, ctrl

Internal arguments for MM computation.

Details

These functions are meant for internal use only.

Value

See individual return section for each function:

.cbind.fill

Matrix of cbind'ed elements in ..., with missing values in each vector filled with NA.

.mpower

Matrix; the result of raising mat to the p power.

.findPerm

List of permuted blockmodel matrices.

.transf

Matrix with transformed mixed-membership vectors along its rows, s.t. no element is equal to 0.0 or 1.0.

.compute.alpha

List of predicted alpha matrices, one element per HMM state.

.e.pi

Matrix of predicted mixed-membership vectors along its rows, with expectation computed over marginal distribution over HMM states for each time period.

.missing

Transformed data.frame with missing values list-wise deleted, or expanded with missing indicator variables.

.createSocioB

List of sociomatrices.

.vertboot2

List of bootstrapped sociomatrices.

Author(s)

Santiago Olivella (olivella@unc.edu), Adeline Lo (aylo@wisc.edu), Tyler Pratt (tyler.pratt@yale.edu), Kosuke Imai (imai@harvard.edu)


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