Learn R Programming

nemBM (version 1.00.01)

SSEblock: Sum of squared error across blocks

Description

It calculates the sum of square differences between the desired (specified by an image matrix M) denstities and empirical densities.

Usage

SSEblock(X, M, partition, loops)

Value

Sum of squared error (a single value).

Arguments

X

Initial binary network; of class matrix.

M

Image matrix with block densities.

partition

A partition in a vector format. Each unique value (positive integers) represents one cluster.

loops

Wheter loops are allowed or not.

Author

Marjan Cugmas

Examples

Run this code
X <- matrix(sample(c(0,1), size = 9**2, replace = TRUE), nrow = 9)
diag(X) <- 0
M <- matrix(c(0.1, 0.4, 0.5, 0.3), nrow = 2)
partition <- c(1, 2, 2, 1, 1, 2, 2, 2, 1)
SSEblock(X = X, M = M, partition = partition, loops = TRUE)

Run the code above in your browser using DataLab