est.completion: Estimate graphons based on matrix completion scheme

Description Usage Arguments Value References Examples

View source: R/est.completion.R

Description

est.completion adopts a matrix completion scheme, which is common in missing data or matrix reconstruction studies. When given a multiple of, or a single observation, we consider non-existent edges as missing entries and apply the completion scheme. See OptSpace for a more detailed introduction.

Usage

1
2
3
4
5
6
7
8
est.completion(
  A,
  rank = NA,
  tolerance = 0.001,
  maxiter = 20,
  progress = FALSE,
  adjust = TRUE
)

Arguments

A

either

Case 1.

an (n\times n) binary adjacency matrix, or

Case 2.

a list containing multiple of (n\times n) binary adjacency matrices.

rank

an estimated rank condition for the matrix; NA for automatic guessing of a rank, or a positive integer for a user-supplied rank assumption.

tolerance

a tolerance level for singular value thresholding from OptSpace method.

maxiter

the number of maximum iterations for OptSpace method.

progress

a logical value; FALSE for not showing intermediate flags during the process, TRUE otherwise.

adjust

a logical value; TRUE to ignore a guessed rank and set it as 2 upon numerical errors, FALSE to stop the code.

Value

an (n\times n) corresponding probability matrix.

References

\insertRef

Keshavan2010graphon

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## generate a graphon of type No.5 with 3 clusters
W = gmodel.preset(3,id=5)

## create a probability matrix for 100 nodes
graphW = gmodel.block(W,n=100)
P = graphW$P

## draw 10 observations from a given probability matrix
A = gmodel.P(P,rep=10)

## apply the method
res_r3 = est.completion(A,rank=3)       # use rank-3 approximation
res_r9 = est.completion(A,rank=9)       # use rank-9 approximation
res_rN = est.completion(A,adjust=FALSE) # stop the code if guess works poorly

## visualize
opar = par(no.readonly=TRUE)
par(mfrow=c(1,3), pty="s")
image(res_r3, main="rank 3")
image(res_r9, main="rank 9")
image(res_rN, main="rank is guessed")
par(opar)

kisungyou/graphon documentation built on Aug. 13, 2021, 7:29 p.m.