sbmt: Sampling Stochstic Tensor Block Models.

Description Usage Arguments Value Examples

View source: R/sbmt.R

Description

Suppose the binary (Poisson) tensor A has expectation structure:

E(A) = [G;Z_1,Z_2,Z_3,...Z_m],

where each row of Z_i's has exactly one non-zero element with value equals to 1.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sbmt(
  n,
  Pi,
  G,
  PoissonEdges = FALSE,
  sparsity = NULL,
  returnParameters = FALSE,
  parametersOnly = FALSE,
  ...
)

Arguments

n

a vector of positive integers specifying the dimensions sizes of each mode.

Pi

a vector with same size as the number of clusters specifying the cluster weights.

G

the core tensor in a multi-dimensional array.

PoissonEdges

boolean indicator. If TRUE, elements of A allows multiple same edges. IF FALSE, A should be a binary tensor.

returnParameters

logical. Return the parameters or not.

parametersOnly

logical. Only return the parameters or not.

...

other parameters.

avgDeg

an integer specifying the expected degree.

Value

A list of three items: The sampled random tensor. The latent factors Zs. The ground truth core tensor G.

Examples

1
2
3
4
n=10
G = array(abs(rnorm(27)),dim = rep(3,3))
Pi = c(0.3,0.3,0.4)
sampleSBM = sbmt(n, Pi, G, sparsity = 0.01)

MuzheZeng/fastRTG documentation built on May 12, 2020, 1:43 p.m.