フィルターのクリア

Markov processing and Eigenvectors

2 ビュー (過去 30 日間)
Brave A
Brave A 2019 年 9 月 25 日
編集済み: Brave A 2019 年 9 月 26 日
Hello I am trying to compute the eigenvectors and eigenvalues of the transition matrix . And plot the limiting distribution
And here my attempt to solve it.
I could not got the correct eignvalue and the correct plot. I think I need to normalize it but it's not work with me.
Thaks in advance!
input=fileread('amino.txt');
Amino=['A', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'Y', '$'];
Amino=Amino';
n=size(Amino);
total=0;
for i=1:size(Amino)
List(i)=length(strfind(input,Amino(i)));
end
List=List';
%normalize
% List_sum=sum(List);
% for i=1:size(List)
% List(i)=List(i)/List_sum;
%
% end
for i=1:size(Amino)
for j=1:size(Amino)
f=strcat(Amino(i),Amino(j))
result(j,i)= length(strfind(input,strcat (Amino(i),Amino(j))))/List(i);
end
end
% normalize
List_sum=sum(List);
for i=1:size(List)
List(i)=List(i)/List_sum;
end
Cond_prob=0;
for i=1:length(result)
Calc_ent=0;
for j=1:length(result)
Calc_ent=Calc_ent+result(j,i)*log2(result(j,i));
end
Cond_prob=Cond_prob+res(i)*Calc_ent;
end
Cond_prob=-Cond_prob;
  2 件のコメント
Walter Roberson
Walter Roberson 2019 年 9 月 25 日
Brave A
Brave A 2019 年 9 月 25 日
?

サインインしてコメントする。

回答 (1 件)

Brave A
Brave A 2019 年 9 月 25 日
Any thoughts?

カテゴリ

Help Center および File ExchangeMarkov Chain Models についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by