latent.netdep: Generate latent variable dependent network.

Description Usage Arguments Value Examples

View source: R/latentspace.R

Description

Generate latent variable dependent network.

Usage

1
latent.netdep(n.node, rho = 0.3, dep.factor = 1, dep.range = c(-5, 5))

Arguments

n.node

The number of nodes in network.

rho

correlation coefficient between continuous observations and latent factor .

dep.factor

multiplicative factor applied to.

  • If dep.factor < 0 Then A_ij ~ Bern (logistic ( dep.factor*| X_i - X_j |))

  • If dep.factor 0Then A_ij ~ Bern (logistic ( dep.factor / | X_i - X_j |))

dep.range

a vector specifying lower bound and upper bound for dep.factor*| X_i - X_j |. Defaults to c(-5, 5).

Value

an undirected and binary igraph object G having both Y and U as nodal attributes.

V(G)$outcome

one-dimensional continuous observations.

V(G)$latent

one-dimensional continuous latent variable dependent on V(G)$Y through rho.

Examples

1
2
3
4
5
library(netdep)
library(MASS)
library(mvrtn)
library(igraph)
G = latent.netdep(n.node = 100, rho = 0.5, dep.factor = 1)

netdep documentation built on May 2, 2019, 5:52 a.m.