Learn R Programming

graphon (version 0.2.0)

gmodel.preset: Generate one of pre-specified graphons.

Description

gmodel.preset generates one of pre-specified graphons of size (n-by-n). Users can select one of 10 different graphons by their id, an integer from 1 to 10. The table of available graphons follows that of the reference article given below.

Usage

gmodel.preset(n, id = 1, sort = TRUE)

Arguments

n

the number of nodes for a graphon to be generated.

id

an integer from 1 to 10, each corresponding to a specific graphon model.

sort

a logical value; TRUE to sort in an decreasing order of degree, FALSE otherwise.

Value

an (n-by-n) graphon matrix.

References

Chan, S.H. and Airoldi, E.M. (2014) A consistent histogram estimator for exchangeable graph models. Journal of Machine Learning Research Workshop and Conference Proceedings, Vol.32, No.1:208-216.

Examples

Run this code
# NOT RUN {
## Generate 3 random graphons of nodal size 100.
n  = 100
r3 = (sample(1:10,3))
W1 = gmodel.preset(n,id=r3[1])
W2 = gmodel.preset(n,id=r3[2])
W3 = gmodel.preset(n,id=r3[3])

## Generate corresponding observations and plot them
A1 = gmodel.P(W1)
A2 = gmodel.P(W2)
A3 = gmodel.P(W3)

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab