nSmooth: estimates probabilty matrix by neighborhood smoothing

View source: R/RCode.R View source: R/RCode.R

nSmoothR Documentation

estimates probabilty matrix by neighborhood smoothing

Description

estimates probabilty matrix by neighborhood smoothing of Zhang et. al. (2017)

Usage

nSmooth(A, h = NULL)

Arguments

A

adjacency matrix

h

quantile value used for smoothing. Recommended to be in the scale of sqrt(log(n)/n) where n is the size of the network. The default value is sqrt(log(n)/n) from the paper.

Details

The method assumes a graphon model where the underlying graphon function is piecewise Lipchitz. However, it may be slow for moderately large networks, though it is one of the fastest methods for graphon models.

Value

the probability matrix

Author(s)

Tianxi Li, Elizaveta Levina, Ji Zhu

Maintainer: Tianxi Li <tianxili@virginia.edu>

References

Zhang, Y.; Levina, E. & Zhu, J. Estimating network edge probabilities by neighbourhood smoothing Biometrika, Oxford University Press, 2017, 104, 771-783

Examples



N <- 100

U = matrix(1:N,nrow=1) / (N+1)
V = matrix(1:N,nrow=1) / (N+1)

W = (t(U))^2
W = W/3*cos(1/(W + 1e-7)) + 0.15

upper.index <- which(upper.tri(W))

A <- matrix(0,N,N)


rand.ind <- runif(length(upper.index))

edge.index <- upper.index[rand.ind < W[upper.index]]

A[edge.index] <- 1

A <- A + t(A)
diag(A) <- 0

What <- nSmooth(A)



randnet documentation built on May 31, 2023, 6:44 p.m.