Normalizing a sparse matrix so that rows sum to 1
Ältere Kommentare anzeigen
I have the following sparse matrix, which relates to a markov process. The parts of the matrix have been assembled sequentially, adding new entries to row, column, and probability one at a time, and only then creating
S = sparse(row,column,probability)
Because the sequential process involves aggregating probabilities from some states that are equaivalent
full(S)
results in a matrix, whose rows sum to more than one. What I wish to achieve is a normalization of each row in S, such that all rows sum to one. How can that be done by operating on S without needing to create the full matrix?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Markov Chain Models finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!