% prediction of every simple model function [simpre,ypred]=spred(u,y,ypred) global u y my ty t s T theta p n0 ty m sn siy ymin ymax yl1 yl2 for sim=1:m % sim is the number of simple models for s=1:sn-2 epsi=0.01; sita=ones(my,my^2); % estimated value of theta n0=epsi*ones(my,my^2); % occurence table sn1=n0; for t=m+1:T ty=scode(u,y,sim); [sita,sn1]=esti(sn1,sita); spre(s,t)=sita(1,ty)*(ymin)+sita(2,ty)*(yl1(s)+yl2(s))/2+sita(3,ty)*(ymax); for mm=1:my ypred((mm+(s-1)*my)+(sim-1)*my*(sn-2),t)=sita(mm,ty); end end end simpre(sim,:)=ones(1,sn-2)*spre/(sn-2); % prediction of simple models end