Learn R Programming

FusedPCA (version 0.2)

fpca: Fused Principal Component Analysis path.

Description

Get the fused principal component analysis path object.

Usage

fpca(A, maxsteps = 200, tol = 1e-3, normalised = T, K = 2, score = F, ridge = T, approx = F) fpca.nonscore(A, maxsteps = 100, tol = 1e-3, normalised = T, K = 2, ridge = T, approx = FALSE) fpca.score(A, maxsteps = 100, tol = 1e-3, K = 2, ridge = T, approx = F) fpca.start(A, maxsteps = 200, tol = 1e-3, normalised = T, K = 2, score = F, ridge = T, approx = F)

Arguments

A
input matrix -- adjacency matrix of an observed graph based on the non-isolated nodes, of dimension n.noniso x n.noniso, where n.noniso is the number of the non-isolated nodes.
maxsteps
an integer specifying the maximum number of steps for the algorithm to take before termination. Default is 200.
tol
a numeric variable giving the tolerance used in the calculation of the hitting and leaving times. A larger value is more conservative, and may cause the algorithm to miss some hitting or leaving events (do not change unless you know what you are getting into!). Default is 1e-3.
normalised
a logic variable indicating whether normalised Laplacian matrix is used in community detection.
K
input integer -- the pre-specified number of communities, with the default value 2.
score
a logical variable indicating whether the RoE is used.
ridge
a logical variable, indicating whether to penalise the $\ell_2$ norm of the estimator, with penalty equal to eps = 1e-8. For convenience, we didn't leave this as an argument.
approx
a logical variable indicating if the approximate solution path should be used (with no dual coordinates leaving the boundary). Default is FALSE.

Value

final.ratio.cluster
the final estimator of the community labels according to the ratio cut criterion.
ratio.location
the location of the chosen estimator on the path according to the ratio cut criterion.
final.normalised.cluster
the final estimator of the community labels according to the normalised cut criterion.
normalised.location
the location of the chosen estimator on the path according to the normalised cut criterion.
final.mod.dcbm.cluster
the final estimator of the community labels according to the modularity criterion based on the DCBM assumption.
mod.dcbm.location
the location of the chosen estimator on the path according to the modularity criterion based on the DCBM assumption.
final.mod.sbm.cluster
the final estimator of the community labels according to the modularity criterion based on the SBM assumption.
mod.sbm.location
the location of the chosen estimator on the path according to the modularity criterion based on the SBM assumption.
final.whole
a matrix if K = 2 and an array if K > 2, which is the estimators of the fused loadings estimators along the path. The matrix is of dimension number of the non-isolated nodes x steps on the path. The array is of dimension number of the non-isolated nodes x steps on the path x (K - 1). If score = T, the estimators are the ratio of eigenvectors.
iso.seq
a vector of indices of the isolated nodes.
final.matrix
a matrix if K = 2 and an array if K > 2, which is the estimators of the fused loadings estimators along the path. The matrix is of dimension number of the non-isolated nodes x steps on the path. The array is of dimension number of the non-isolated nodes x steps on the path x (K - 1). It only appears if score = T.

Details

This function is a wrap-up of functions fpca.start, fpca.cluster, fpca.cut and get.cluster.

References

Feng, Y., Samworth, R. J. and Yu, Y., Community Detection via Fused Principal Component Analysis, manuscript. Holland, P.W., Laskey, K.B. and Leinhardt, S., 1983. Stochastic block models: first steps. Social Networks 5, 109-137. Jin, J., 2012. Fast community detection by score. Karrer, B. and Newman, M.E.J., 2011. Stochastic blockmodels and community structure in networks. Physical Review E 83, 016107.

See Also

fpca.start, fpca.cluster, fpca.cut, get.cluster.

Examples

Run this code
## sbm

## setting

seed = 2
n = 100
theta.in = 0.03
theta.bw = 0.001
K = 2

A = gen.sbm(n, theta.in, theta.bw, K, seed)

# you can try the following to get separate results
# fit.A = fpca.nonscore(A, maxsteps = 100, tol = 1e-3, normalised = TRUE, K = 2, 
# ridge = FALSE, approx = TRUE)
#A.cluster = fpca.nonscore.cluster(fit.A$final.whole)
#A.cut = fpca.cut(A, fit.A, A.cluster)
#get.cluster(A, fit.A$iso.seq, A.cut, A.cluster)

# in fpca.start function, only the matrix/array of the fused loadings estimators
# are get. no further estimation are calculated.
#fit.start.A = fpca.start(A, maxsteps = 100, tol = 1e-3, normalised = TRUE, K = 2, 
# ridge = TRUE, approx = TRUE)
fit.A.wrapup = fpca(A, maxsteps = 200, tol = 1e-3, normalised = TRUE, K = 2, 
ridge = FALSE, approx = TRUE)

## you can also try the following example
### degree-corrected block model
# seed = 2
# K = 2
# n = 100
# theta.in = 0.03
# theta.bw = 0.001
# theta = rep(0, n*K)
# for(i in 1:(n*K)){
#	theta[i] = 0.75 + 0.475*(i/n/K)
# }

# A = gen.dcbm(n = n, theta.in = theta.in, theta.bw = theta.bw, theta = theta, K = 2, 
# seed = seed)
# you can try the following to get separate results
# fit.A = fpca.score(A, maxsteps = 200, tol = 1e-3, K = 2, ridge = FALSE, 
# approx = TRUE)
# in fpca.start function, only the matrix/array of the fused loadings estimators
# are get. no further estimation are calculated.
#fit.start.A = fpca.start(A, maxsteps = 100, tol = 1e-3, normalised = TRUE, K = 2, 
#ridge = TRUE, approx = TRUE, score = TRUE)

# fit.A.wrapup = fpca(A, maxsteps = 200, tol = 1e-3, normalised = TRUE, K = 2, 
# ridge = FALSE, approx = FALSE, score = TRUE)


Run the code above in your browser using DataLab