evaluateMatrices: Matrix evaluation

View source: R/assembling.R

evaluateMatricesR Documentation

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)

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

Value

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

Examples

#This is an internal function, no example provided

geocmeans documentation built on Sept. 12, 2023, 9:06 a.m.