1 | function H_new=generate_trajectories(H_old,mi)
|
---|
2 | eps=10^-4;
|
---|
3 | H_new=zeros(size(H_old));
|
---|
4 | H_new(1,:,:)=H_old(1,:,:);
|
---|
5 |
|
---|
6 | for j=1:size(H_old,2)
|
---|
7 | index=j;
|
---|
8 |
|
---|
9 | for i=1:size(H_old,1)-1
|
---|
10 | eta_0=H_new(i,index,1)/(1+eps-H_new(1,index,1));
|
---|
11 | beta_0=sqrt(H_new(i,index,2)/(1+eps-H_new(i,index,2)));
|
---|
12 | s=randn;
|
---|
13 |
|
---|
14 | u=-mi(i,index)*eta_0/(beta_0+eps);
|
---|
15 |
|
---|
16 |
|
---|
17 | eta_1=abs(eta_0+beta_0*u+sqrt(1+u^2)*s);
|
---|
18 | beta_1=sqrt(1+u^2)*beta_0+u*s;
|
---|
19 |
|
---|
20 | H_new(i+1,j,1)=eta_1/(1+eta_1);
|
---|
21 | H_new(i+1,j,2)=beta_1^2/(1+beta_1^2);
|
---|
22 | pom(1,:)=H_new(i+1,j,:);
|
---|
23 | index=find_in_hyperstate5(pom,H_old(i+1,:,:));
|
---|
24 |
|
---|
25 | % plot(H_new(i+1,j,1),H_new(i+1,j,2),'r+'); hold on
|
---|
26 | % plot(H_old(i+1,index,1),H_old(i+1,index,2),'b+'); plot(H_old(i+1,:,1),H_old(i+1,:,2),'g.'); hold off
|
---|
27 | end
|
---|
28 | % plot(H(i,:,1),H(i,:,2),'g.'); hold on
|
---|
29 |
|
---|
30 | end
|
---|
31 | end |
---|