1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
| function truc()
yy=[10 11 10 11 12 13 14 15 16 12 11 12 14 15 16 17 13 14 15 16 17 ...
18 17 20 21 22 20 21 23 24 25 26 20 16 17 18 19 30 31 32 30 33 ...
34 35 31 29 28 27 31 33 36 30 ]';
y=yy(5:end);
s_F=y-yy(1:end-4);
s_G=y;
d_F=1;
d_G=2;
p=4;
gamma_1_F=0.1;
gamma_2_F=0.1;
c_1_F=0;
c_2_F=0;
gamma_1_G=0.1;
gamma_2_G=0.1;
c_1_G=0;
c_2_G=0;
x=matrix_exp(y,p,d_F,s_F,d_G,s_G,gamma_1_F,gamma_2_F,c_1_F, c_2_F,gamma_1_G,gamma_2_G, c_1_G, c_2_G);
function x=matrix_exp(y,p,d_F,s_F,d_G,s_G,gamma_1_F,gamma_2_F,c_1_F, c_2_F,gamma_1_G,gamma_2_G, c_1_G, c_2_G)
T=length(y);
m=max([p d_F d_G]);
%global T m
stdS=inv(std(s_F));
stdG=inv(std(s_G));
f=(exp(-gamma_1_F*stdS*(s_F-c_1_F))+exp(gamma_2_F*stdS*(s_F-c_2_F)))./...
(1+exp(-gamma_1_F*stdS*(s_F-c_1_F))+exp(gamma_2_F*stdS*(s_F-c_2_F)));
g=(exp(-gamma_1_G*stdG*(s_G-c_1_G))+exp(gamma_2_G*stdG*(s_G-c_2_G)))./...
(1+exp(-gamma_1_G*stdG*(s_G-c_1_G))+exp(gamma_2_G*stdG*(s_G-c_2_G)));
% br=zeros(T-m,4);
% for k=1:T-m
% for j=1:4
% if k==j
% br(k,j)=1;
% elseif rem(abs(k-j),4)==0
% br(k,j)=1;
% else
% br(k,j)=0;
% end
% end
% end
%**
%"diagonales" à 1
%Hypothèse FORTE : T-m est un multiple de 4
minS = min(size(br));
maxS = max(size(br));
br = repmat(eye(minS),maxS/minS,1);
%**
brf=zeros(length(br),4);
for i=1:length(br)
for k=1:4
brf(i,k)=br(i,k)*f(i,1);
end
end
x=zeros(T-m,2*p+8);
x(1:T-m,1:4) = br(1:T-m,:);
% for i=1:T-m
% for j=1:4
% x(i,j)=br(i,j);
% end
% end
x(1:T-m,5:8) = brf(1:T-m,:);
% for i=1:T-m
% for j=5:8
% x(i,j)=brf(i,j-4);
% end
% end
for i=1:T-m
for j=1:p
x(i,j+8)=y(m+1-j,1);
x(i,j+p+8)=x(i,j+1)*g(i,1);
end
end
return |
Partager