edgemat: Generate the edge matrix using R

Description Usage Arguments Value Examples

View source: R/edgemat.R

Description

Generate relationships between variables with a set probability

Usage

1
edgemat(p, pr)

Arguments

p

Variable dimension

pr

Probability matrix

Value

a matrix consisting of edge information

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
p <- 100
x <- runif(p,0,1)
y <- runif(p,0,1)
node <- cbind(x,y)
distance <- as.matrix(dist(node))
pr <- matrix(0,nrow = p,ncol = p)
for (i in 1:(p-1)) {
for (j in (i+1):p) {
d <- distance[i,j]
pr[i,j] <- dnorm(d * sqrt(p))
}}
e <- edgemat(p,pr)
## End(Not run)

SC19099/xia documentation built on Jan. 3, 2020, 12:11 a.m.