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

  1. function present(th)
  2. %PRESENT  presents a parametric model on the screen
  3. %
  4. %    present(TH)
  5. %
  6. %    This function displays the model TH together estimated standard
  7. %    deviations, innovations variance, loss function and Akaike's Final
  8. %    Prediction Error criterion (FPE).
  9.  
  10. %    L. Ljung 10-1-86
  11. %    Copyright (c) 1986-90 by the MathWorks, Inc.
  12. %    All Rights Reserved.
  13.  
  14. if isthss(th),if th(2,8)==3,eval('presenta(th)'),else eval('presents(th)');
  15. end,return,end
  16. s=1:6;text(1,s)='ARX   ';text(2,s)='BJ    '; text(3,s)='IV    ';
  17. text(4,s)='IV4   ';text(5,s)='PEM   '; text(6,s)='POLY2T';
  18. text(7,s)='ARMAX ';text(8,s)='OE    '; text(9,s)='INIVAL';
  19. text(10,s)='IVAR  ';text(11,s)='IVX   ';text(12,s)='AR    ';
  20. nu=th(1,3); T=th(1,2);
  21. [n1,n2]=size(th);
  22. if nu>0
  23.     na=th(1,4);nb=th(1,5:4+nu);nc=th(1,5+nu);
  24.     nd=th(1,6+nu);nf=th(1,7+nu:6+2*nu); nk=th(1,7+2*nu:6+3*nu);
  25. else na=th(1,4);nb=0;nc=th(1,5);nd=th(1,6);nf=0;nk=0;end
  26. deadtime=0;
  27. if n1>3+na+sum(nb)+nc+nd+sum(nf),
  28.    deadtime=th(n1,1);
  29. end
  30. NAcum=na;,NBcum=NAcum+sum(nb);, NCcum=NBcum+nc;, NDcum=NCcum+nd;
  31. NFcum=NDcum+sum(nf);
  32.  
  33. disp(['This matrix was created by the command ',text(th(2,7),:),' on ',...
  34. int2str(th(2,3)),'/',int2str(th(2,4)),' ',int2str(th(2,2)*100),' at ',...
  35. int2str(th(2,5)),':',int2str(th(2,6))])
  36. if T>0,disp(['Loss fcn: ' num2str(th(1,1)) '   Akaike`s FPE: ' num2str(th(2,1)) ' Sampling interval ' num2str(T)])
  37. else disp(['Loss fcn: ' num2str(th(1,1)) '   Akaike`s FPE: ' num2str(th(2,1))])
  38. disp([' Continuous time model estimated using sampling interval ' num2str(-T)]),
  39. if deadtime, disp(['There is also a system dead-time of ' num2str(deadtime) ' time units']),end,end
  40. disp(['The polynomial coefficients and their standard deviations are'])
  41. if n1>=NFcum+3,for k=1:NFcum,pd(k)=sqrt(th(3+k,k));,end,end
  42. if n1<NFcum+3,for k=1:NFcum,pd(k)=0;end,end
  43. if (nu==1)
  44. if (nb>0), B=[zeros(1,nk) th(3,na+1:NBcum);zeros(1,nk) pd(na+1:NBcum)],end
  45. end
  46. if (nu>1) 
  47.    s=1;
  48.     for rr=1:nu
  49.     if nb(rr)>0,
  50.      disp(['B-polynomial from input # ' int2str(rr)])
  51.      B=[zeros(1,nk(rr)) th(3,na+s:na+s+nb(rr)-1);zeros(1,nk(rr)) pd(na+s:na+s+nb(rr)-1)]
  52.  s=s+nb(rr);
  53.    end
  54.     end
  55. end
  56. if (na>0),A=[1 th(3,1:NAcum);0 pd(1:NAcum)],end
  57. if (nu==1)
  58. if (nf>0),F=[1 th(3,NDcum+1:NFcum);0 pd(NDcum+1:NFcum)],end
  59. end
  60. if (nu>1),
  61. s=1;
  62. for rr=1:nu
  63. if nf(rr)>0,
  64.   disp(['F-polynomial from input # ' int2str(rr)])
  65.   F=[1 th(3,NDcum+s:NDcum+s+nf(rr)-1); 0 pd(NDcum+s:NDcum+s+nf(rr)-1)]
  66.   s=s+nf(rr);
  67. end
  68. end
  69. end
  70. if (nc>0),C=[1 th(3,NBcum+1:NCcum);0 pd(NBcum+1:NCcum)],end
  71. if (nd>0),D=[1 th(3,NCcum+1:NDcum);0 pd(NCcum+1:NDcum)],end
  72.