Learn R Programming

netdep (version 0.1.0)

latent.netdep: Generate latent variable dependent network.

Description

Generate latent variable dependent network.

Usage

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 \(\ge\) 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

Run this code
# NOT RUN {
library(netdep)
library(MASS)
library(mvrtn)
library(igraph)
G = latent.netdep(n.node = 100, rho = 0.5, dep.factor = 1)


# }

Run the code above in your browser using DataLab