home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 9.ddi / IDENT.DI$ / SEARCHOE.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  1.1 KB  |  34 lines

  1. function [t1,w,vl,v,V1,f,st]=searchoe(z,t,g,lim,Vcap,nb,nf,nk,ni)
  2. %SEARCHOE   searches for lower values of the prediction error criterion.
  3. %    
  4. %    [T1,W,VL,V,V1,F,ST]=searchoe(Z,T,G,LIM,V,NB,NF,NK)
  5. %
  6. %    The routine searches for a lower value of the prediction error cri-
  7. %    terion for the output-error model, starting at T, looking in the
  8. %     G-direction. T1 is returned as the parameters that give a lower value V1.
  9. %    If no lower value is found, ST=1. F is the F-polynomial associated
  10. %    with T1, and W, VL, v are the filtered data sequences.
  11. %    The routine is to be used as a subroutine to OE. See OE for
  12. %    an explanation of the other arguments.
  13.  
  14. %    L. Ljung 10-1-86
  15. %    Copyright (c) 1986 by the MathWorks, Inc.
  16. %    All Rights Reserved.
  17.  
  18. l=0;,k=1;V1=Vcap+1; n=nf+nb;st=0;
  19. [mz,nz]=size(z(:,2));
  20. ll=ones(mz,nz)*lim;
  21. while [V1 > Vcap l<10],
  22. t1=t+k*g; if l==9,t1=t;end
  23. f=fstab([1 t1(nb+1:n)']);t1(nb+1:n)=f(2:nf+1)'; 
  24.  
  25.      w=pefilt([zeros(1,nk) t1(1:nb)'],f,z(:,2),z(1:ni,1));
  26.      v=z(:,1)-w;
  27.      vl=max(min(v,ll),-ll);
  28.      V1=v'*vl/(length(v)-ni);
  29.  
  30. home, disp(int2str(l))
  31. k=k/2;
  32. l=l+1; if l==10, st=1;end
  33. end
  34.