Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ECV.nSmooth.lowrank

selecting tuning parameter for neighborhood smoothing estimation of graphon model


Description

selecting tuning parameter for neighborhood smoothing estimation of graphon model where the tuning parameter is to control estimation smoothness.

Usage

ECV.nSmooth.lowrank(A, h.seq, K, cv = NULL, B = 3, holdout.p = 0.1)

Arguments

A

adjacency matrix

h.seq

a sequence of h values to tune. It is suggested h should be in the order of sqrt(log(n)/n).

K

the optimal rank for approximation. Can be obtained by rank selection of ECV.

cv

cross-validation fold. Recomend to use replication number B instead.

B

independent replication number of random splitting

holdout.p

proportion of test sample

Details

The neighborhood smoothing estimation can be slow, so the ECV may take long even for moderately large networks.

Value

a list object with

err

average validation error for h.seq

min.index

index of the minimum error

Author(s)

Tianxi Li, Elizaveta Levina, Ji Zhu
Maintainer: Tianxi Li tianxili@umich.edu

References

T. Li, E. Levina, and J. Zhu. Network cross-validation by edge sampling. arXiv preprint arXiv:1612.04717, 2016.

Examples

set.seed(500)
N <- 300

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



#ecv.rank <- ECV.Rank(A,10,B=3,weighted=FALSE,mode="undirected")

#K.hat <- ecv.rank$auc.rank ## first estimate a good rank


#h.seq <- sqrt(log(N)/N)*seq(0.5,5,by=0.5)


#ecv.nsmooth <- ECV.nSmooth.lowrank(A,h.seq,K=2,B=3) ## nSmooth can be slow

#h <- h.seq[ecv.nsmooth$min.index]

#What <- nSmooth(A,h=h)

#par(mfrow=c(1,2))
#image(t(W[N:1,]))
#image(t(What[N:1,]))

randnet

Random Network Model Selection and Parameter Tuning

v0.2
GPL (>= 2)
Authors
Tianxi Li, Elizaveta Levina, Ji Zhu
Initial release
2019-02-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.