Difference in results when running the different version but simple script.
1 回表示 (過去 30 日間)
古いコメントを表示
I make my own script about calculating the transition probability of Markov Chain.I run the two scripts and get different results.Can you detect what makes the difference? What I was doing is
[t,j]=size(sets);
p00=zeros(j,1);
p01=zeros(j,1);
p10=zeros(j,1);
p11=zeros(j,1);
for i=1:j,
prev=sets(1:t-1,i);
next=sets(2:t,i);
p00(i)=sum(prev <= 1 & next <= 1)/sum(sets<=1);
p01(i)=sum(prev <= 1 & next > 1)/sum(sets<=1);
p10(i)=sum(prev > 1 & next <= 1)/sum(sets>1);
p11(i)=sum(prev > 1 & next > 1)/sum(sets>1);
end
Another very similiar version is
for i=1:nv,
s0=sequence(1:nt-1,i);
s1=sequence(2:nt,i);
ndry=length(find(s0 <= threshold));
nwet=length(find(s0 > threshold));
p00(i)=length(find(s0 <= threshold & s1 <= threshold))/ndry;
p01(i)=length(find(s0 <= threshold & s1 > threshold))/ndry;
p10(i)=length(find(s0 > threshold & s1 <= threshold))/nwet;
p11(i)=length(find(s0 > threshold & s1 > threshold))/nwet;
end
0 件のコメント
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!