Learn R Programming

geocmeans (version 0.3.4)

evaluateMatrices: Matrix evaluation

Description

Evaluate if the algorithm converged by comparing two successive membership matrices. Calculate the absolute difference between the matrices and then calculate the max of each row. If all the values of the final vector are below the fixed tolerance, then return True, else return False

Usage

evaluateMatrices(mat1, mat2, tol)

Value

A boolean, TRUE if the test is passed, FALSE otherwise

Arguments

mat1

A n X k matrix giving for each observation n, its probability to belong to the cluster k at iteration i

mat2

A n X k matrix giving for each observation n, its probability to belong to the cluster k at iteration i+1

tol

A float representing the algorithm tolerance

Examples

Run this code
#This is an internal function, no example provided

Run the code above in your browser using DataLab