Sinkhorn-Knopp algorithm for matrix normalisation

version 1.1.0.0 (1.88 KB) by
Normalises a matrix so that the row and column sums are all unity

Updated 10 Sep 2015

The Sinkhorn-Knopp algorithm takes a matrix A and finds diagonal matrices D and E such that if M = DAE the sum of each column and each row of M is unity. The method is, in effect, to alternately normalise the rows and the columns of the matrix. This function is an efficient implementation which does not actually carry out normalisation until the iteration is complete and which does not use the transpose of A.

A must be non-negative. If there are zeros in A the algorithm may not converge, depending on their distribution. A maximum number of iterations and/or an error tolerance may be set if required.

A matrix whose rows and columns all sum to unity is termed "doubly stochastic". Such matrices have various applications, including web page ranking.

Reference:

Philip A. Knight (2008) The Sinkhorn–Knopp Algorithm: Convergence and Applications. SIAM Journal on Matrix Analysis and Applications 30(1), 261-275. doi: 10.1137/060659624

Cite As

David Young (2022). Sinkhorn-Knopp algorithm for matrix normalisation (https://www.mathworks.com/matlabcentral/fileexchange/52930-sinkhorn-knopp-algorithm-for-matrix-normalisation), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
{"ft_lang_label":"__label__en","ft_lang_prob":0.79000497,"math_prob":0.78343993,"size":1557,"snap":"2022-05-2022-21","text_gpt3_token_len":342,"char_repetition_ratio":0.11848036,"word_repetition_ratio":0.00913242,"special_character_ratio":0.21194606,"punctuation_ratio":0.11594203,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96558285,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-01-24T20:18:07Z\",\"WARC-Record-ID\":\"<urn:uuid:94a0c9ca-0735-4ab7-9c59-2138b4bbf1ae>\",\"Content-Length\":\"84207\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7b1e6539-376c-478b-8313-27647ac4b6c5>\",\"WARC-Concurrent-To\":\"<urn:uuid:3a59d3ee-5972-4066-b8f9-82decfdc01af>\",\"WARC-IP-Address\":\"184.25.188.167\",\"WARC-Target-URI\":\"https://de.mathworks.com/matlabcentral/fileexchange/52930-sinkhorn-knopp-algorithm-for-matrix-normalisation?s_tid=prof_contriblnk\",\"WARC-Payload-Digest\":\"sha1:K5EGBPKDV3GHIOFRFT2KOCNZGYIJ5OFM\",\"WARC-Block-Digest\":\"sha1:J7O5U7B6AB4DVEVFJQUVUYOCMLMRKM24\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-05/CC-MAIN-2022-05_segments_1642320304600.9_warc_CC-MAIN-20220124185733-20220124215733-00465.warc.gz\"}"}