stochasticMatrixPro​jection(A,projectio​n_type)

Finds the closest stochastic matrix
169 download
Aggiornato 23 mag 2015

Visualizza la licenza

Given a matrix A it finds the closest matrix which is column stochastic (left stochastic matrix ).
This is based on vector implementation in http://www.mathworks.com/matlabcentral/fileexchange/30332-projection-onto-simplex which is based on the paper http://arxiv.org/abs/1101.6081
Two type of projections are supproted:
1. "on simplex" - Each entry is in [0,1] and each columns sums to one.
2. "inside simplex" - Each entry is in [0,1] and each columns sum is also in [0,1]
input:
A - matrix, which columns to project
projection_type - which type of projection to make:
'on' - on the simplex, each column sums to one (default)
'inside' - inside the simplex, each column sum is in the interval[0,1]
example:
vec_2d = rand(2,200)*3 - 1;
proj_vec = stochasticMatrixProjection(vec_2d,'on');
subplot(1,2,1);
plot([vec_2d(1,:);proj_vec(1,:)],[vec_2d(2,:);proj_vec(2,:)],...
[vec_2d(1,:);proj_vec(1,:)],[vec_2d(2,:);proj_vec(2,:)],'.'); axis equal
subplot(1,2,2);
proj_vec = stochasticMatrixProjection(vec_2d,'inside');
plot([vec_2d(1,:);proj_vec(1,:)],[vec_2d(2,:);proj_vec(2,:)],...
[vec_2d(1,:);proj_vec(1,:)],[vec_2d(2,:);proj_vec(2,:)],'.'); axis equal

Cita come

Lior Kirsch (2024). stochasticMatrixProjection(A,projection_type) (https://www.mathworks.com/matlabcentral/fileexchange/50779-stochasticmatrixprojection-a-projection_type), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2014b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Polynomials in Help Center e MATLAB Answers
Riconoscimenti

Ispirato da: Projection onto simplex

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.3.0.0

Replaced repmat with bsxfun

1.2.0.0

Example added.

1.1.0.0

* added text to the description

1.0.0.0