Learn R Programming

NetMix (version 0.1.5)

approxB: 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)

getZ(pi_mat)

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

.cbind.fill(...)

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

.bar.legend(colPalette, range)

.mpower(mat, p)

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

.transf(mat)

.pi.hat(X, beta)

.e.pi(pi_l, kappa)

Arguments

y

Numeric vector; vector of edge values.

d_id

Integer matrix; two-column matrix with nr. dyads rows, containing zero-based sender (first column) and receiver (second column) node id's for each dyad.

pi_mat

Numeric matrix; row-stochastic matrix of mixed-memberships.

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.

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.

devs

Vector of standard deviations to use in transformation of variances. 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.

pi_l

List of mixed-membership matrices.

kappa

Numeric matrix; matrix of marginal HMM state probabilities.

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.

.pi.hat

List of predicted mixed-membership matrices, one element per HMM state.

.e.pi

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

Details

These functions are meant for internal use only.